{"id":2575,"date":"2014-01-01T01:34:31","date_gmt":"2013-12-31T22:34:31","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=2575"},"modified":"2014-01-04T17:06:35","modified_gmt":"2014-01-04T14:06:35","slug":"3dsmax-get-custom-properties-from-fbx-model","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2014\/01\/01\/3dsmax-get-custom-properties-from-fbx-model\/","title":{"rendered":"Get Custom Properties from 3dsMax FBX model"},"content":{"rendered":"<p>Maybe not from the fbx file itself (?), but each object can have custom properties, and Unity can read them on import.<\/p>\n<p><strong>Exporting FBX from 3ds Max with Custom Properties<\/strong><\/p>\n<p>&#8211; Right click on the object<br \/>\n&#8211; Select Object Properties<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2576\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/01\/01\/3dsmax-get-custom-properties-from-fbx-model\/object_properties_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?fit=566%2C461&amp;ssl=1\" data-orig-size=\"566,461\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"object_properties_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?fit=566%2C461&amp;ssl=1\" class=\"alignnone size-full wp-image-2576\" alt=\"object_properties_1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?resize=566%2C461\" width=\"566\" height=\"461\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?w=566&amp;ssl=1 566w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?resize=300%2C244&amp;ssl=1 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/p>\n<p>&#8211; Type custom properties to &#8220;User Defined&#8221; tab (it seems to be single string text area, not line by line)<br \/>\n&#8211; For example to make it useful,\u00a0 add some delimiter to your data: myvalue|anothervalue|somethingelse|&#8230;, then split the string in Unity.<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2577\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/01\/01\/3dsmax-get-custom-properties-from-fbx-model\/object_properties_custom_2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_custom_2.jpg?fit=408%2C330&amp;ssl=1\" data-orig-size=\"408,330\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"object_properties_custom_2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_custom_2.jpg?fit=408%2C330&amp;ssl=1\" class=\"alignnone size-full wp-image-2577\" alt=\"object_properties_custom_2\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_custom_2.jpg?resize=408%2C330\" width=\"408\" height=\"330\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_custom_2.jpg?w=408&amp;ssl=1 408w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_custom_2.jpg?resize=300%2C242&amp;ssl=1 300w\" sizes=\"auto, (max-width: 408px) 100vw, 408px\" \/><\/p>\n<p>&#8211; Export FBX normally for Unity<\/p>\n<p>(no image)<\/p>\n<p>&#8212;<\/p>\n<p><strong>Using OnPostprocessGameObjectWithUserProperties() to read those custom properties<\/strong><\/p>\n<p>&#8211; Create new C# script : FBXCustomProperties.cs<br \/>\n&#8211; Now select your fbx file from unity project window, right click on it, ReImport<br \/>\n&#8211; In the console window you should see your custom properties printed out<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing UnityEditor;\r\nusing UnityEngine;\r\nusing System.Collections;\r\n\r\npublic class FBXCustomProperties : AssetPostprocessor\r\n{\r\nvoid OnPostprocessGameObjectWithUserProperties (GameObject go, string&#x5B;] names, System.Object&#x5B;] values)\r\n{\r\nfor (int i = 0; i &lt; names.Length; i++)\r\n{\r\nstring propertyName = names&#x5B;i];\r\nobject propertyValue = values&#x5B;i];\r\nDebug.Log(&quot;Propname: &quot; + propertyName + &quot; value: &quot; +propertyValue);\r\n}\r\n}\r\n}\r\n\r\n<\/pre>\n<p><strong>References:<\/strong><br \/>\n&#8211; Original idea is from this Unity <a title=\"http:\/\/forum.unity3d.com\/threads\/220270-Unity-Genius-Needed-Animation-Clip-Creation-Through-Script-Code\" href=\"http:\/\/forum.unity3d.com\/threads\/220270-Unity-Genius-Needed-Animation-Clip-Creation-Through-Script-Code\" target=\"_blank\">forum topic+video<\/a> about Maya FBX custom attributes<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maybe not from the fbx file itself (?), but each object can have custom properties, and Unity can read them on import. Exporting FBX from 3ds Max with Custom Properties &#8211; Right click on the object &#8211; Select Object Properties &#8211; Type custom properties to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2576,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[420,3],"tags":[27,570,68,568,39,308,38,569],"class_list":["post-2575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-unity3d","tag-3ds-max","tag-attributes","tag-c","tag-custom","tag-export","tag-fbx","tag-import","tag-properties"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/object_properties_1.jpg?fit=566%2C461&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-Fx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=2575"}],"version-history":[{"count":4,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2575\/revisions"}],"predecessor-version":[{"id":2586,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2575\/revisions\/2586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/2576"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=2575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=2575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=2575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}