Pierre Glibert Posted June 19, 2016 Share Posted June 19, 2016 Hello everybody, We have a problem with Blender Exporter 4.6.1. Let us explain to you : We have two animations : one cube with skeleton and another with a standard animation. In blender, after we export our scene with babylon exporter, it replaces all the animations by one. In the babylon file, we have all animations that are merged one after another. For all meshes that contain animation, the exporter copy all the keys of all the animations in one animation. Please find enclosed the file with source and video to show you this bug. Thank you in advance for your help Letsbro studio team. cubeAnimBug.zip Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 @JCPalmer may be able to help Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 20, 2016 Share Posted June 20, 2016 Yep, Blender exporter supports multiple actions translated into BJS AnimationRanges. I see range tags in .babylon file "ranges":[{"name":"animArmatureCube1","from":0,"to":100},{"name":"animCube2","from":110,"to":210}] Not a bug, a feature. Call the animations on your skeleton, or non-armature mesh using: armatureCube1.beginAnimation("animArmatureCube1", or "animCube2") and cube2.beginAnimation("animArmatureCube1", or "animCube2") GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 21, 2016 Author Share Posted June 21, 2016 hi @Deltakosh @JCPalmer, Thank you for your quickly answer. @JCPalmer : It's not really that the bug. Could you look in the first time at our video that shows the bug ? In Blender, you can see 2 cubes : "armatureCube1" with an animation called "animArmatureCube1" and "cube2" with an animation called "animCube2". You can see what append after the export : "animArmatureCube1" is replaced by "animCube2". So, the position of the cube "armatureCube1" has changed because it take the position of animation "animCube2". Can you help us ? Thanks. Letsbro team. cubeAnimBug.zip Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 21, 2016 Share Posted June 21, 2016 I see, it looks like the armature animation is duplicated. Even in your .babylon file cube2 is participating in both actions, as the values for rotation and position are not the same for frames (100 & 210). Position, rotation, & scale properties are exported as the actual frames. Skeletal animation is exported for every frame (baked). As a diagnostic, I switched off baking for skeletons, line 49: FRAME_BASED_ANIMATION = False # this is only able to be turned off by the TOB exporter right now I get actual frames above 110, so something is getting recorded for the armatureCube1 skeleton for the animCube2 action. Here is the relavent part of that .babylon: "skeletons":[{"name":"armatureCube1","id":0,"dimensionsAtRest":[0,1,0],"bones":[ {"name":"Bone","index":0,"matrix":[1,0,0,0,0,0.591,0.8066,0,0,0.8066,-0.591,0,0,0,-1.5,1],"rest":[1,0,0,0,0,1,0,0,0,0,-1,0,0,0,1.5,1],"parentBoneIndex":-1,"length":1 ,"animation":{"dataType":3,"framePerSecond":24,"keys":[ {"frame":0,"values":[1,0,0,0,0,1,0,0,0,0,-1,0,0,0,-1.5,1]}, {"frame":100,"values":[1,0,0,0,0,1,0,0,0,0,-1,0,0,0,-1.5,1]}, {"frame":111,"values":[1,0,0,0,0,1,0,0,0,0,-1,0,0,0,1.5,1]}, {"frame":210,"values":[1,0,0,0,0,1,0,0,0,0,-1,0,0,0,1.5,1]}],"loopBehavior":1,"name":"anim","property":"_matrix"}}] ,"ranges":[{"name":"animArmatureCube1","from":0,"to":100},{"name":"animCube2","from":110,"to":210}]}], Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 22, 2016 Author Share Posted June 22, 2016 You are right ! We have a link between animations. In blender, we need to manage animations in "NLA editor". We must to create a new track per animation. That works with several mesh animations but we have always a problem when we add an armature animation... Blender add automatically "animCube2" to "armatureCube1" after export ... We will search the solution and we will contact you when we will find it Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 22, 2016 Author Share Posted June 22, 2016 We have no solution ... We don't understand why the exporter change our Blender file... We made you two screenshots : - first before export : - and second after export : Is there somethings in exporter code that change something in Blender ? @JCPalmer : Have you some skills in Blender ? If yes, could you try to do same think with our blender test and see if you are the same result please ? thank you again, Letsbro studio team. Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 24, 2016 Author Share Posted June 24, 2016 hi @gryff, I saw, in a post, that you are an expert in blender animation. Could you help me for this problem please ? I have 2 animations. One on armature and one on mesh. After export, the animation change and i don't know why ... I don't know if it's a bug or if I do something wrong . There is an attached file with a short video that show my problem and my blender test. Thank you for your help, Letsbro studio team. cubeAnimBug.zip Quote Link to comment Share on other sites More sharing options...
gryff Posted June 24, 2016 Share Posted June 24, 2016 @Letsbro studio : Well I'm not sure I would call myself an "expert" but I will take a look at your file over the weekend. And @JCPalmer knows all the ins/outs of the exporter as he wrote it cheers, gryff Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 26, 2016 Author Share Posted June 26, 2016 @gryff Thank you for your time Quote Link to comment Share on other sites More sharing options...
gryff Posted June 26, 2016 Share Posted June 26, 2016 @Letsbro studio Well I took a look at your files and video - and I thought, I've seen this before a few weeks back. I was using a scene with a rigged character (33 bones) and a simple animated cube. The export resulted in the character being in a very strange position and the animation of the cube adding to the animation range of the character. As a consequence of this addition the file size was increasing. Now by chance, I was starting to test out a recent way of creating scenes - using "BABYLON.SceneLoader.Append" instead of "BABYLON.SceneLoader.Load" - as the latter has been deprecated. So I created two .blend files, one with the character and one with the animated cube, exported each file then used two separate Append statements. Using this approach I have created a simple set up that roughly duplicates your test scenes: Two cubes The white cube has the rig, the red one is just a simple animation. In both files animation are 1-100 frames - and no frames upto 200+. Take a look at the code in the file CreateScene.js - I've tried to give some clear comments about what is happening with each line of code. I went a bit further and added a second mesh to use the simple animation - Suzanne: Two cubes and Suzanne In this latter case the red cube and Suzanne only have animation keys for rotation (location keys would move Suzanne to the location of the box). Both Suzanne and the cube are in the same.babylon file. Now the problem really is not with the export of multiple animations as a rigged character may have walk, run, jump, idle etc and we want those ranges filled with a library of animations as the old method (before @JCPalmercame up with the idea of ranges) was to just manually build a single animation with all the different pieces (tedious). The problem is actually multiple animations on multiple objects - the animations end up being combined into a single range Now for rigged objects there has been a recent development - copying animation ranges - here and here. And actually only copying specified parts of the animation range contained in an animation file. As someone on that thread put it "bleeding edge". Object meshes with simple animations also have ranges - but I am not sure if they are copyable from one object to another. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 27, 2016 Author Share Posted June 27, 2016 @gryff @JCPalmer Thank you for your time , that help us. Do you think that export of differents armatures animations on several meshes in the same blender file will be possible in the futur ? You rock ! Letsbro studio team. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 27, 2016 Share Posted June 27, 2016 Multiple actions on armatures with multiple meshes which have it set as a modifier is already possible. I do not what you are defining as an "animation", but at this level of detail the term is inadequate. I saw you are doing something with that NLA Editor thing. You say you need to manage "animations" with it. No you don't, at least not with Babylon JS. BJS does not work that way. There is no equivalent to NLA in BJS, nor an implementation of this track thing you reference. Stop using it would be my recommendation. Quote Link to comment Share on other sites More sharing options...
paleRider Posted May 8, 2017 Share Posted May 8, 2017 Hello everybody. Same problem here with a model (not armatures needed) containing several moving parts (mainly different doors opening and fans spinning). In the process of exportation the blender animation is changed. As a result we get a useless .babylon scene (as is not consistent with the intended animation) and our blender scene keyframes are modified (corrupted). For your convenience, it can be reproduced using a very basic scene. - Before exporting the scene: - After exporting, blender (shown) and .babylon scenes are both wrong. We are not using NLA at all. Is this misbehaviour of the exporter going to be fixed? Best regards. P.S. Blender 2.78 BJS Blender Exporter 5.2) Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted May 9, 2017 Author Share Posted May 9, 2017 Hi @paleRider, I don't know if it's possible to fixe it ... I use 3dsMax exporter now and I make all animations in one time line and cut it with range in JS side. But to be sure, ping @JCPalmer Have a good day, Letsbro team. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 10, 2017 Share Posted May 10, 2017 @paleRider : I tried to explain this above - but Dropbox screwed up my examples with changes they made last September. So here is a new example without Dropbox. The blender scene has two objects - a cube and a sphere - with each having an animation that moves them from left to right separately (see attached image) Undesired Merged Animations - the objects move on top of each other (condition A in image below) Desired Animations - the objects each have their own animations (condition B in image below) The difference is in how the animations are named. Note the "-" (hypen) in the name for the proper animations(B). The exporter need this - otherwise it combines the animations . cheers, gryff Quote Link to comment Share on other sites More sharing options...
paleRider Posted May 11, 2017 Share Posted May 11, 2017 Thank you very much both (letsbrostudio and gryff) for your time. About using 3DSMAX, our favorite 3D software here is Maya, as we were until the moment more focused on pre-rendered 3D. Now we are moving seriously to RT 3D also (on web, VR and RA projects), and as there's not a Maya exporter for BJS, we decided to choose Blender for this kind of tasks. About the "trick" with the hypen, in the previous post explaining it I didn´t catch the sense. My fault. I suppose the naming convention is then "MESH_NAME-Action" in any case. Unfortunately, after doing that way I get the same bad results that before. (?) Anyway, I was trying this days the new Blender Exporter 5.3 Beta. My problem with it was that it exports all the actions in the scene one after the other along a unique timeline (extending the ranges) so I needed to make numbers to resynchronize things. Miraculously applying your "hypen recipe" did the job, and I have now finally the animations side by side and with the proper frame ranges. As a colofhon: "MESH_NAME-Action" action names + Blender Exporter 5.3 Beta is the way to go!! Best regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.