#in blender it does show 2 actions

1 messages · Page 1 of 1 (latest)

orchid leaf
#

Oh this a cool one and yeah there is a way around this so you don't have to export .fbx from blender every time and double up your asset files creating all that mess.

When Unity is importing your .blend file it's actually just making a background call to a script Unity-BlenderToFBX.py which uses Blender to export a .fbx of the .blend file to Unity's Library Cache.

The default settings used in the BlenderToFBX script are kinda shitty tho so it doesn't work ( at least not for this use case ) but you can modify that Unity-BlenderToFBX.py to change the export settings so they align with your manual export settings and then it'll work fine.

The file is usually at
Mac:
/Applications/Unity/Hub/Editor/<Unity Version>/Unity.app/Contents/Tools/Unity-BlenderToFBX.py

Windows:
C:\Program Files\Unity\Hub\Editor<Unity Version>\Editor\Data\Tools\Unity-BlenderToFBX.py

So you can take a copy of the file and rename it _OLD as a backup and then modify the original based on the Blender API spec

https://docs.blender.org/api/current/bpy.ops.export_scene.html

There is a caveat that the file is under the Unity install folders so when you update your Unity version or reinstall then that Unity-BlenderToFBX.py can be reset to it's original state so it's best to have a copy of your modified version in your version control to make life easier should this happen.

What you can do as well, which is what I've done, is make an editor extension that'll check for version differences in the file on Editor load, and also has patching functionality, basically just creates a copy of the old Unity-BlenderToFBX.py and replaces with the file in your version control. It's mostly vibe coded tho so I can't really stand over how well it'd function on other peoples machines / setups but something to look into if you're curious.

fierce elm
#

Interesting to know that it's at least possible

#

Do you get animation import settings when using blend files in that way?

#

In the inspector I mean, the way you can define clips and other animation data with FBX imports

orchid leaf
#

Yep, works the same as if you clicked on the .fbx directly

orchid leaf
# fierce elm In the inspector I mean, the way you can define clips and other animation data w...

You did get me thinking tho if the exported .fbx gets put into the Library Cache then that wouldn't be included in version control so I was curious would any modification like adding animation events, changing curves etc. be lost in version control

I just did some quick testing moving between my laptop and desktop tho and it looks like any modifications to the anim import data gets stored in the .blend.meta file and is preserved in version control, so shouldn't be anything to worry about there

fierce elm
#

(though with sub assets I'm not sure)