public void createAnimationRecorder()
    {
        // ANIMATION RECORDER


        AnimationRecorderSettings  AnimRecorder       = ScriptableObject.CreateInstance <AnimationRecorderSettings>();
        RecorderControllerSettings controllerSettings = ScriptableObject.CreateInstance <RecorderControllerSettings>();

        UnityEditor.Recorder.Input.AnimationInputSettings anim = new UnityEditor.Recorder.Input.AnimationInputSettings();
        anim.gameObject = ParentAvatar;
        Debug.Log(typeof(Transform));
        anim.AddComponentToRecord(typeof(Transform));
        anim.AddComponentToRecord(typeof(SkinnedMeshRenderer));
        anim.Recursive = true;


        AnimRecorder.name              = "MoCapRocketbox";
        AnimRecorder.FrameRate         = 30;
        AnimRecorder.FrameRatePlayback = FrameRatePlayback.Constant;
        AnimRecorder.CapFrameRate      = true;
        filepath = Application.dataPath + "/Resources/RB_animation" + DateTime.Now.Day + "_" + DateTime.Now.TimeOfDay;
        AnimRecorder.OutputFile             = filepath;
        AnimRecorder.RecordMode             = RecordMode.Manual;
        AnimRecorder.AnimationInputSettings = anim;
        AnimRecorder.Enabled = true;

        // controllerSettings.FrameRate = 30;
        controllerSettings.AddRecorderSettings(AnimRecorder);
        recorder = new RecorderController(controllerSettings);
        // controllerSettings.SetRecordModeToManual();
        //  controllerSettings.Save();
    }
        public void SetUp()
        {
            var recorderAsset = recorderClip.asset as RecorderClip;

            aniSettings            = ScriptableObject.CreateInstance <AnimationRecorderSettings>();
            recorderAsset.settings = aniSettings;

            var input = aniSettings.InputsSettings.First() as AnimationInputSettings;

            input.gameObject = cube;
            input.AddComponentToRecord(typeof(Transform));
            recorderAsset.settings.OutputFile = "Assets/" + Path.GetFileNameWithoutExtension(Path.GetTempFileName());
            deleteFileList.Add(recorderAsset.settings.OutputFile + ".anim");
        }
Beispiel #3
0
    void SetupNewRecorder()
    {
        // creating animation recorder and assigning the camera to it
        animationRecorderSettings = ScriptableObject.CreateInstance("AnimationRecorderSettings") as AnimationRecorderSettings;
        animationRecorderSettings.animationInputSettings.recursive  = true;
        animationRecorderSettings.animationInputSettings.gameObject = this.gameObject;
        animationRecorderSettings.animationInputSettings.AddComponentToRecord(typeof(Transform));

        // creating recorder settings and assigning our animation recorder settings to it
        actorRecorderSettings = ScriptableObject.CreateInstance("RecorderControllerSettings") as RecorderControllerSettings;
        actorRecorderSettings.AddRecorderSettings(animationRecorderSettings);
        actorRecorderSettings.SetRecordModeToManual();

        // creating a new recorder instance with the correct settings
        actorRecorder = new RecorderController(actorRecorderSettings);
    }
    void SetupNewRecorder()
    {
        // creating animation recorder and assigning the camera to it
        cameraMovementRecorderSettings = ScriptableObject.CreateInstance("AnimationRecorderSettings") as AnimationRecorderSettings;
        cameraMovementRecorderSettings.animationInputSettings.recursive  = false;
        cameraMovementRecorderSettings.animationInputSettings.gameObject = this.gameObject;
        cameraMovementRecorderSettings.animationInputSettings.AddComponentToRecord(typeof(Transform));
        cameraMovementRecorderSettings.animationInputSettings.AddComponentToRecord(typeof(Camera));


        // creating recorder settings and assigning our animation recorder settings to it
        filmbackRecorderSettings = ScriptableObject.CreateInstance("RecorderControllerSettings") as RecorderControllerSettings;
        filmbackRecorderSettings.AddRecorderSettings(cameraMovementRecorderSettings);
        filmbackRecorderSettings.SetRecordModeToManual();

        // creating a new recorder instance with the correct settings
        filmbackRecorder = new RecorderController(filmbackRecorderSettings);
    }