Ridge Batty Posted June 16, 2017 Share Posted June 16, 2017 Hi, I'm trying to import meshes with multiple animations (from Blender). Is there any description of correct workflow on how to make Babylon compatible animations in Blender? Single animation works nicely when you just manually fix scaling and rotation problems. But no matter how you append more animations into one Blender file it seems to me that transformations get messed up in export process. I've tried using Action Library and Pose Library, but both strategies produce weird twisting and morphing of the mesh. The result does somewhat resemble the intended animation, but it's hard to say what exactly goes wrong. Of course obvious workaround is to put every animation in separate file but that quickly makes download sizes unpractical (several 100 MBs). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2017 Share Posted June 16, 2017 Pinging our lord of Blender: @gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted June 17, 2017 Share Posted June 17, 2017 On 2017-06-16 at 10:52 AM, Ridge Batty said: Single animation works nicely when you just manually fix scaling and rotation problems. Hi Ridge - welcome to the forum So you have corrected the usual issue that people run into - unapplied transforms On 2017-06-16 at 10:52 AM, Ridge Batty said: But no matter how you append more animations into one Blender file it seems to me that transformations get messed up in export process A couple of thoughts: 1 What do you mean by "append" ? Can you describe your process? 2. If you have multiple animations assigned to an armature in Blender, when they are exported they will just be one animation in the .babylon file that has been divided up into "ranges". So if you have two 60 frame animations in Blender, they will end up as one animation in the .babylon file with one animation from 0-60 and the second animation 65-125 (extra frames get added to separate the two actions.) Search your .babylon file for the word "range" cheers, gryff Quote Link to comment Share on other sites More sharing options...
satguru Posted June 17, 2017 Share Posted June 17, 2017 @Ridge Batty I use Action library. Few things which I found helpful 1) The last action in the action editor should be the rest pose ( I normally use a t-pose as the rest pose). To position an action as the last action in the action editor, name it something starting with "z". The actions are sorted by name, alphabetically 2) Just before you export make sure the action in effect , in other words the action chosen in the action editor, is this last , rest pose action. 3) If the action name has a dash ("-") in it then it is ignored by the exporter. So for example if you call your action "my-action" it will be ignored. 4) in the babylon scene I find that the animation range "from" value is off by one. So after I load the file into my scene, I increment the "from" value of each animation range by one. I am using 5.3-beta exporter. Quote Link to comment Share on other sites More sharing options...
Ridge Batty Posted June 21, 2017 Author Share Posted June 21, 2017 No... can't get it to work. I was kinda hopeful after seeing @satguru 's post. Btw, I have noticed that ranges are 1-2 frames off. Anyway, I always end up with the same problem, animations get warped and twisted. Single animations do work, but can't pack multiple animations in one file -- unless I append the whole armature and mesh into the file again and again which makes no sense. I haven't modified the animations in any way except applied rotation and scaling as you do. The animations are from Mixamo. Has anyone accomplished in using them in Babylon? See the attached image, right hand gets twisted wrist and stretched fingers and the character is leaning to left like he's about to tip over... Quote Link to comment Share on other sites More sharing options...
satguru Posted June 21, 2017 Share Posted June 21, 2017 @Ridge Batty can you share your blend file? Quote Link to comment Share on other sites More sharing options...
Ridge Batty Posted June 21, 2017 Author Share Posted June 21, 2017 Ok I accidentally discovered something just before I posted a test file here... While I did set the "zRest" animation as the last animation as you correctly suggested, apparently that wasn't enough. You have to switch to Pose Mode before exporting! This is weird but I was able to reproduce it several times. Exporting in object or edit mode will not work since T-pose is not actually activated (even though it's selected). Maybe this is obvious to Blender users but I'm just a programmer so... Anyway big thanks to both who helped, I was this close to give up! Quote Link to comment Share on other sites More sharing options...
turingtester Posted December 16, 2019 Share Posted December 16, 2019 Hey, so I downloaded a character from Mixamo, then fixed a skeleton to it via metarig and then I made a walk animation. Only problem is now I can't get the animation to function properly when exported. I want to make more animations but first I figure I should get the animation to function properly in the game demo. Do I need to change something in the Javascript code to make the browser recognize the animation, or did I miss a step in Blender. Please let me know. Here is what it looks like when integrated into the game. http://turingtester.gitlab.io/babylonjs-intro/example-aj/ ajcoloranimate.blend 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.