Jump to content

[Beta] - 3ds max 2013+ exporter


GameMonetize
 Share

Recommended Posts

Ok, I've gone been digging around and for some reason the biped mesh seems to become distorted in babylon, which I assume would propagate to the character mesh (causing the problems above).

 

Here is the max scene:

biped_max.png

 

Which then becomes this:

 

babylon_biped.png

http://54.213.159.7/mongtest/test_scene.html

(click a bone to see its names in the console log, keys and v will scale the mesh, but default is with no scaling)

 

Everything seems to be scaled incorrectly and the bones are not joined? 

Max file: http://54.213.159.7/mongtest/Models/skeleton.max

Link to comment
Share on other sites

Hum sounds like the scaling is wrong :) I'm not a good 3dsmax user but if you can reproduce the bug with a really tiny simple scene with the minimal number of bones I can try to check that.

For the record, here is the code I used to export bones from max:

        float[] GetBoneMatrix(IISkin skin, IINode bone, int t, bool hasParent)        {            var maxMatrix = bone.GetWorldMatrix(t, hasParent);            maxMatrix.NoScale();            var trans = maxMatrix.Trans;            var parts = Loader.Global.AffineParts.Create();            Loader.Global.DecompAffine(maxMatrix, parts);            var rotationQuaternion = new Quaternion(parts.Q.X, parts.Q.Z, parts.Q.Y, parts.Q.W);            var matrix = Matrix.RotationQuaternion(rotationQuaternion) * Matrix.Translation(trans.X, trans.Z, trans.Y);            return matrix.ToArray();        }
Link to comment
Share on other sites

Yes, it does seem to be something like that. Here is the simplest biped 3ds max seems to allow (with a basic walking animation), which has the same issue,

 

In Babylon:

http://54.213.159.7/mongtest/test_scene_2.html

 

3dsmax File:

http://54.213.159.7/mongtest/Models/skeleton_simple.max

 

Unfortunately I haven't quite got my head around all these 3D matrices yet so can't offer any suggestions for your export code.

Link to comment
Share on other sites

No, I'm not a guru 3ds max, not yet.  :)

To create the bones, I simply create a biped, but then I hide bones. but I also noticed this bug if I let my bones visible. I have not been able to export animations that works with a biped. I think there's a bug, but I do not know where.

Link to comment
Share on other sites

No, it's the same thing. just pelvis is very great when I leave all the bones display in babylon.

for animation that is not working can be a mistake on my part, I have to test more seriously.

 

si je ne masque pas les os et que j'exporte vers babylon, les os ce masque tout seule, mais pas le pelvis qui est tres grand, comme la main sur l'image plus haut. j'ai pas tester plus, mes animations ne fonctionnant pas, donc je n'ai pas signaler, car je ne sais pas du tout si c’est moi qui fait mal ou pas.

Link to comment
Share on other sites

Hey guys,

 

I have the same problem for a basic mesh with a basic walk animation. My model was not made by me, and the only thing I update in 3DSmax is the bone affect limit (from 20 by default to 4).

I can share the fbx file and the repro scene if you are interested.

 

Cheers, 

Link to comment
Share on other sites

  • 2 weeks later...

Hi, 

 

I use the exporter since 1 weeks. Great job ! It never crashes (never say never :) ).

 

I can export bones and animations with no problem. I didn't try biped, I think  that's to complex for real time animations. The best way  if you want to use motion capture data (like *.bip file) is to have on one side your 3dsmax biped with motion data, and on other side you have to build and skin your mesh with classic 3dsmax bones (15 bones max is sufficient in many case for a character). After that just link your bones to the biped parts one by one. Don't use the 3dsMax link button (babylon exporter will not export the animation). You have to assign to each bone one position constraint controller and one orientation constraint controller  (the target will be a biped part, your left leg target the biped left leg...). You find that in max in motion tab ->parameters->assign controller. That workflow works for me. 

 

UV map are well exported even if it comes from unwrap uvw modifier. Just few strange behaviors at export like strange scale, and easily fixed with reset Xform. I think that comes from me and not from the exporter.

 

So that's cool. I really was waiting for this tool. So thanks Deltakosh !  Here some browser screen captures of one model I'm working on. Sam.

 

visuel.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Hi !

 

After some test I found a better way to make animation in 3dsmax and export to babylon.js, thanks to Samuel Girardin to give me the way.
This tips was tested with 3dsmax 2010 and 2014 but I think this can work with other version and maybe older.

 

In 3dsmax, use only bones to make the skeleton and the pivot point of the mesh must be in center of the world.

 

Export all in Collada format (.DAE) and Import it to Blender, the animation should be fine but not for babylon ,so we gonna make some few changes,

because the scale between 3dsmax and blender is differente, that cause some problemes.

 

So in Blender, select the mesh go to Object => Relations and delete the Parent (who must be the armature).check if scale object=1.

Select the Armature, check the scale and set up to 1 and rotate in same direction of the mesh.

Reselect the mesh Object => Relations and in Parent add Armature.

 

All done you can export to babylon.js and this should be fine (if not try to Rotate the Armature to 0 at the end).

Scaling the mesh if need in babylon.js and not in Blender.

 

Hope that can help.

Link to comment
Share on other sites

Hi,

 

There are indeed problems with the exporter for 3 ds max at the level of what is animation and scale(ladder) on the models with bone.

  1. Bones (structure) must be necessarily masked in 3 ds max otherwise he(it) appears as objects visible of shape of white box. But if we post(show) them (bones) the character becomes 1000 times as big (of the size of the bones which are exported 1000 times as big as the meshing approximately. Where from the problems to everybody at the level of the scale(ladder) I think).
  2. When we resize the meshing, bones resize proportionally but remain 1000 times as big as the meshing and we cannot resize bones in the meshing, it deforms the skeleton.
  3. I also noticed that what is to play at the level of the animations, it is bones and the meshing does not follow bones correctly where it is totally to deform. It is maybe because of the fact that bones are big 1000 times more than the meshing.
----------------------------------------------
<fr>
Salut,
 
Il y a en effet des problèmes avec l'exporter pour 3 ds max au niveau de ce qui est animation et échelle sur les modèles avec os.

 

  1. Les os (structure) doivent être obligatoirement masqué dans 3 ds max sinon il se présente comme des objets visible de forme de boîte blanche. mais si on les affiche (les os) le personnage devient 1000 fois plus grand (de la taille des os qui sont exporté 1000 fois plus grand que le maillage environ. D'où les problèmes chez tout le monde au niveau de l'échelle je pense).
  2. Quand on redimensionne le maillage, les os se redimensionnent proportionnellement mais restent 1000 fois plus grand que le maillage et on ne peut pas redimensionner les os dans le maillage, cela déforme le squelette.
  3. j'ai aussi remarqué que ce qui est jouer au niveau des animations, c'est les os et le maillage ne suit pas les os correctement où c’est totalement déformer. c’est peut-être à cause du fait que les os sont 1000 fois plus grands que le maillage.

</fr>

Link to comment
Share on other sites

I also noticed something else:

it is normal that the skeleton is considered a mesh because when I did a console.log on newMesh I newMeh[0] is that the skeleton and newMesh[1] is the mesh .

but the skeleton is not a mesh so I think there is a mistake here too.

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