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 ronronmx · Feb 19, 2012 at 11:10 PM · modelassetpostprocessormodelimporter

OnPostprocessGameObjectWithUserProperties - user properties template?

EDIT: So I tried using Maya and exported an object with user properties assigned, and it worked fine! All the properties were read correctly when using Maya. Why doesn't it work when using 3dsmax? I can't use Maya, so I'm stuck with Max and I need to get it working :)

I use 3dsmax for all my modeling, and export to FBX format. I'm trying to read the user properties I assign to my objects in max with OnPostprocessGameObjectWithUserProperties, but not matter how many I had it always returns only 2:

Propname: UDP3DSMAX value: ObjAddOn = true
ObjSlider = 5
Propname: MaxHandle value: 426

My user properties on my model in 3dsmax look like this:

ObjAddOn = true
ObjSlider = 5

As you can see, I have 2 properties, but the script returns both of them as 1 (Propname: UDP3DSMAX value: ObjAddOn = true ObjSlider = 5) and then returns a second property that doesn't even exist (Propname: MaxHandle value: 426)

Is there a specific template to use when assigning properties to objects?

I am really lost on this one, there isn't any documentation on what properties should look like in your 3d program, and I can't find an answer anywhere!

Thanks in advance for any help, I would really appreciate it :) Stephane

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

1 Reply

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

Answer by ronronmx · Feb 21, 2012 at 11:04 PM

After banging my head against the wall for days, trying to get "User Defined Properties" to work with "OnPostprocessGameObjectWithUserProperties" when exporting objects from 3ds max...I finally figured it out.

The first thing you need to know, contrary to what "OnPostprocessGameObjectWithUserProperties" leads you to believe, is that it doesn't work with actual "User Defined Properties" that you assign to an object in 3ds max by right-clicking on the object, choosing "Object Properties", and adding text in the "User Defined Properties" tab. No sir, that's not what it's looking for!

Here's how to do it, using the "Parameter Editor" under the "Animation" menu:

  1. With your object selected, in the menu bar, choose "Animation/Parameter Editor".

  2. The Parameter Editor window will come up.

  3. You can choose where to add the attribute, i suggest leaving it on "Selected Object's Base Level".

  4. Select the type of parameter you want to add - float, int, bool...

  5. Give the parameter a name.

  6. Click the Add button.

If you left the attribute location to "Selected Object's Base Level", you'll find it in the Modify panel of your selected object, all the way at the bottom after all other tabs. You can then update the attribute there, for example if it's a bool, make it true or false, if it's an int, change its number etc...

That's it, export your object, and "OnPostprocessGameObjectWithUserProperties" will find the attributes just fine! If you have any questions, or if something doesn't make sense, feel free to ask and I'll help the best i can.

Stephane

Comment
Add comment · Show 3 · 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 nosheet · Jul 16, 2013 at 11:34 AM 0
Share

Stephane, Thanks for sharing this insight. Is there any way to know the TYPE of the attribute, though?

avatar image ronronmx · Jul 20, 2013 at 09:56 PM 0
Share

Here's how I am getting it:

System.Object val = propValues[i]; // propValues is an array of System.Object

if( val.GetType( ) == typeof( bool ) ){...}

avatar image petesplace · Nov 17, 2016 at 04:07 PM 0
Share

Working like expected, thank you.

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

11 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to create 3d models for game and how to add them to game 2 Answers

AssetPostprocessor in 2018.3 0 Answers

MMD How to export model and animations to Unity as 3rd person controller? 2 Answers

imported 3D models don't batch. 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