The only thing you cant do easily this way is vertex or face level data while you could pack that sort of thing into custom attributes, there's not a rock-solid guarantee that the indices you see in Max/Maya will be the same as the ones in the FBX. You can pass complex data by storing things as a JSON blob and passing the JSON as a string attribute that's usually easier to maintain than a web of multiple attribute names and types.īe warned that FBX tends to mangle long attibute names - I'm not sure where the cutoff is but extremely long attribute names sometime get truncated to a meaningless string like `FBXASC_012345" if they exceed the magic character count. It's annoying that there's no standard way to create file-level metadata, I usually just attach my 'top level' data to something like the root of the model in the FBX file. String raw_data = (string)incomingValues If (incomingPropetyNames.Contains(meta_key)) Var thisModelImporter = this.assetImporter as ModelImporter You'll want to find your attribute in the postprocessor and do something: public void OnPostprocessGameObjectWithUserProperties(GameObject incomingGameObject, string incomingPropetyNames, object incomingValues) The easy way to do this is to add a custom attribute to an object in the Maya/Max scene and then use the Unity AssetPostprocessor to find the attribute and parse it's data.ĪssetPostprocessor has an OnPostprocessGameObjectWithUserProperties callback which will be fired for every transform in your fbx file which has a custom attribute applied.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |