Blender model corrupted by export to Babylon

I have lots of models that export correctly, and one that does not. After using the Blender to Babylon exporter a number of meshes are moved to new locations. These are the things I tried so far:

  • Using the “File|Clean Up|Purge All” menu option in Blender.
  • Saving and reloading the file.
  • Selecting all of the geometry and choosing “Object|Apply|All Transformations”
  • Looking in the exporter log file - no errors and no warnings
  • Make sure all animations start at frame 0 and end at the same frame number.
  • Switching the Blender Outliner tool to Blender File mode and looking for any garbage

Is there anything else I can check?

Blender 2.9.1
Babylon Exporter 6.4.6

I guess you will need to provide the file that does not work for people knowing Blender to be helpful.

1 Like

What kind of entity/model? Was it some sort of instance? Did you check the objects’ hierarchy (parents etc)? Was there any modifier / contraint / driver / animation added to the model?

I created a new Github repo and uploaded the files. You should be able to download from FileShare/Babylon/File corrupted on export at master · Bikeman868/FileShare · GitHub

There are animations, and the only meshes that get corrupted are animated.
There is nothing else special about this model. I created the mesh in Sketchup, exported a .stl file, imported this into Blender then simply applied materials and animation. The materials are very simple - no textures, just colors.

There are no modifiers, no constraints, no drivers. Very straightforward really.

I have exported the blendfile to gltf and tested it with the sandbox, seems like your desired result. Maybe you just use this approach in the meantime. If im not mistaken, its an issue with the blender-babylon exporter?

@JCPalmer our own amazing Blender Guru might be able to help on this as yet again I fell short of ideas about blender issues.

1 Like

Thanks for checking it out.
Yes, this seems to be an issue with the Blender Babylon exporter. I only have one model with this issue, and I can just rebuild it from scratch, so it’s not a big deal for me, but should probably be fixed.
Exporting to another format is a hassle for me, because my model loader relies on the way that the Babylon exporter handles animations.

@Bikeman868 : Your issue is not corruption of the model by the exporter, rather a problem with how you named your animations in the animation stack. You have multiple unrigged objects that each have an animation - but only one each. However, because of your naming method in the animation stack (see image below), all these animations are exported for all objects. So the :base which is rotated gives that rotation to the rings as well which are just being translated and the translations are added to every object. Look at your babylon files in text editor and look at the length of the animation for each object - >1000 frames.

As I have posted before many times :

If you have two objects (two cubes, say) that are unrigged and you want to give each one a different action (just one) then use the action names like this - note the “-” (hyphen) :


If you just create Action1 and Action2, then both will be applied to Cube1 and Cube2

Correctly naming your animations should solve your problems and reduce your file size - no 1000+ frames in your babylon file.

So in your case change to Base-Working, and Ring02-Working etc.

Hope that helps. Won’t be around for a while because of family health problems.

Stay Safe, gryff :slight_smile:

1 Like

It’s strange how this issue only affects this one model, all of the others use the same naming convention and don’t have this issue.
I already noticed that the exporter creates the cross product of meshes and actions. I used my own naming convention in my model loader to sift out the actions that should be applied to each mesh. I also create Animation Groups based on the suffix. Unfortunately my naming convention does not include a hyphen, and I have a few hundred models to fix - time to brush up on Python!

Just to be sure you understand the problem, when I open this file it looks like this:

Now choose File|Export|Babylon.js and when the export is complete the model now looks like this in Blender:

Note that many of the blue rings are translated horizontally.
I think this should not happen no matter what naming convention I used.

I tried your suggestion of renaming the actions, and this does stop the exporter from corrupting the model in Blender, however I can’t use this technique because the exporter does not preserve the name of the action in the .babylon file, so I have no way to know which animations are associated with each action.

Imagine that the model has several things that is can do (for example “moving” and “firing”) each of which involve animating multiple meshes (for example “moving” might animate each of the wheels). In the game I need to loop all of the “moving” animations whenever the model is moving.

I accomplished this by calling my wheels “Wheel1”, “Wheel2” etc then creating actions in Blender called “Wheel1Moving”, “Wheel2Moving” etc. My model loading code finds the animations that start with the name of the mesh, and group animations with the same suffix into an animation group in Babylon. This gives me a “moving” animation group that I can stop/start etc.

Not sure where/how you created your models, but it does not look like Blender. You have another issue as well, some normals are facing the wrong way - see image below of your exported file in the sandbox.

Stay Safe, gryff :slight_smile: