- Home /
How to add UserData to FBX
according to the docs you can add special meta-data in your 3D application when you export to FBX that can be used upon importing in unity.
i could not find a way to do so in 3Ds Max or Blender. does anybody know how to do it in their app of choice?
feel free to use this testscript:
using UnityEngine;
using UnityEditor;
public class ImportTester : AssetPostprocessor
{
public void OnPreprocessModel()
{
ModelImporter modelImporter = (ModelImporter) assetImporter;
Debug.Log("userdata: "+modelImporter.userData);
}
}
save it as "ImportTester.cs" in a Folder called "Editor" within the "Assets" folder.
Answer by undead-steve · Apr 09, 2013 at 07:56 PM
You can set the userData in your script; you wont get any userData from it unless you've previously set it on a prior import.
var modelimp = this.assetImporter as ModelImporter;
modelimp.userData = "hello world";
If you look at the .meta file as text for your asset you'll see that the userData field now reads "hello world". You'll need to set your project to use meta files in text to see it but it should work for other settings.
so i guess the userdata is for storing info about prior imports. thanks for clearing it out!
Answer by ynedelin · Aug 12, 2016 at 01:59 AM
In Maya you can assign user attributes to any node that gets exported into FBX. FBX will probably also have ability to retain custom data from MAX and Blender. Then when you are trying it read this data during Unity Import it can be done with function AssetPostprocessor.OnPostprocessGameObjectWithUserProperties
It will require some jumping through hoops to get all working as you wish and this function runs after materials and few other things already created, but you can still do a lot with your custom data here.
yury
Answer by paulnaude · Sep 20, 2019 at 10:46 PM
For 3Ds Max you can select your object. Right click and then select Object Properties. On the tabs at the top, select "User Defined". You can add the text you want in this part.
Your answer
Follow this Question
Related Questions
Create a Prefab from imported Assets automatically 0 Answers
How do you add AnimClips at import time correctly? 1 Answer
How to auto rotate object on FBX import? 1 Answer
share or reassign materials 0 Answers
3DS Max Import Problem 2 Answers