회원 로그인
정보기억 정보기억에 체크할 경우 다음접속시 아이디와 패스워드를 입력하지 않으셔도 됩니다.
그러나, 개인PC가 아닐 경우 타인이 로그인할 수 있습니다.
PC를 여러사람이 사용하는 공공장소에서는 체크하지 마세요.
소셜네트워크 서비스를 통해서 로그인하시면 별도의 로그인 절차없이 회원서비스를 이용하실 수 있습니다.


최근 게시물

1.노션에서 작성 중

1.노션에서 작성 중

개편하기 전까지 노션에서 작성 중

2024.04.04//read more

2.ChatGPT

2.ChatGPT

OpenAI로 대규모 언어 모델대화형...

2023.03.16//read more

3.노코딩 게임 엔진 - 빌..

3.노코딩 게임 엔진 - 빌..

빌드 지원안드로이드iOS윈도우즈특이사...

2023.03.14//read more

4.(완료) 미접속 회원 정..

4.(완료) 미접속 회원 정..

[완료] 36명의 회원을 정리하였습니...

2023.02.16//read more

5.매뉴얼 플러스 - 전자제..



안정적인 DNS 서비스 DNSEver
DNS Powered by DNSEver.com


3D파일 Animation의 Read-Only

푸딩뱃살 | 2016.07.22 15:13 | 조회 6878
3D파일 Animation의 Read-Only



*.max, *.ma, *.fbx와 같은 3D파일을 유니티에서 임포트가 가능한데 애니메이션이 들어간 리소스 같은 경우 Read-Only 표시와 함께 애니메이션 키 수정을 비롯한 애니메이션 이벤트를 줄 수가 없어 당황 스럽다.(리소스를 수정/저장 못한다는건 당연하겠지만...)



<Edit/Duplicate 또는 단축키 Ctrl+D로 복제된 *.anim 파일들>

해결책으로 임포트한 3D 리소스의 애니메이션들을 복제(duplicate, ctrl+d)



Animator창 State/Motion에 anim들을 다시 연결하면 된다. 

anim 복제하기 스크립트(CurvesTransferer)라는 것이 있는데 제대로 작동이 안되는 듯하다.(아래)
스크립트도 오래전 것이라 유니티에서 사용안하는 api가 있다.
using UnityEditor;
using UnityEngine;
using System.IO;

public class MultipleCurvesTransferer
{
    const string duplicatePostfix = "_copy";
    const string animationFolder = "Animations";

    static void CopyClip(string importedPath, string copyPath)
    {
        AnimationClip src = AssetDatabase.LoadAssetAtPath(importedPath, typeof(AnimationClip)) as AnimationClip;
        AnimationClip newClip = new AnimationClip();
        newClip.name = src.name + duplicatePostfix;
        AssetDatabase.CreateAsset(newClip, copyPath);
        AssetDatabase.Refresh();
    }

    [MenuItem("Assets/Transfer Multiple Clips Curves to Copy")]
    static void CopyCurvesToDuplicate()
    {
        // Get selected AnimationClip
        Object[] imported = Selection.GetFiltered(typeof(AnimationClip), SelectionMode.Unfiltered);
        if (imported.Length == 0)
        {
            Debug.LogWarning("Either no objects were selected or the objects selected were not AnimationClips.");
            return;
        }

        //If necessary, create the animations folder.
        if (Directory.Exists("Assets/" + animationFolder) == false)
        {
            AssetDatabase.CreateFolder("Assets", animationFolder);
        }

        foreach (AnimationClip clip in imported)
        {
            string importedPath = AssetDatabase.GetAssetPath(clip);

            Debug.Log("clipPath: " + importedPath);

            //If the animation came from an FBX, then use the FBX name as a subfolder to contain the animations.
            string copyPath;
            if (importedPath.Contains(".fbx") || importedPath.Contains(".FBX"))
            {
                //With subfolder.
                string folder = importedPath.Substring(importedPath.LastIndexOf("/") + 1, importedPath.LastIndexOf(".") - importedPath.LastIndexOf("/") - 1);
                if (!Directory.Exists("Assets/Animations/" + folder))
                {
                    AssetDatabase.CreateFolder("Assets/Animations", folder);
                }
                copyPath = "Assets/Animations/" + folder + "/" + clip.name + duplicatePostfix + ".anim";
            }
            else
            {
                //No Subfolder
                copyPath = "Assets/Animations/" + clip.name + duplicatePostfix + ".anim";
            }

            Debug.Log("CopyPath: " + copyPath);

            CopyClip(importedPath, copyPath);

            AnimationClip copy = AssetDatabase.LoadAssetAtPath(copyPath, typeof(AnimationClip)) as AnimationClip;
            if (copy == null)
            {
                Debug.Log("No copy found at " + copyPath);
                return;
            }
            // Copy curves from imported to copy
            AnimationClipCurveData[] curveDatas = AnimationUtility.GetAllCurves(clip, true);
            for (int i = 0; i < curveDatas.Length; i++)
            {
                AnimationUtility.SetEditorCurve(
                    clip,
                    EditorCurveBinding.FloatCurve(curveDatas[i].path, curveDatas[i].type, curveDatas[i].propertyName),
                    curveDatas[i].curve
                    );
                //    AnimationUtility.SetEditorCurve(
                //         copy,
                //         curveDatas[i].path,
                //          curveDatas[i].type,
                //         curveDatas[i].propertyName,
                //         curveDatas[i].curve
                //     );
            }
            Debug.Log("Copying curves into " + copy.name + " is done");
        }
    }
}
스크립트 출처> http://answers.unity3d.com/questions/8172/how-to-add-new-curves-or-animation-events-to-an-im.html
참고> http://devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=6261
       http://answers.unity3d.com/questions/187907/how-to-add-keyframes-on-imported-read-only-animati.html

146개(2/8페이지)
유니티
번호 제목 글쓴이 조회 날짜
공지 유니티 강좌 모음(영문) 푸딩뱃살 60266 2013.08.28 12:02
공지 유니티 경고, 에러 모음 (재정리 예정) 첨부파일 [1+1] 푸딩뱃살 71051 2013.08.12 00:09
124 [스트립트] VR Cardboard 토글 첨부파일 푸딩뱃살 2662 2017.08.17 17:36
123 [참고] Unitypackage Unpacker 첨부파일 [1+1] 푸딩뱃살 4031 2017.08.08 17:02
122 [유니티] Unite 2017 서울 - 발표 자료 링크 첨부파일 푸딩뱃살 5439 2017.05.31 10:13
121 [유니티] Terrain Setting - Resolution 푸딩뱃살 2773 2017.05.25 00:12
120 [유니티] Unite 2013 - Real-time facial animation with Mixamo and 푸딩뱃살 2965 2017.05.22 18:12
119 [유니티] Unite 2016 서울 다시보기 푸딩뱃살 2612 2017.05.18 09:49
118 [유니티] 유니티 프로그램 빌드 과정 첨부파일 푸딩뱃살 2547 2017.03.26 14:32
117 [VR/AR] Google Cardboard VR (GVR) 임포트 시 첨부파일 푸딩뱃살 2143 2017.03.19 21:05
116 [유니티] 맥os 안드로이드 SDK와 JDK 경로 푸딩뱃살 2202 2017.03.09 11:44
115 [유니티] Failed to compile resuources with the following paramet 첨부파일 푸딩뱃살 4459 2017.03.04 10:20
>> [유니티] 3D파일 Animation의 Read-Only 첨부파일 푸딩뱃살 6879 2016.07.22 15:13
113 [스트립트] List를 사용한 코루틴 모두 실행 푸딩뱃살 3713 2016.04.28 01:17
112 [유니티] 특정 Scene에서 Sprite 깨짐 현상 푸딩뱃살 8626 2016.03.03 01:27
111 [유니티] 구글 플레이 서비스 에러: CommandInvokationFailure 첨부파일 푸딩뱃살 13772 2016.02.29 18:51
110 [스트립트] 해상도 구하기 푸딩뱃살 3969 2016.02.28 23:13
109 [스트립트] Android (반)자동 Setting 첨부파일 푸딩뱃살 4131 2016.02.04 15:24
108 [스트립트] Invoke() / InvokeRepeating() 푸딩뱃살 7348 2016.02.04 14:45
107 [스트립트] DontDestroyOnLoad() 푸딩뱃살 6693 2016.01.29 13:20
106 [스트립트] 버젼 관리 푸딩뱃살 3321 2016.01.20 15:48
105 [유니티] 서버를 이용한 inApp 프로세스 첨부파일 푸딩뱃살 3986 2016.01.12 12:32