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

Playables Mixer is null

Discussion in 'Scripting' started by Xelioth, May 6, 2019.

  1. Xelioth

    Xelioth

    Joined:
    Aug 6, 2013
    Posts:
    6
    I'm a tech animator getting co-opted for some code because startup, and I'm trying to rebuild a state-based animation system using Simple Animation Playables, but am running into this error:

    Code (csharp):
    1. ArgumentNullException: Value cannot be null.
    2.  
    3. Parameter name: The Playable is null.
    4. UnityEngine.Playables.PlayableHandle.GetInputCount () <0x1f1326f72f0 + 0x00052> in <07acd42a4d064cbdac11856405cd71fb>:0
    5. UnityEngine.Playables.PlayableExtensions.GetInputCount[U] (U playable) (at C:/buildslave/unity/build/Runtime/Export/Director/PlayableExtensions.cs:168)
    6. SimpleAnimationPlayable.DoAddClip (System.String name, UnityEngine.AnimationClip clip) (at Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs:106)
    7. SimpleAnimationPlayable.AddClip (UnityEngine.AnimationClip clip, System.String name) (at Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs:136)
    8. PlayablesMecanim.<Start>g__AddClips|38_1 (System.Collections.Generic.List`1[T] theClips, SimpleAnimationPlayable theSAP) (at Assets/scripts/PlayablesMecanim.cs:155)
    9. PlayablesMecanim.Start () (at Assets/scripts/PlayablesMecanim.cs:159)
    All of that to say: While trying to run "DoAddClip" the mixer playable is null for some reason. This is happening in Start as I'm running through and trying to declare everything and connect everything. Below is the line which throws the error, which is just an "AddClip" call into the SimpleAnimationPlayable code, which is unedited. Any time I try to use "AddClip" this happens in the same way, regardless of how I connect or declare the various elements involved.

    Code (CSharp):
    1. AddClips(wholeBody_Clips, wholeBody_SAP);
    2.  
    3. void AddClips(List<AnimationClip> theClips, SimpleAnimationPlayable theSAP)
    4.         {
    5.             theSAP.AddClip(theClips[0], theClips[0].name);
    6.            
    7.         }
    Is there something obvious I'm missing due to my own inexperience with programming? Am I using something wrong? Does this entire error exist only in a reality bubble of which I am the sole occupant due to angering some ancient, profane god?

    Your help is very appreciated.
     
  2. Xelioth

    Xelioth

    Joined:
    Aug 6, 2013
    Posts:
    6
    Bump!
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Add Debug.Log statements to figure out what you're sending to AddClip that is null. Then make it not null.
     
  4. Xelioth

    Xelioth

    Joined:
    Aug 6, 2013
    Posts:
    6
    Would that it were that simple. The mixer playable that I'm using during this process isn't coming up null in a debug.log.

    As best as I can tell, what's coming up null is the Simple Animation Playables internal mixer, which is created automatically when you create any playables object. Except it's coming up null so, for whatever reason, that's not happening.

    I was hoping someone else may have encountered this issue?