1
2014
Get Custom Properties from 3dsMax FBX model
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
– Right click on the object
– Select Object Properties
– Type custom properties to “User Defined” tab (it seems to be single string text area, not line by line)
– For example to make it useful, add some delimiter to your data: myvalue|anothervalue|somethingelse|…, then split the string in Unity.
– Export FBX normally for Unity
(no image)
—
Using OnPostprocessGameObjectWithUserProperties() to read those custom properties
– Create new C# script : FBXCustomProperties.cs
– Now select your fbx file from unity project window, right click on it, ReImport
– In the console window you should see your custom properties printed out
using UnityEditor; using UnityEngine; using System.Collections; public class FBXCustomProperties : AssetPostprocessor { void OnPostprocessGameObjectWithUserProperties (GameObject go, string[] names, System.Object[] values) { for (int i = 0; i < names.Length; i++) { string propertyName = names[i]; object propertyValue = values[i]; Debug.Log("Propname: " + propertyName + " value: " +propertyValue); } } }
References:
– Original idea is from this Unity forum topic+video about Maya FBX custom attributes
Related Posts
1 Comment + Add Comment
Leave a comment
Recent posts
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)
compress mesh on import:
http://forum.unity3d.com/threads/mesh-compression-what-does-it-actually-do.33073/#post-1692866