Jump to content

Strange animation exported from Blender


aarroyoc
 Share

Recommended Posts

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:

 

Link to comment
Share on other sites

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 :)

 

IKexport.thumb.png.f6eef5cbdebe3f666136f1ae22699995.png

 

Link to comment
Share on other sites

@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. :o;)

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 :)

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@aarroyoc : well I took a look at your model - and tried to export it. Failed - no export:o. 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 :)

issues1.png

Link to comment
Share on other sites

@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 :)

Link to comment
Share on other sites

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!!

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...