Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by JanusHuang · Jun 06, 2013 at 02:25 PM · animationanimatorcontrollermecanimstate

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)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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 )

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges