Search Unity

Are animation names global? (3DS Max import always named "Take 001")

Discussion in 'Animation' started by ekergraphics, Mar 22, 2018.

  1. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Through script, I trigger a specific animator on a specific gameobject, with a specific animationclip.

    However, ALL of my animations then run, from all objects.

    I wonder, does this have anything to do with animations in FBX files improted from 3D Studio Max all being named "Take 001"?

    Though, I don't understand how triggering that .name in a specific controller could then reach all controllers in the scene...

    Just for reference, here's my simple script:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using EasyButtons;
    5.  
    6. // [ExecuteInEditMode] // Animations don't play in Edit Mode anyway...
    7. public class PlayAnimations : MonoBehaviour {
    8.  
    9.     [SerializeField]
    10.     public PlayAnimationDictionary ObjectsToAnimateWithClip;
    11.  
    12.     // https://gamedev.stackexchange.com/a/128868
    13.     private float direction = 1.0f;
    14.  
    15.     // Use this for initialization
    16.     void Start () {
    17.  
    18.     }
    19.  
    20.     // Update is called once per frame
    21.     void Update () {
    22.  
    23.     }
    24.  
    25.     [Button]
    26.     public void Play () {
    27.        
    28.         foreach(KeyValuePair<GameObject,AnimationClip> kvp in ObjectsToAnimateWithClip)
    29.         {
    30.             kvp.Key.GetComponent<Animator> ().SetFloat ("Direction", direction);
    31.             kvp.Key.GetComponent<Animator> ().Play (kvp.Value.name);
    32.  
    33.             Debug.Log ("Play Animation: " + kvp.Value.name);
    34.         }
    35.  
    36.         direction = direction * -1.0f;
    37.  
    38.         Debug.Log ("Play Animation - DONE!");
    39.     }
    40. }
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    What is the name of this specific animation clip? On import the animation cycle can be created by placing in/out points and clicking plus button then naming the clip whatever you want it to be named.
    I think this works even for only one cycle in the animation import (as opposed to many anim cycles in the imported fbx), place in/out marks encompassing the entire cycle and create newly named animation clip.
    As far as I know all clips that are imported from all animation packages are named Take001 by default. The name is only changed when the cycle is identified by in/out points and named - whatever the developer wants to name them.
    Clip might change with anim@name.fbx - legacy process. I haven't used that process in over 10 years so I can't remember the specifics. Wouldn't hurt to review in the documentation.
     
  3. KristianDoyle

    KristianDoyle

    Joined:
    Feb 3, 2009
    Posts:
    63
    I'm wondering if there's any solution here (unity 2017.15). I'm ending up with clips on timeline all named 'Take 001'. I don't want to set in/out and rename manually on import settings because it breaks a nice pipeline between animation and engine. Using Maya, with it's default fbx exporter. Note - this all works fine with Motion Builder, as animation clip names are named correctly in the fbx data.
     
  4. jsunandmax

    jsunandmax

    Joined:
    Jan 12, 2013
    Posts:
    17
    still looking for end of Take 001 ; how to change on Blender or 3DSMax side
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    When you import a model into Unity, go to the Animations tab to configure its animations, including their names.