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 michael 4 · May 08, 2011 at 08:29 PM · importfbxmetadata

adding meta data to fbx file and then reading it in unity

Is there a way to add metadata to an fbx file and then reading it in unity? I was hoping I could initialize some variables inside the actual fbx file so when it dynamically imports into the game, the game already knows what to do with it.

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
2
Best Answer

Answer by Paulius-Liekis · May 08, 2011 at 09:13 PM

You can import User Properties from FBX files. Use AssetPostprocessor class for reading them.

Comment
Add comment · Show 6 · 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 michael 4 · May 08, 2011 at 09:19 PM 0
Share

interesting, is that something ill find in the fbx exporter?

Do you know where I can find more information on this?

avatar image michael 4 · May 08, 2011 at 09:24 PM 0
Share

I did find a user defined properties dialog in 3dsmax when you right click on an object. Are you saying that anything in this dialog gets exported as part of the fbx file?

avatar image Paulius-Liekis · May 08, 2011 at 10:48 PM 1
Share

Yes. Unity imports ints, floats, strings, and Vector3, IIRC

avatar image michael 4 · May 08, 2011 at 11:53 PM 0
Share

This is great! I found the function to accomplish just this, now the documentation states that this is an Editor Class function, which im assu$$anonymous$$g means I cant do this at runtime. All objects are dynamically imported into the game using Resources.Load command. So will I still be able to use this? Or will this automatically happen when the objects are found in the folder when the Unity Editor starts up and says "Importing"?

avatar image Paulius-Liekis · May 09, 2011 at 08:50 AM 0
Share

Yes, you can't do this in runtime. The idea is that you load them using AssetPostprocessor during load time and store somewhere and then reuse stored values in runtime.

Show more comments
avatar image
1

Answer by Jean-Fabre · May 08, 2011 at 08:40 PM

Hi,

For this, you are better off writing a maxscript ( or any language available in your soft), and save meta data in a seperate file. This allow to define anything and everything and in the format you like, xml, csv. The other benefit of such maxscript or custom export command is that you can preconfigure the fbx exporter, export several fbx in one go ( when you need to seperate your scene into chunks). Doing so gives you flexibility and you can modify the metadata or read the meta data with much more ease then if it was embedded in the fbx, because such metadats is likely to only answer the very specific needs of your game or framework.

Bye,

Jean

Comment
Add comment · Show 2 · 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 michael 4 · May 08, 2011 at 09:15 PM 0
Share

well if im going to use a separate file I could probably just use a txt format, and parse the information out of it. I guess then I would have to rename it to the same name as the fbx and look for it in my code when i dynamically import it though script? Actually an X$$anonymous$$L file would probably be easier to parse.

avatar image Jean-Fabre · May 09, 2011 at 05:39 AM 0
Share

You would need to code the dynamic importing and the parsing ( be it using a xml lib or your own parser). So in all cases, it will be a text format and you'll need both writer and reader to be written, the writer in your preffered 3d software and the reader in Unity. You could make it binary... but I don't see the point unless you have large files or wants some obfuscation or protection

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

1 Person is following this question.

avatar image

Related Questions

Working with complex FBX files 0 Answers

FBX Import model won't change transform in playmode, only in Scenepreview. Why? 1 Answer

Imported FBX from Google sketchup to unity has too many meshes, how to export/import properly? 1 Answer

Mb to fbx strange crushing issue 2 Answers

Confusion with using textures for blender fbx models 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