Jump to content

Strange problems with blender exporter


joshcamas
 Share

Recommended Posts

K, so first thing ya need to know is I developed this rig months ago when I was working with Unreal Engine. And of course their exporter is different from babylon, which may be why things are happening this way.

Ok so first off, in UE4 the scaling had to be different. So my model is rigged in this scaling:
Zxwk8iR.png


And I had hoped that setting this global scale back to 1 would fix it, but alas it does not. And if I manually scale the armature then the animations go crazy. So I guess this is a feature request: could someone throw in the global scale into the scale calculation for the exporter, or maybe just show me where I could put the code? I have a bit of knowledge on blender python cause I did some exporter work back when I was using UE4, but not enough to find where to put it. Thanks! If I must I can just scale it in-game though.

Also, it gives me the warning "WARNING: Maximum # of influencers exceeded for 19 vertices, extras ignored", which is strange since my character is VERY low poly, at only 420 (haha) vertices in all, and each bone doesn't affect many. So maybe I'm just confused what this warning means?

And finally, the biggest problem. Whenever I export, my character teleports:
Before export: http://i.imgur.com/WhAvleR.png
After export: http://i.imgur.com/QtVA9rz.png

It's strange cause both my skeleton and my mesh's set location is at the center (crl-g send them there), so it shouldn't do this o-o
Any ideas? I'd rather not recreate a perfectly fine (well, its rather ugly but that's beside the point hehe) mesh! 

Thanks so much! I love the additions the exporter has had since I left, it's getting really useful! :D

Link to comment
Share on other sites

33 minutes ago, joshcamas said:

And finally, the biggest problem. Whenever I export, my character teleports:

@joshcamas: can you post your .blend file?

35 minutes ago, joshcamas said:

"WARNING: Maximum # of influencers exceeded for 19 vertices, extras ignored"

It has to do with 19 vertices are being influenced by more than 4 bones in your rig. So you should check your weight-painting, or if you wish, change the maximum number of influencers to a value higher than 4 (the default setting).

Select your skeleton mesh, then under the meshes tab go to the .Babylon.js exporter box and find a box that says "skeleton" and allows you to change the "max influencers/vertex".

cheers, gryff :)

Link to comment
Share on other sites

30 minutes ago, gryff said:

@joshcamas: can you post your .blend file?

It has to do with 19 vertices are being influenced by more than 4 bones in your rig. So you should check your weight-painting, or if you wish, change the maximum number of influencers to a value higher than 4 (the default setting).

Select your skeleton mesh, then under the meshes tab go to the .Babylon.js exporter box and find a box that says "skeleton" and allows you to change the "max influencers/vertex".

cheers, gryff :)

Yus! Here's my blend:
http://samacstudios.com/hosting/skeleton.blend

And I see! Strange cause from my quick check that isn't so, so obviously there's some sneaky hidden vertices that need to be fixed :)

Thanks so much for the reply!

Link to comment
Share on other sites

@joshcamas: Thanks for the blend file. I took a quick look at it. See image below.

The first thing I did was add a light then exported to my local server as a .babylon file, created a simple index.html page that added a camera and loaded the babylon file.

Result:  A in the image below - not seeing the skeleton mesh :o In fact dropping the .babylon file into the Sandbox - throws all kinds of errors.

Next I  checked the rig and mesh origins - they seemed OK.

And finally the bones and vertex groups that define the vertices that go with each bone. The vertex groups make no sense. - Result B below.

If you look carefully at B - I have selected in Edit Mode the vertices that should be associated with the "Upper Leg.L" bone(blue highlight)  - and as you can see it includes vertices all over the body including the top of the head!! A lot of the other bones show similar behaviour, and you have vertex groups that seem to have no corresponding bone or vertices.

The units are another thing. I never use units. When I append your mesh to an empty Blender file - it tells me that the mesh and rig is about 165 units high. Why so big?

Did you make this model and rig - or has it come from somewhere else?

I will look further tomorrow or maybe Saturday.

cheers, gryff :)

 

skeleton1.png

Link to comment
Share on other sites

2 hours ago, gryff said:

@joshcamas: Thanks for the blend file. I took a quick look at it. See image below.

The first thing I did was add a light then exported to my local server as a .babylon file, created a simple index.html page that added a camera and loaded the babylon file.

Result:  A in the image below - not seeing the skeleton mesh :o In fact dropping the .babylon file into the Sandbox - throws all kinds of errors.

Next I  checked the rig and mesh origins - they seemed OK.

And finally the bones and vertex groups that define the vertices that go with each bone. The vertex groups make no sense. - Result B below.

If you look carefully at B - I have selected in Edit Mode the vertices that should be associated with the "Upper Leg.L" bone(blue highlight)  - and as you can see it includes vertices all over the body including the top of the head!! A lot of the other bones show similar behaviour, and you have vertex groups that seem to have no corresponding bone or vertices.

The units are another thing. I never use units. When I append your mesh to an empty Blender file - it tells me that the mesh and rig is about 165 units high. Why so big?

Did you make this model and rig - or has it come from somewhere else?

I will look further tomorrow or maybe Saturday.

cheers, gryff :)

Thanks so much for working on this!
I mentioned before that the model is huge because for UE4, it required the scaling in blender to be different... 0.001m. The problem is Babylon exporter doesn't look at the world scale, so it exports in a massive size. :(
And I didn't even think to look straight at the points in edit mode, awesome! I built the base rig a longg time ago, and yesterday I quickly threw together this little skeleton guy, so that explains the messy vertices. 
And I'll check out those errors too! Ik it doesn't have a camera or lights (on purpose, since I'm not exporting a scene, just a single character), I wonder what other errors there are..

Again, thank you so much, you've been so helpful! 

EDIT: Nice, cleaning up those vertices did the trick! :D

Link to comment
Share on other sites

Ok so it looks like it works! 
I followed the instructions from here: http://blender.stackexchange.com/questions/24839/how-do-i-resize-an-armature-without-ruining-its-poses

It was very painful for even one animation, so I ended up trashing all of the other animations except my walk one. Rip.
BUT it works! I don't know why but it doesn't do that teleport thing either, must be a glitch due to the old large size? I'll keep ya'll posted in case it happens again, but for now it seems to work!
YES!

Thank you @gryff for saving my life here!!

Link to comment
Share on other sites

Ok I spoke too fast.... NOOOO

Now I'm having trouble with animations:
3yhVz1Q.png

Here's my code:

this.mesh = mesh.loadedMeshes[0]
this.skeleton = mesh.loadedSkeletons[0]
Game.scene.beginAnimation(this.skeleton, 0, 40, true, 1);

And here's my updated blend: http://samacstudios.com/hosting/skeleton.blend

Note this only seems to happen when I "beginAnimation". And I've tried a bunch of speeds n stuff too.

Thanks!

Link to comment
Share on other sites

@joshcamas: well josh, I looked at your new file - and you still don't have those vertex groups right - see image below.

I selected the "hips" group - and it includes all of the leg vertices and 8 vertices at the end of the arms. That may explain your image above.

And you still have vertex groups for at least two non-existent bones(green box).

cheers, gryff :)

skeleton2.png

Link to comment
Share on other sites

Aight, so I think I got it. I didn't realize the exporter just threw all of the animations together in one big loop, and for some reason I had that weird animation there.
Yea, I have those two groups that I haven't added yet, I'll add them eventually LOL

Anyways, thanks so so much for all of your help! I'm sure I'll have more problems (skeletal exporting, no matter the engine, always is very tough to get exact), but for now, it works! YES!

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