aarroyoc Posted February 3, 2017 Share Posted February 3, 2017 Hi, We have a model with an animation. We've done it in Blender, then exported with the plugin. But the animation isn't working. I don't know if it's a problem between Blender/Babylon.js y/z axis or is something related to the scaling. Here's the code BABYLON.SceneLoader.ImportMesh("", "/data/", "sectarian4.babylon", scene, (meshes, ps, skeletons) => { this.mesh = <BABYLON.Mesh>meshes[0]; this.mesh.isVisible = true; this.mesh.position.y = 0.5; this.mesh.scaling.x = 0.05; this.mesh.scaling.y = 0.05; this.mesh.scaling.z = 0.05; this.mesh.skeleton.beginAnimation("Caminar", true, 1.0); }); Good animation shown in Blender: Bad Animation: Quote Link to comment Share on other sites More sharing options...
gryff Posted February 3, 2017 Share Posted February 3, 2017 hi @aarroyoc Welcome to the forum Hard to tell from the movies what is going wrong - but it looks like it could be the "spaghetti monster". It would be nice to have the .blend file to look at. From what I can see, the origin for the rig is at the hips - where is the origin for the mesh(es)? Also you look to be using an IK rig - so all non-deforming IK bones should have IK in the name (that includes all bones that are "pole targets" - see image below) As I said the .blend file would be useful. cheers, gryff Quote Link to comment Share on other sites More sharing options...
aarroyoc Posted February 4, 2017 Author Share Posted February 4, 2017 Hi @gryff! The model is designed from scratch, but I didn't do it. My friend did it (model and animation). So I didn't understand part of your comment but I'll show him your message (he's a newbie with Blender but far better than me!!) Here's the blend file: monje.zip Quote Link to comment Share on other sites More sharing options...
gryff Posted February 4, 2017 Share Posted February 4, 2017 @aarroyoc: TY for the zip file . Will try and look at it today Don't worry about being "newbies" - we all are newbies at something, at sometime. Yesterday, I become a newbie granddad - so now I'm learning again. And just so I know, what version of Blender are you using, and what version of the Blender exporter ? cheers, gryff Quote Link to comment Share on other sites More sharing options...
kpgbrink Posted February 5, 2017 Share Posted February 5, 2017 I have had this problem a lot. What solved it for me was making the mesh that is animated be centered so it was not translated or scaled. Also before I export I would set the animation to frame zero and alt + g, alt + r, alt + s, in order to reset the position of the pose. After I did that the export worked properly. Although I can't figure out why it worked. It would be nice if someone knew why. I do notice you start on keyframe 0 but I start on keyframe 1. I don't know if that is significant or not. Quote Link to comment Share on other sites More sharing options...
gryff Posted February 6, 2017 Share Posted February 6, 2017 @aarroyoc : well I took a look at your model - and tried to export it. Failed - no export. So what version of the exporter are you using to get the "bad animation" movie above? Further examination of your file tells me: 1. You are using the NLA Editor. I don't think the exporter deals well with the NLA Editor. I would recommend you don't use it - you can .blend animations in BJS code. 2. The mesh(es) and the skeleton don't have the same transforms; For example the skeleton is rotated -90 degrees, the mesh(es) are not. (Image window A below) 3. There is an odd bone "Capucha" which is not connected to the rest of the skeleton - has no parent. Why is the "hood" part of the mesh not parented to the "Capezza" bone? (Image B window below) 4. And finally look at Image C below - note that the selected knee bone which is a constraint bone is labelled Knee.IK.L. IK/Constraint bones do not deform the mesh just are a tool for controlling the rotation of other bones which are deforming the mesh. They are not used by BJS and you can set the exporter to ignore these bones. This is a model I created a couple of weeks ago and will post the .blend file here if you want it to play with. cheers, gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted February 6, 2017 Share Posted February 6, 2017 @aarroyoc: here is the file I created a few weeks ago monk.zip It has a simple rig with an added simple IK rig. Not how both the rig and meshes have the same transforms. I created a simple crap walk animation using IK - and it exports fine with the Blender Babylon Exporter v5.2. Delete my anim and add your own. The model is basically the same size as yours. Have fun cheers, gryff Quote Link to comment Share on other sites More sharing options...
aarroyoc Posted February 6, 2017 Author Share Posted February 6, 2017 Hi @gryff! Wow amazing! First of all congratulations!! Being a granddad isn't in my plans yet but it must be great! We used the Babylon.js Exporter 4.2, which is on GitHub. We saw the other version but it didn't export and as both versions were available we choose the one that worked. I'm going to talk with my friend showing him your suggestions and we'll try your model as well. I'll post as soon as progress is made. Thanks!! 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.