- Home /
How to get fileID information so i can just edit Mecanim Animator through script?
First, sorry for my English. :P
I want to edit Mecanim Animator(.controller file) through script. But i don't know how to get the fileID information at the State block. Like something down below..
--- !u!1102 &110290603
State:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ready
m_Speed: 1
m_CycleOffset: 0
m_Motions:
- {fileID: 7400010, guid: 7581bf4cfb0c33a499343eaf5e2063a0, type: 3}
m_ParentStateMachine: {fileID: 110700000}
m_Position: {x: 348, y: -144, z: 0}
m_IKOnFeet: 1
m_Mirror: 0
m_Tag:
I can get GUID of FBX file by AssetDatabase.AssetPathToGUID()
, but it seems there is no way to get fileID of the animations in the FBX file.
And the result of GetHashCode()
and GetInstanceID()
are also seems useless. For example, there is a animation clip which fileID is 7400026, but GetHashCode()
gave me this number >> 10140, seems no rule between them. (but the number 74 in fileID seems like "Classes Ordered by ID Number" in Unity manual? (74 is AnimationClip))
I also look the manual : Textual Scene File Format (Pro-only Feature) But still have no clue about how to get fileID...
Does anybody knows how to solve this?
Thank!! (C# code is better xD)
Answer by JanusHuang · Jun 07, 2013 at 04:15 AM
I figured out that fileID is relation to the order in FBX file, and represent as even number base on zero.
For example... there is 3 clips in the FBX file : ( ready, run, attack ) so fileID goes like : ( 7400000, 7400002, 7400004 )
Answer by kyle-misner-kriel · Jun 28, 2017 at 06:33 PM
That's weird. I wonder what the first bit is being used for...
Your answer
Follow this Question
Related Questions
Can the mecanim animators Controller var be set in code? 1 Answer
How do I make the transition between two states in the "Animator" happen instantly? 3 Answers
Is it possible to make empty, passing state in mecanim? 3 Answers
How to generate Mecanim Sub-state namehash? 6 Answers
Skills controlled by animation (event callbacks and parameters) 0 Answers