Cant create RootMotion - TargetException

Julian Bydzovsky 7 years ago updated by tmpxyz 6 years ago 8
I have troubles creatimg root motion for an animation created with skele.
I just click on the "make root motion" button, drag the root transform into the window but then those errors appear:
RCall.GetProp: Failed to get prop "UnityEditor.AnimationWindow.state"

TargetException: Non-static field requires a target
System.Reflection.MonoField,GetValue(System.Object obj)

and sometimes
RenderTexture warning: Destroying active render texture. Switching to main context.

i'm using Unity 5.1.1f1,
please help, I need those animations badly - I can't go on with my project :(
The "failed to get prop" error also appears when I open the CCEditor, all of those errors appear when I open the AnimCurveProp editor...
I'm working on a mac but on windows the same errors occur too... I wonder if someone else has the same problem..
Also tried to reimport Skele but still the same error...
Sorry I don't want to be pushy but I have a deadline in four days and I really need help :(
Under review
Hi, Julian Bydzovsky,

Thanks for the report,
I've reproduced this bug on Unity5.1.

A hotfix has post on the forum, the fix will be included in next update.

You should see in SMREditor.cs about line 4255:
object uawstate = RCall.GetProp("UnityEditor.AnimationWindow", "state", uaw);

Replace it with:
object animEditor = RCall.GetField("UnityEditor.AnimationWindow", "m_AnimEditor", uaw);
object uawstate = RCall.GetField("UnityEditor.AnimEditor", "m_State", animEditor);

The new update v1.8.1f1 fixed this issue, you could update it when you get time.

Method for creating RootMotion is updated, check the post below: