Blender 2.8 -> Unity - Object underscore renamer (Unity has used ascii FBX internally)

Unity’s (alpha version) imports blender 2.8 with a binary fbx file, which doesn’t replace the object’s spaces with underscores like the ascii FBXes that unity has been using until now. (BTW be warned that bone axes have also changed)

Bear in mind that I’m very new at writing add-ons.
Maybe materials, textures, or other things also need to be renamed?
Maybe there are also other symbols that need to be changed to underscores

You just need to press space and search “prepare unity binary”, and it will replace spaces in object names with underscores, and this should make sure that references are preserved in Unity. You only need to do this once with .blend files that were created and used in unity before 2.8. You’ll have to live with the fact that these objects in blender will have underscores.

It will still have a problem if a bone has the same name as an object, as the exporter will add a " 1" to the bone.

blender_unity_fixer.py (1.2 KB)

1 Like

This is exactly what I needed, thanks! I’m actually surprised I didn’t find more online about people running into this issue–it caused me a lot of grief.

I’ve made a version that can be run in batch on the command line. Assuming you’re on Windows, you can use this command to get a list of Blender files in your project:

dir /s /b *.blend > blend.txt

Then run the following (updating the path to Blender as needed):

set blender="C:\Program Files\Blender Foundation\Blender 2.83\blender.exe"
for /f "usebackq delims=" %%f in (blend.txt) do %blender% "%%f" -b -P blender_unity_fixer_batch.py