Skip to content
Snippets Groups Projects
Commit 234feb3c authored by unknown's avatar unknown
Browse files

Fixed Animation Recorder, you can now start the recording from in VR

parent 49683c0b
No related branches found
No related tags found
1 merge request!1Vr rigged
......@@ -51,7 +51,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 5d6f365b6030a4d4da5f8515a77ce054, type: 2}
m_Motion: {fileID: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
......@@ -67,7 +67,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102799565123630316}
m_Position: {x: 288, y: -12, z: 0}
m_Position: {x: 336, y: 108, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
......
This diff is collapsed.
......@@ -25,10 +25,14 @@ public class MotionRecorder : MonoBehaviour
private void Start()
{
animator = GetComponent<Animator>();
ResetRecorder();
}
public void ResetRecorder()
{
//it's totally a good sign when the references says "TODO"
m_recorder = new GameObjectRecorder(gameObject);
m_recorder.BindComponentsOfType<Transform>(gameObject, true); //this results in an animation that "works", but not on humanoids :(
}
......@@ -38,6 +42,7 @@ public class MotionRecorder : MonoBehaviour
if (m_clip != null) {
SteamVR_Controller.Input(Input.GetButtonDown("Button1") ? 1 : 2).TriggerHapticPulse(1000);
m_recording = true;
previewAnimator.SetTrigger("StopPreview");
m_clip.ClearCurves();
......@@ -55,12 +60,14 @@ public class MotionRecorder : MonoBehaviour
SteamVR_Controller.Input(Input.GetButtonDown("Button1") ? 1 : 2).TriggerHapticPulse(1000);
m_recorder.SaveToClip(m_clip);
m_recorder.ResetRecording();
m_clip.SampleAnimation(previewAnimator.gameObject, 0);
m_clip.EnsureQuaternionContinuity();
previewAnimator.gameObject.SetActive(true);
ResetRecorder();
if (!previewAnimator.isInitialized)
previewAnimator.Rebind();
if (previewAnimator.gameObject.activeSelf && previewAnimator.isActiveAndEnabled)
{
previewAnimator.SetTrigger("PlayPreview");
}
foreach (GameObject indicator in indicators) {
......
m_EditorVersion: 2018.2.6f1
m_EditorVersion: 2018.2.7f1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment