Jump to content

Blender - Babylon - Three Animated Object


ian
 Share

Recommended Posts

Ok I attach simple blender file which have 3 animated elevators. Each object(Elevator) have its own animation.

If I export it into babylon file positions of object is mixed (not currect positons of elevator).

What is Here a problem. Can't we export more than one animation (and use auto lounch animations) ?

I add actions suffix "-sAction" 

I have Quaternion animated Objects. Can not export this blender in babylon file. Some errors (Exporter ver 5.0.2)

Ver 4.6.1 exports without errors, but positions of each Elevator is same and in blender scene all Elevators get same postition. 

What is here a problem? 

Can anybody look this file.

 

RollShadowAnimation.blend

Link to comment
Share on other sites

I have reported the same issue here

For now, I use the following work-around:
- Make sure all animations start at frame 2.
- Add suffix to Actions
- in Babylon, iterate through all meshes in the scene and initiate animations from Frame1 to Frame2, like so:

 

for (var i = 0; i < meshes.length; i++) {
    var obj = meshes[i];
    if(obj.animations.length > 0) {
        scene.beginAnimation(obj, 1, 2);
    }

}

I do hope this gets fixed though as sometimes this creates weird jumps.

Link to comment
Share on other sites

There were quaternion issues in the multi-file, 5.0, code base.  I should probably set a mesh in one of my test scenes to it.  It exports now (not PR'ed yet).

Here was the log file:

Exporter version: 5.0.3, Blender version: 2.77 (sub 0)
========= Conversion from Blender to Babylon.js =========
	Scene settings used:
		selected layers only:  true
		flat shading entire scene:  true
		inline textures:  false
		texture directory:  /home/jeff/Desktop/
	Python World class constructor completed
	WARNING: No active camera has been assigned, or is not in a currently selected Blender layer
	processing begun of mesh:  Elevator3
		animation processing begun
			processing action Elevator2Action:  in[200 - 200], out[0 - 200]
			processing action sAction:  in[1 - 100], out[210 - 310]
			processing action ElevatorAction:  in[1 - 200], out[320 - 520]
			processing action ElevatorAction.001:  in[1 - 200], out[530 - 730]
			processing action ElevatorAction.003:  in[1 - 200], out[740 - 940]
			processing action ElevatorAction.004:  in[1 - 200], out[950 - 1150]
			processing action ElevatorDrugi:  in[1 - 200], out[1160 - 1360]
			processing action ElevatorPrviAction:  in[1 - 200], out[1370 - 1570]
		processing begun of Standard material:  Material.004
		num positions      :  36
		num normals        :  36
		num uvs            :  0
		num uvs2           :  0
		num colors         :  0
		num indices        :  36
	processing begun of mesh:  Elevator2
		animation processing begun
			processing action sAction:  in[1 - 200], out[0 - 200]
			processing action Elevator2Action:  in[200 - 200], out[210 - 410]
			processing action ElevatorAction:  in[1 - 200], out[420 - 620]
			processing action ElevatorAction.001:  in[1 - 200], out[630 - 830]
			processing action ElevatorAction.003:  in[1 - 200], out[840 - 1040]
			processing action ElevatorAction.004:  in[1 - 200], out[1050 - 1250]
			processing action ElevatorDrugi:  in[1 - 200], out[1260 - 1460]
			processing action ElevatorPrviAction:  in[1 - 200], out[1470 - 1670]
		processing begun of Standard material:  Material.005
		num positions      :  132
		num normals        :  132
		num uvs            :  0
		num uvs2           :  0
		num colors         :  0
		num indices        :  132
	processing begun of mesh:  Elevator1
		animation processing begun
			processing action sAction:  in[1 - 200], out[0 - 200]
			processing action Elevator2Action:  in[200 - 200], out[210 - 410]
			processing action ElevatorAction:  in[1 - 200], out[420 - 620]
			processing action ElevatorAction.001:  in[1 - 200], out[630 - 830]
			processing action ElevatorAction.003:  in[1 - 200], out[840 - 1040]
			processing action ElevatorAction.004:  in[1 - 200], out[1050 - 1250]
			processing action ElevatorDrugi:  in[1 - 200], out[1260 - 1460]
			processing action ElevatorPrviAction:  in[1 - 200], out[1470 - 1670]
		processing begun of Standard material:  Material.002
		num positions      :  216
		num normals        :  216
		num uvs            :  0
		num uvs2           :  0
		num colors         :  0
		num indices        :  216
	processing begun of mesh:  Ball
		processing begun of Standard material:  Material.003
		num positions      :  2880
		num normals        :  2880
		num uvs            :  0
		num uvs2           :  0
		num colors         :  0
		num indices        :  2880
	processing begun of mesh:  Path
		processing begun of Standard material:  Material.001
		processing begun of Standard material:  Material
		processing begun of multimaterial:  RollShadowAnimation.Multimaterial#0
		num positions      :  1344
		num normals        :  1344
		num uvs            :  0
		num uvs2           :  0
		num colors         :  0
		num indices        :  1344
	processing begun of light (POINT):  Lamp
========= Writing of scene file started =========
========= Writing of scene file completed =========
========= end of processing =========
elapsed time:  0 min, 0.1661 secs

Not all of your actions have mesh prefixes, so that might be an additional fix on your end.  Also, the auto animate property is not BJS animation range / Blender action specific.  It just runs all frames from the beginning.  Might be better to start your ranges yourself.  The order ranges get recorded is arbitrary (probably creation order), so there is no control.

@max123, you are not getting an actual exception being thrown (no question those are my problem).  Clearly it is not what you want, but I really do not have time determine if this is something the exporter does or there is problem in your scene.  Maybe, the first check if your geometry is coming through as expected with auto animate off.  @gryff, might you please vet this is a problem, and if you explain what it is.

Link to comment
Share on other sites

JCPalmer :)

Yes I think it's export problem.
I manualy edit babylon file (ok if range is exported out of 200 frames (this can be manualy repaired)

Like:

,"animations":[{"dataType":2,"framePerSecond":24,"keys":[
{"frame":1,"values":[0,0,0,-1]},
{"frame":50,"values":[0,0,0,-1]},
{"frame":100,"values":[0,0,0,-1]},
{"frame":150,"values":[0,0,0,-1]},
{"frame":200,"values":[0,0,0,-1]}],"loopBehavior":1,"name":"rotationQuaternion animation","property":"rotationQuaternion"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[7.15002, -0.09738, -5.24826]},
{"frame":50,"values":[7.15002, -0.09738, -5.24826]},
{"frame":100,"values":[7.15002, -0.09738, -4.01977]},
{"frame":150,"values":[7.15002, -0.09738, -4.01977]},
{"frame":200,"values":[7.15002, -0.09738, -5.24826]}],"loopBehavior":1,"name":"position animation","property":"position"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[1,1,1]},
{"frame":50,"values":[1,1,1]},
{"frame":100,"values":[1,1,1]},
{"frame":150,"values":[1,1,1]},

{"frame":200,"values":[1,1,1]

}
],"loopBehavior":1,"name":"scaling animation","property":"scaling"}],"ranges":[{"name":"Elevator2Action","from":0,"to":200}],"autoAnimate":true,"autoAnimateFrom":1,"autoAnimateTo":200,"autoAnimateLoop":true
 

 

 

 

,"animations":[{"dataType":2,"framePerSecond":24,"keys":[
{"frame":1,"values":[0,0,0,-1]},
{"frame":50,"values":[0,0,0,-1]},
{"frame":100,"values":[0,0,0,-1]}],"loopBehavior":1,"name":"rotationQuaternion animation","property":"rotationQuaternion"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[5.00506,0.1586,-4.87695]},
{"frame":50,"values":[5.00506,0.1586,-4.87695]},
{"frame":100,"values":[5.00506,4.78292,-4.87695]},
{"frame":150,"values":[5.00506, 4.78292,-4.87695]}, 
{"frame":200,"values":[5.00506,0.1586,-4.87695]}],"loopBehavior":1,"name":"position animation","property":"position"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[1,1,1]},
{"frame":50,"values":[1,1,1]},
{"frame":100,"values":[1,1,1]},
{"frame":150,"values":[1,1,1]},
{"frame":200,"values":[1,1,1]}],"loopBehavior":1,"name":"scaling animation","property":"scaling"}],"ranges":[{"name":"ElevatorAction","from":0,"to":200}],"autoAnimate":true,"autoAnimateFrom":1,"autoAnimateTo":200,"autoAnimateLoop":true
 

 

 

 

,"animations":[{"dataType":2,"framePerSecond":24,"keys":[
{"frame":1,"values":[0,0,0,-1]},
{"frame":50,"values":[0,0,0,-1]},
{"frame":100,"values":[0,0,0,-1]}],"loopBehavior":1,"name":"rotationQuaternion animation","property":"rotationQuaternion"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[1.1008,0.1586,1]},
{"frame":50,"values":[1.1008,0.1586,1]},
{"frame":100,"values":[1.1008,4.1586,1]},
{"frame":150,"values":[1.1008,4.1586,1]},
{"frame":200,"values":[1.1008,0.1586,1]}],"loopBehavior":1,"name":"position animation","property":"position"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[1,1,1]},
{"frame":50,"values":[1,1,1]},
{"frame":100,"values":[1,1,1]},
{"frame":150,"values":[1,1,1]},
{"frame":200,"values":[1,1,1]}],"loopBehavior":1,"name":"scaling animation","property":"scaling"}],"ranges":[{"name":"Elevator2Action","from":0,"to":200}],"autoAnimate":true,"autoAnimateFrom":1,"autoAnimateTo":200,"autoAnimateLoop":true
 

 

 

And all three animations works ok. BUT I HAVE TO MANUALY EDIT. IT IS TIME CONSUMING. I REALY DON'T KNOW WHY THERE MESS VALUES EXPORTED.

OK I'll test your latest exporter and see how it's working. But for now I will manually check babylon file and repair it.

But know things works well :)

I send blender file before I see I should add prefixes. But after I see about prefix, I add prefix but exporter 4.6.1 but nothing was better.
I'll wait for your new fix exporter 5.0.2. I need quaternion because of physcis (cannon).

 

We are on bonds

I attach manualy edited animations babylon file. You can see it on sandbox. This is what I want to achive with blender and exporter.

 

greetings

RollShadowAnimation_Deluje.babylon

Link to comment
Share on other sites

vau :) 
JCPalmer qul fix. It works. Yes JCPalmer thanx for your efforts.

Now values for locations (x,y,z) are correct.

My animations are from 1-200. I manually remove {"frame" which are greater than 200 (rotation, location, scale sections).
And remove ranges which are grater than 200. And repair "autoAnimateTo":1460 <-repare to 200,  And now animations are consistent.

All other things are OK,

Brilliant fix 
 

HERE IS ONE EXAMPLE (what I remove manually). I remove bolt text.

JCPalmer, Just Ask? 
It is difficult to find out for each object how many frames each object have for its animation? And correct ranges?

But still export-er 5.0.3 is much much better.

,"animations":[{"dataType":2,"framePerSecond":24,"keys":[
{"frame":1,"values":[0,0,0,-1]},
{"frame":50,"values":[0,0,0,-1]},
{"frame":100,"values":[0,0,0,-1]},
{"frame":150,"values":[0,0,0,-1]},
{"frame":200,"values":[0,0,0,-1]},
{"frame":211,"values":[0,0,0,-1]},
{"frame":260,"values":[0,0,0,-1]},
{"frame":310,"values":[0,0,0,-1]},
{"frame":360,"values":[0,0,0,-1]},
{"frame":410,"values":[0,0,0,-1]},
{"frame":421,"values":[0,0,0,-1]},
{"frame":470,"values":[0,0,0,-1]},
{"frame":520,"values":[0,0,0,-1]},
{"frame":570,"values":[0,0,0,-1]},
{"frame":620,"values":[0,0,0,-1]},
{"frame":631,"values":[0,0,0,-1]},
{"frame":680,"values":[0,0,0,-1]},
{"frame":730,"values":[0,0,0,-1]},
{"frame":780,"values":[0,0,0,-1]},
{"frame":830,"values":[0,0,0,-1]},
{"frame":841,"values":[0,0,0,-1]},
{"frame":890,"values":[0,0,0,-1]},
{"frame":940,"values":[0,0,0,-1]},
{"frame":990,"values":[0,0,0,-1]},
{"frame":1040,"values":[0,0,0,-1]},
{"frame":1051,"values":[0,0,0,-1]},
{"frame":1110,"values":[0,0,0,-1]},
{"frame":1150,"values":[0,0,0,-1]},
{"frame":1210,"values":[0,0,0,-1]},
{"frame":1250,"values":[0,0,0,-1]},
{"frame":1261,"values":[0,0,0,-1]},
{"frame":1310,"values":[0,0,0,-1]},
{"frame":1360,"values":[0,0,0,-1]},
{"frame":1410,"values":[0,0,0,-1]},
{"frame":1460,"values":[0,0,0,-1]}
],"loopBehavior":1,"name":"rotationQuaternion animation","property":"rotationQuaternion"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[7.15,-0.0974,-5.2209]},
{"frame":50,"values":[7.15,-0.0974,-5.2209]},
{"frame":100,"values":[7.15,-0.0974,-4.0279]},
{"frame":150,"values":[7.15,-0.0974,-4.0279]},
{"frame":200,"values":[7.15,-0.0974,-5.2209]},
{"frame":211,"values":[1.1008,0.1586,1]},
{"frame":260,"values":[1.1008,0.1586,1]},
{"frame":310,"values":[1.1008,4.1586,1]},
{"frame":360,"values":[1.1008,4.1586,1]},
{"frame":410,"values":[1.1008,0.1586,1]},
{"frame":421,"values":[1.1008,0.1586,1]},
{"frame":470,"values":[1.1008,0.1586,1]},
{"frame":520,"values":[1.1008,4.1586,1]},
{"frame":570,"values":[1.1008,4.1586,1]},
{"frame":620,"values":[1.1008,0.1586,1]},
{"frame":631,"values":[1.1008,0.1586,1]},
{"frame":680,"values":[1.1008,0.1586,1]},
{"frame":730,"values":[1.1008,4.1586,1]},
{"frame":780,"values":[1.1008,4.1586,1]},
{"frame":830,"values":[1.1008,0.1586,1]},
{"frame":841,"values":[1.1008,0.1586,1]},
{"frame":890,"values":[1.1008,0.1586,1]},
{"frame":940,"values":[1.1008,4.1586,1]},
{"frame":990,"values":[1.1008,4.1586,1]},
{"frame":1040,"values":[1.1008,0.1586,1]},
{"frame":1051,"values":[4.6225,0.1586,-6.2596]},
{"frame":1110,"values":[4.6225,0.1586,-6.2596]},
{"frame":1150,"values":[4.6225,4.8082,-6.2596]},
{"frame":1210,"values":[4.6225,4.8082,-6.2596]},
{"frame":1250,"values":[4.6225,0.1586,-6.2596]},
{"frame":1261,"values":[1.1008,0.1586,1]},
{"frame":1310,"values":[1.1008,0.1586,1]},
{"frame":1360,"values":[1.1008,4.1586,1]},
{"frame":1410,"values":[1.1008,4.1586,1]},
{"frame":1460,"values":[1.1008,0.1586,1]}
],"loopBehavior":1,"name":"position animation","property":"position"},{"dataType":1,"framePerSecond":24,"keys":[
{"frame":1,"values":[1,1,1]},
{"frame":50,"values":[1,1,1]},
{"frame":100,"values":[1,1,1]},
{"frame":150,"values":[1,1,1]},
{"frame":200,"values":[1,1,1]},
{"frame":211,"values":[1,1,1]},
{"frame":260,"values":[1,1,1]},
{"frame":310,"values":[1,1,1]},
{"frame":360,"values":[1,1,1]},
{"frame":410,"values":[1,1,1]},
{"frame":421,"values":[1,1,1]},
{"frame":470,"values":[1,1,1]},
{"frame":520,"values":[1,1,1]},
{"frame":570,"values":[1,1,1]},
{"frame":620,"values":[1,1,1]},
{"frame":631,"values":[1,1,1]},
{"frame":680,"values":[1,1,1]},
{"frame":730,"values":[1,1,1]},
{"frame":780,"values":[1,1,1]},
{"frame":830,"values":[1,1,1]},
{"frame":841,"values":[1,1,1]},
{"frame":890,"values":[1,1,1]},
{"frame":940,"values":[1,1,1]},
{"frame":990,"values":[1,1,1]},
{"frame":1040,"values":[1,1,1]},
{"frame":1051,"values":[1,1,1]},
{"frame":1110,"values":[1,1,1]},
{"frame":1150,"values":[1,1,1]},
{"frame":1210,"values":[1,1,1]},
{"frame":1250,"values":[1,1,1]},
{"frame":1261,"values":[1,1,1]},
{"frame":1310,"values":[1,1,1]},
{"frame":1360,"values":[1,1,1]},
{"frame":1410,"values":[1,1,1]},
{"frame":1460,"values":[1,1,1]}
],"loopBehavior":1,"name":"scaling animation","property":"scaling"}],"ranges":[{"name":"Action","from":0,"to":200},{"name":"ElevatorAction","from":210,"to":410},{"name":"ElevatorAction.001","from":420,"to":620},{"name":"ElevatorAction.003","from":630,"to":830},{"name":"ElevatorAction.004","from":840,"to":1040},{"name":"ElevatorDrugi","from":1050,"to":1250},{"name":"ElevatorPrviAction","from":1260,"to":1460}],"autoAnimate":true,"autoAnimateFrom":1,"autoAnimateTo":1460 <-repare to 200,"autoAnimateLoop":true
,"instances":[]}

 

greetings

Ian

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...