paulstarke/PhaseBetweener

In MotionProcessor, when clicking "Process" an error is thrown

dj-kefir-siorbacz opened this issue · 6 comments

As the title says, I get the following error:

NullReferenceException: Object reference not set to an instance of an object
MotionProcessor+<Process>d__25.MoveNext () (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/DataProcessing/Processor/MotionProcessor.cs:298)
EditorCoroutines.MoveNext (EditorCoroutines+EditorCoroutine coroutine) (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/Extensions/EditorCoroutines/EditorCoroutines.cs:336)
EditorCoroutines.GoStartCoroutine (EditorCoroutines+EditorCoroutine coroutine) (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/Extensions/EditorCoroutines/EditorCoroutines.cs:279)
EditorCoroutines.GoStartCoroutine (System.Collections.IEnumerator routine, System.Object thisReference) (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/Extensions/EditorCoroutines/EditorCoroutines.cs:253)
EditorCoroutines.StartCoroutine (System.Collections.IEnumerator routine, System.Object thisReference) (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/Extensions/EditorCoroutines/EditorCoroutines.cs:124)
EditorCoroutineExtensions.StartCoroutine (UnityEditor.EditorWindow thisRef, System.Collections.IEnumerator coroutine) (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/Extensions/EditorCoroutines/EditorCoroutineExtensions.cs:9)
MotionProcessor.OnGUI () (at C:/Users/Wojtek/Desktop/prgr/PhaseBetweener/Unity/Assets/Scripts/DataProcessing/Processor/MotionProcessor.cs:178)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <5ad584e208e14caaa9e6b2e6027e9204>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <5ad584e208e14caaa9e6b2e6027e9204>:0)
UnityEditor.DockArea.OldOnGUI () (at <5ad584e208e14caaa9e6b2e6027e9204>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <08270fb28ecf479b927dcf4fe817bc07>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <00a477ed1abf4030be646c3244bd3667>:0)

Here's my screenshot:
image

Also, this is the state of the animation after its attached to the LaFAN model:

PhaseBetweener.-.wojtek_scene_3.-.PC.Mac.Linux.Standalone.-.Unity.2020.3.18f1_._DX11_.2023-07-25.11-02-35.mp4

Maybe it's all right because I haven't yet run the MotionProcessor?

Same issue with raw LaFAN .bvh dataset:
image

And the mesh is also deformed when I attach it to the skeleton:
image

Hi there,
the processing pipeline is specified for the LaFan character and it's skeleton. When using another dataset with a different skeleton you will need to write a processing pipeline for it.

Did you tried reproduce the LaFan model? I recommend to first fully reproduce the steps in the readme with LaFan to understand the pipeline and processes before starting with your own data.

Hi @pauzii,

Yeah, I tried raw LaFAN .bvh data (downloaded from here: https://github.com/ubisoft/ubisoft-laforge-animation-dataset/blob/master/lafan1/lafan1.zip) and the results are on the above screenshots: #4 (comment)

So still there's the same NullReferenceException and the LaFAN prefab gets messed up when I attach it to "Character" in the MotionEditor.cs

I was able to reproduce the error and updated the steps in the readme. Please clone the repo again or download MotionProcessor.cs and the ExampleMocap.unity scene that I've added.

  • The bhv importer is not properly working when having an unsaved scene opened inside Unity. Solved by loading one of the demo scenes.
  • The mesh deformations come from the fact that you need to flip the bones along the xpos axis during import via bhv importer.
  • NullReferenceExceptions fixed in MotionProcessor.cs

Thank you for pointing this out, let me know if it works now!

Thanks! Now it works!

btw. I noticed that in your instruction on using the Autohring Tool, you don't mention 1) attaching the camera to Character and 2) attaching NN model (to Character or Authoring, don't remember)