Blender Animation export issue

When i compose a scene in blender i can animate an object, then if i delete the animation, and add a new animation, it doesn’t remove the old animation.I view it in browser with, it just does one animation after another. If i add a new object and animate that, the first object follows the new animation path as well as its own, even if there is no relation.

If i delete the second object, the first object keeps the second objects animation path, even though the object with that path is deleted.

After animating a couple of simple objects, I can play the animation side by side between blender and the browser and the objects are moving completely differently.

I tried exporting one animated object at a time and have separate BABYLON.SceneLoader.ImportMesh statements, but the animation still get combined. I tried everything I can think of.

Any idea of why the exporter combines and appends animations or what to do about it?

This is using Blender 6.2 exporter, Babylon 4.0, and Blender 2.80.

@dogfog1205, is there any way you can share a playground or your blender file so we can look into it? Trying to debug what you are seeing only from your question will be pretty difficult.

Well @dogfog1205, there are some very simple things you can do with multiple objects and multiple animations. So let us start with the image below.

  1. Deleting animations and objects

In the image below the top window shows a Blender scene with two objects (Cube1 and Cube2) and three animations with two animations on Cube1 (red cube) and one animation on Cube2 (blue cube) The animation details are shown in a panel for the “Dope Sheet → Action Editor”. Select the object with the animation you wish to delete and delete its animation by hitting “Shift + the F button” that is high lighted in the red square. Now in the 3D window with the object hit the X key and delete the object.

Now save your file, then reopen it. Part B of the image shows the result - just one cube and just the Cube1 animations

If you have multiple animations on multiple objects, to limit animations to particular objects use the naming convention seen in the image. So:

Cube1-action. slide1

ie : Object Name + “-action” . action description

That way animations associated with a particular object will be exported in “ranges” for that mesh/object. Eg:

“name”:“cube1”,“id”:“cube1”,“materialId”:“cubes_2.Material”,“billboardMode”:0,“position”:[0,0,0],“rotation”:[0,0,0],“scaling”:[1,1,1],“isVisible”:true,“freezeWorldMatrix”:false,“isEnabled”:true,“checkCollisions”:false,“receiveShadows”:false,“tags”:“”

“ranges”:[{“name”:“action.slide1”,“from”:0,“to”:30},{“name”:“action.slide2”,“from”:40,“to”:70}

The exporter leaves a 10 frame gap to prevent overlap issues. Here is the babylon file exported for that blend file. Unzip and open in a text editor

anims1.zip (1.2 KB)

Hope that helps.

cheers, gryff :slight_smile:

1 Like

Thanks for looking at this. I really appreciate it. It is going to take a little time to get back on this. I’ll put the issue up on the playground and try the recommendation. One thing comes to mind that I did not mention. These are imported meshes. I don’t know if that makes any difference, but I do my modeling in a CAD package, import them into blender, animate then export the .babylon. I will try it with blender primitives like the example gryff posted. Do imported meshes behave any differently when animated? I have done this many time with 3DS Max, but have switched to Blender recently. Blender and Babylon are great.

Actions operate the EXACT same way as materials, but people seem to have less problem accepting the way materials are shared. Objects do not ‘own’ actions, they merely have a current one or none.

In order to export meshes having multiple actions, when actions exist in a scene they are applied to each mesh with a current action, unless the exporter option, in World, to only export the current action is selected.

currentAction

If there are multiple meshes with a current action, but a certain action is only to be on one mesh, change the name of the action to be in the format of meshName-actionName. An action named actionName will be exported only to a mesh named meshName.

The deletion of actions works the same way as materials, as @gryff elaborated.

One change I am taking from this topic is exporting only the currently assigned actions is now going to be the default in the upcoming 6.2.1. Seems like that is the simplest case. Much easier to just get problems like “I have multiple actions ‘run, jump, sit’, but only one is exported”. Simple answer is then turn it on, not teaching Blender in topics. Good, @gryff ?

Also, in 6.2.1, a fix to Glossy node. When an unsupported node type is attached to the roughness property, as shown, it was throwing an exception. I got a mesh from BlendSwap which did chrome this way.


Actually, all 3 inputs to Glossy’s are not supported. The real answer is just implementing chrome with Principled, but it should not throw an exception.

Holding up update is still need to work on mesh tangent’s.

Here is the playground link. It is strange. Two animations of two different objects get mixed into one.

Thanks for looking at it.

I can post the .babylon file if it helps. It is pretty simple. Just one cube animated to go 2 meters back and forth in the x and another cube going up and down in the z. Both cubes end up moving together when exported.

https://playground.babylonjs.com/#ZLNVYF

@dogfog1205

Well I see these words in your Playground Code : “Must remove the max camera to get this to work”.

Was it created in Blender or #3DMax? And I can’t bring up the Inspector Panel - is that a PG bug?

cheers, gryff :slight_smile:

@JCPalmer : always liked the “-action.xxx” method myself , but I know you, always looking for improvements :slight_smile:

So do your best Jeff - you don’t get much in the way of complaints from me. - always trust you.

cheers, gryff :slight_smile:

As I see the model in the Sandbox, there are no animation groups at all.