Jump to content

Axis problems with rigged makehuman models through blender->dae


chriscalef

Recommended Posts

So, this weekend I finally tackled the subject of importing a rigged makehuman model to T3D... and am ready to ask for help.


I made some very impressive nightmare demon monsters though!


http://opensimearth.com/images/screenshots/blender_dae_t3d_04.jpg


My problem boils down to the skeleton coming in on the wrong axis (I think). Be default it ends up rotated 90 degrees around the X, ie face down on the XY plane. The stretched out mesh is a problem I've seen many times before, signifying a cumulative error in node positioning, ie adding the error of the parent to each child and so on.


Here's the working figure in blender, with the "game" skeleton rig from makehuman:


http://opensimearth.com/images/screenshots/blender_dae_t3d_01.jpg


But, backing up a bit: I first tried just saving collada files directly from makehuman. For some reason, this resulted in an invisible mesh, and I never did figure out exactly what was wrong with it, but it seems there are no materials at all. In any event, the bones seem to end up behaving the same as the ones from blender, so...


I soon moved on to exporting from makehuman to blender, using first mxh2 format and then just collada. From blender, I export to collada and import the results into T3D. In a model with no bones, this works more or less perfectly, in terms of mesh, textures, UV maps etc.


Here's an unrigged model, with the same pose but some clothes thrown in. It has some weird lighting issues (flickery lighting, and the fact that the clothes don't cast shadows, only the skin mesh does) but other than that he looks reasonably okay.


http://opensimearth.com/images/screenshots/blender_dae_t3d_07.jpg


However, with a skeleton, the default pose pictured above in blender ends up like this after import:


http://opensimearth.com/images/screenshots/blender_dae_t3d_02.jpg


In the shape editor, you can see the skeleton orientation. I played around with the override_upaxis option, and that did rotate my skeleton but didn't solve the main cumulative (read: demonic monster from the depths of hell) problem. Note that in addition to the overall rotation of the skeleton, there are also major issues with the pose itself, especially the arms.


http://opensimearth.com/images/screenshots/blender_dae_t3d_03.jpg


Here is a basic TPose, in the mission:


http://opensimearth.com/images/screenshots/blender_dae_t3d_05.jpg


And here's the same pose in the shape editor:


http://opensimearth.com/images/screenshots/blender_dae_t3d_06.jpg


I'm remembering some sketchy methodologies in the collada importer when it came to fixing up axis / handedness, and am afraid it's going to come down to a full-on engine problem here, but before I go there I'd love to know if there's just some setting I missed somewhere.


Anybody doing this every day and willing to share their system?

Link to comment
Share on other sites

I ran in to the same problem trying to animate the Torque dummy.


As Duion said the bones need to be aligned with the mesh, also the first frame of every animation needs to be in the base pose (or T pose in most cases), then you have to adjust the animation length in the animations tools inside Torque.

Link to comment
Share on other sites

Hmm, okay... any quick advice on how you do that? It _seems_ properly rotated to the naked eye, as in my second image, where you can see the skeleton with fingers etc. looking like they are in the right position relative to the mesh.


Is it an export to collada issue, or is the skeleton rotation something I have to do to the model in Blender itself before the export process begins?

Link to comment
Share on other sites

You did export wrong, your skeleton is on the floor, it should stand upright. If you do that your skeleton will face negative y axis, so you need to rotate it to face the positive y axis in blender. Make sure you are in the right editor, I think you need to rotate the whole thing in the object editor, not the mesh in edit mode.

My character using the makehuman skeleton works fine and I just rotated it.

Link to comment
Share on other sites

No idea what I used, I tried until the guy was standing upright, probably Z up, only weird people use Y for the Z axis.

I just took the whole thing in object editor and rotated it 180 degree. You will have -180d rotation on Z axis for the whole object then in your right inspector panel.

Link to comment
Share on other sites

Well, I've clearly got something different going on here. Rotating my character resulted in the same mess, only rotated 180 degrees:


http://opensimearth.com/images/screenshots/blender_dae_t3d_08.jpg


Messing with the bone orientations in makehuman (along local x, along local y) definitely changes things, but not in a way you could describe as better:


http://opensimearth.com/images/screenshots/blender_dae_t3d_09.jpg


Thanks for confirming this does work for somebody, though! Definitely good to know it can work without serious engine changes. It's probably just some global/local checkbox somewhere...

Link to comment
Share on other sites

Posting more of those creepy images isn't going to help...

Ok I dug out the export options I used:

-feet on ground

-Z up, face -Y

-scale units: decimeter


Format: Blender exchange (mhx)


Then you have to rotate the thing in object editor 180 degree around the Z axis so it faces the positive Y axis.


That should be all that is needed, very simple.


PS: Here is the feature request I posted on the makehuman project to support Torque3D: http://bugtracker.makehumancommunity.org/issues/984

With that change you could export to Torque3D directly without having to rotate it, which is the only thing you need to do to make it work for Torque3D.

Link to comment
Share on other sites

In blender, take care to make sure that your mesh and armature have any rotation and location changes 'applied'. Having the transforms at non-0 can look fine in blender, but yield really weird results in-game.


Just the other day I was testing character models/rigs and had the guy turn into a spindly slenderman horror-beast because the mesh had been rotated and the armature hadn't, and it tried to 'compensate'.

Link to comment
Share on other sites

Ah, thanks Jeff, that sounds like we might be getting warmer. Although it's weird because I haven't made any changes at all in makehuman, with the exception of playing with the sliders and picking a skeleton. And thanks for looking up your details, Duion! Trying again...

Link to comment
Share on other sites

@Duion, so there's literally nothing else you did in makehuman or in blender, relevant to this problem, besides the -180 degree rotation? Because I am literally just opening up makehuman now, taking the default character, giving it a default skeleton, exporting a collada file, opening that collada file in blender, either rotating or not rotating it 180 degrees, and exporting as collada. Result every time is a slenderman horror beast.


I'm on makehuman 1.1.0, blender 2.71, just for reference.


Oh, and, results are the same exporting to blender using mxh2 format, as well.

Link to comment
Share on other sites

Ah, here's some slight progress anyway... in blender, I went to the "Set Origin: Geometry to Origin" option, and found that when I did that, both the mesh and the skeleton centered themselves on the origin, but the skeleton was offset by some distance (a foot or so, in human terms):


http://opensimearth.com/images/screenshots/blender_dae_t3d_10.jpg


However, the result of exporting and importing this into Torque was, while not perfect, visibly quite a bit better:


http://opensimearth.com/images/screenshots/blender_dae_t3d_11.jpg


As you can see, the slenderman monster on the right actually has some amount of bodily integrity, when compared to the nightmare creature on the left. Hmmm.

Link to comment
Share on other sites

Huh, well I gotta go AFK for the day, but if anyone who has this working could possibly take the time to recheck their process, I'd sure appreciate it!


There must be some additional step I'm not doing, because I'm certainly not doing any extra steps to mess it up. As mentioned above, I literally just


1) open makehuman,

2) click on a skeleton for the default figure, and

3) export,


and then in blender, I just


1) export to collada.


I'm guessing I'm probably only missing one all-important click somewhere, but rotating 180 definitely isn't it. (I'm sure it's also necessary, but not causing my main slenderman problem.)


Re: version, yeah, I'll try to backtrack versions next.


Thanks for everybody's patience though! Definitely looking forward to having this pipeline hooked up!

Link to comment
Share on other sites

AHHHH, OMFG.


Very sorry for any wasted time anyone spent thinking about my little problem here, because I just realized it was, once again, entirely my own fault. :-P


Turns out it was an artifact of some changes I myself made to my build's collada import process, way back in 2011, for the purpose of fixing a problem related to playing animations on imported collada figures. The problem stemmed from the way stock Torque "fixes" handedness on incoming collada models.


I say "fixes", because the stock method is simply to rotate the figure from Y up to Z up, without changing the actual left/right handedness of the nodes. Sorry I can't explain it better right now but the end result was that if I had a bunch of animations made for a right handed Torque character, and then I brought in a left handed Collada model with the exact same bone structure, I would expect to be able to play my anims on this collada model, but they did not work as expected.


My hackish attempt to fix it involved flipping handedness on all the nodes individually, instead of just rotating the model, and it worked at the time for my limited application, but clearly it is puking its guts out on these makehuman/blender models.


No idea why it took me so long to think of trying a stock Torque build (doh!), but the idea *finally* occurred to me, and sure enough:


http://opensimearth.com/images/screenshots/blender_dae_t3d_12.jpg


Perfect.


So, anyway, some work to do on my end sorting out whether it's possible to fix my original problem without causing this other problem, but at least the issue is resolved, and nobody but me needs to worry about it. :-) Thanks for all the hand holding anyway!

Link to comment
Share on other sites

It wasn't that, I can get from makehuman to blender using either collada or mhx. (Although I'm sure mhx is preferable.) It was my collada import into Torque code that was causing the current problem, however.


Oops. :-)

 

Ah, interesting. Well, at least you got 'er cracked :)

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.

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.

×
×
  • Create New...