Jump to content

Animation weights warped after Blender export


ozRocker
 Share

Recommended Posts

I have some players that are rigged but have no animations and I have a master animation file.  I am cloning those animations to each new player as they appear in the scene.  

I'm using this kind of code to transfer the animation:

	this.mesh.skeleton = Assets.animator.skeleton.clone(JSON.idx);
	this.mesh.skeleton.copyAnimationRange(Assets.animator.skeleton, "Idle");
	this.mesh.skeleton.copyAnimationRange(Assets.animator.skeleton, "Walk");
	this.mesh.skeleton.copyAnimationRange(Assets.animator.skeleton, "Run");

"Assets.animator" is the mesh with the master animations.  "this.mesh" is the new player.  This process works fine but I'm having a problem with one player in particular.

When I apply the run animation from the master into my player in Blender it looks like this:

good_arm.jpg

 

But in my Babylon.js scene it looks like this:

funny_arm.jpg

It looks like something has happened to the bone weighting on the arm.  Does anyone know how to fix this?

 

Link to comment
Share on other sites

31 minutes ago, adam said:

Make sure you don't have any positions or scaling that has not been applied to your model in Blender.

Yep, got that sorted.  I apply position and scale to mesh and armature after I've done the process of clearing parent and re-parenting.

Link to comment
Share on other sites

29 minutes ago, adam said:

I'd try clearing all the vertex groups when re-parenting (remove parent, clear all vertex groups, then parent).

Can you post a screenshot with the skeleton viewer turned on in the BJS debugger?

Ok, I cleared out the vertex groups before re-parenting but the end result was the same.

Here's the skeleton from the debugger:

skeleton.jpg

Link to comment
Share on other sites

When you re-parented did you also check that rotation, location, and scale had been applied to the skeleton too?

I had a similar issue with one of my models.  Looked fine in Blender, but in BJS the skeleton did not line up with the mesh.

Link to comment
Share on other sites

34 minutes ago, adam said:

When you re-parented did you also check that rotation, location, and scale had been applied to the skeleton too?

I had a similar issue with one of my models.  Looked fine in Blender, but in BJS the skeleton did not line up with the mesh.

Yep, always making sure I apply the transformations.

I made a playground where I have the exported babylonjs file but I bundled the animations with the mesh, instead of cloning and copying and the funny arm problem went away.  

http://www.babylonjs-playground.com/#1IGIDN

I'll create another playground with the cloning to see if I can replicate the problem

(Ignore the skipping frames for now.  That happens with all my exports and I don't know how to get rid of it :(  )

Link to comment
Share on other sites

14 minutes ago, adam said:

I see errors in the console when I comment out line 29.  Maybe that isn't what you were referring to. 

I don't know what's going on there.  I just ignored it 'cos it doesn't happen on my server. 

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