Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

InvalidOperationException When I press play

Discussion in 'Animation Rigging' started by FreddyFred, Jan 1, 2020.

  1. FreddyFred

    FreddyFred

    Joined:
    Jan 13, 2014
    Posts:
    1
    Hello,
    Every time I press play in the console I keep getting this error:

    InvalidOperationException: The TransformStreamHandle cannot be resolved.
    UnityEngine.Animations.TransformStreamHandle.CheckIsValidAndResolve (UnityEngine.Animations.AnimationStream& stream) (at <0d2763ad82354fc6a022a2846086ca7b>:0)
    UnityEngine.Animations.TransformStreamHandle.GetLocalTRS (UnityEngine.Animations.AnimationStream stream, UnityEngine.Vector3& position, UnityEngine.Quaternion& rotation, UnityEngine.Vector3& scale) (at <0d2763ad82354fc6a022a2846086ca7b>:0)
    UnityEngine.Animations.Rigging.ReadWriteTransformHandle.GetLocalTRS (UnityEngine.Animations.AnimationStream stream, UnityEngine.Vector3& position, UnityEngine.Quaternion& rotation, UnityEngine.Vector3& scale) (at Library/PackageCache/com.unity.animation.rigging@0.2.5-preview/Runtime/AnimationJobs/TransformHandle.cs:13)
    UnityEngine.Animations.Rigging.AnimationRuntimeUtils.PassThrough (UnityEngine.Animations.AnimationStream stream, UnityEngine.Animations.Rigging.ReadWriteTransformHandle handle) (at Library/PackageCache/com.unity.animation.rigging@0.2.5-preview/Runtime/Utils/AnimationRuntimeUtils.cs:220)
    UnityEngine.Animations.Rigging.MultiParentConstraintJob.ProcessAnimation (UnityEngine.Animations.AnimationStream stream) (at Library/PackageCache/com.unity.animation.rigging@0.2.5-preview/Runtime/AnimationJobs/MultiParentConstraintJob.cs:95)
    UnityEngine.Animations.ProcessAnimationJobStruct`1[T].Execute (T& data, System.IntPtr animationStreamPtr, System.IntPtr methodIndex, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <0d2763ad82354fc6a022a2846086ca7b>:0)

    Can anyone help me with this issue? maybe this is the reason why my animation rigging isn't working properly?
     
  2. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi,

    We're missing some information in order to help you. What version of Unity are you using? Also, how is your constraint setup? Is this a generic hierarchy or a humanoid hierarchy?

    Perhaps you are trying to write in a transform component that is outside of the animated hierarchy?

    Also, we fixed some errors in the last few months where some hierarchies could not resolve their nested animated transforms properly. Maybe check with a newer version of 2019.2, 2019.3 or 2020.1.
     
  3. ddark1990

    ddark1990

    Joined:
    Jul 2, 2018
    Posts:
    1
    i had this issue too, didnt know that rig had to be a child of the root
     
  4. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    I get the same exception, but for me it's because my Animator component isn't on the root gameobject. Guess I'll have to restructure things if I want to use this package.

    The hierarchy for my characters looks like this.
    • Character (Scripts)
      • Vis (Animator)
        • Rig
          • Meshes
          • Skeleton
      • Ragdoll
     
    Last edited: Apr 11, 2020
  5. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi, this should be fixed in newer version of 2019.2, 2019.3 or in the beta version of 2020.1. What version of Unity are you using?
     
  6. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Good to hear it has been addressed! I'm running Unity 2019.2.11f1 and Animation Rigging 0.2.6. I'll try installing the latest version of 2019.2.
     
  7. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Still getting the error in 2019.2.21f1. Also getting a new error

    Unexpected exception System.IO.FileNotFoundException: Could not load file or assembly 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    File name: 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'

    Does it want a newer version of the Animation Rigging package? The package manager will only let me update to 0.2.6. Despite the issues the package is looking very interesting. Can't wait to mess with it in the future.
     
  8. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi, this issue is not related to the Animation Rigging package per se. This is an issue with how the underlying animation c# jobs system rebuilds a custom avatar if the one provided to the Animator doesn't map all animated transforms/properties. So upgrading to a new version of Animation Rigging will not fix this.

    One workaround to this issue is to generate an Avatar yourself:
    Build generic avatar.png

    Otherwise, if you think this is a bug, please submit a bug report through the Unity bug reporter. This is the best way for us the reliably track these issues.
     
    oAzuehT and IbrahimRashwan like this.
  9. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Using a generic avatar fixed the original error message for me, thanks!

    I get these two errors now when I hit play, but at least it's not a constant stream of errors. :)

    Error 1:
    Unexpected exception System.IO.FileNotFoundException: Could not load file or assembly 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    File name: 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'
    at Burst.Compiler.IL.Jit.JitCompiler+CachedMethodKey..ctor (System.String methodFullName, Burst.Compiler.IL.Jit.JitOptions options) [0x00007] in <2c9ff9fb581642acaeb86844246ad423>:0
    at Burst.Compiler.IL.Jit.JitCompiler.CompileMethod (Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Jit.JitOptions jitOptions) [0x0001f] in <2c9ff9fb581642acaeb86844246ad423>:0
    at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x002ce] in <2c9ff9fb581642acaeb86844246ad423>:0

    While compiling job: System.Void UnityEngine.Experimental.Animations.ProcessAnimationJobStruct`1<UnityEngine.Animations.Rigging.TwoBoneIKConstraintJob>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)

    Error 2:
    Unexpected exception System.IO.FileNotFoundException: Could not load file or assembly 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    File name: 'Smash, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'
    at Burst.Compiler.IL.Jit.JitCompiler+CachedMethodKey..ctor (System.String methodFullName, Burst.Compiler.IL.Jit.JitOptions options) [0x00007] in <2c9ff9fb581642acaeb86844246ad423>:0
    at Burst.Compiler.IL.Jit.JitCompiler.CompileMethod (Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Jit.JitOptions jitOptions) [0x0001f] in <2c9ff9fb581642acaeb86844246ad423>:0
    at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x002ce] in <2c9ff9fb581642acaeb86844246ad423>:0

    While compiling job: System.Void UnityEngine.Experimental.Animations.ProcessAnimationJobStruct`1<UnityEngine.Animations.Rigging.RigSyncSceneToStreamJob>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
     
  10. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
  11. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Restarting Unity fixed the issue, thanks!
     
  12. IbrahimRashwan

    IbrahimRashwan

    Joined:
    Oct 21, 2018
    Posts:
    4
    This solution worked for me thanks, hope this issue is foxed soon!