makeHuman To Blender To Torque3D Notes

Graphical resources like models and images.
3 posts Page 1 of 1
Steve_Yorkshire
Posts: 336
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Sat May 16, 2020 6:38 pm
Just a few notes on using makeHuman, getting the model into Blender3D (2.82a) so that you can export it out to Torque3D.

makeHuman is very useful for creating a base humanoid mesh and more importantly ---- avoiding the utter horrors of weight painting armpits and shoulders, I can never seem to get a decent deformation in this area so having it automated is a relief.

Firstly, export from makeHuman as a Collada file - but even before that - make certain that "smooth" is turned off, or your mesh will export with a subsurf and be >100K tris. With smooth off it's a more manageable 26K tris for the main body with eyes, teeth and tongue meshes being seperate. You may also want to choose an skeleton without all the boens for toes, there are various armatures to select. As my character is female, I chose the "Unity with boobs and butts", which is the default game engine skeleton with additional boobs and butt bones featuring a simplified single toe bone for each foot.

Now to import that Collada file into Blender. If you do not choose any option for the import then you will find a lot of very tiny bones, none of them linked together. This means that selection and manipulation becomes almost impossible.

Image1: Tiny Bones.
Image

To prevent this open up the dropdown menu for options in the import dialogue (the cog symbol top right) and select all the armature options and bind info. Now when it imports the model most (but not all bones) will be large, connected to their neighbours and easy to select and manupulate for animations.

Image2: Import Options.
Image

Image3 Big Bones.
Image

Now not all bones have resized, and you'll notice things like eyes, eyelids (and boobs and butts) are still tiny, and finger tips occupy the same space as mid-finger bones. The easiest way to resize or move hard to select bones is to select them via the object properties list. Select the armature, choose "edit mode" in the "3D Viewport". From the properties editor, select the bone on the armature before returning to the 3D Viewport and extruding a new bone. One large enough, select teh whole of this bone, and use it as a helper to drag the end (known as the tail) of the original bone out to a new position, thus making the whole of the bone larger - and thus easier for selection and animation. After the original bone has been enlarged and repositioned, you can delete the helper bone which you have just created.

Image4: Helper Bones.
Image

Once all your bones are easily viewable and selectable we need to rename some. Torque likes to use the "Bip_01 Bone" system from 3DS Max especially for recoil animations. So rename the spinal bones as such using underscores for spaces or the named bone will not export correctly to Torque from Blender:
hips - Bip01_Pelvis
spine - Bip01_Spine
chest - Bip01_Spine2
neck - Bip_01_Neck
head - Bip01_Head

Now the main problem with your new base model ... is that it's pointing the wrong way. The easiest solution is to select the armature and rotate it 180 degrees from above. However, if you are sharing animations between models in-game, there may be some rotation issues if the animations were exported from a model with different rotations. Just to be on the safe side, let's make the armature and all meshes stem from rotation 0,0,0.

Now you'll notice that the default rotation is x 90, y 0, z 0. We want that to read 0,0,0 - but we need to change it via -90,0,180 to point the correct way for Torque.

{EDIT}
Note; if in makeHuman you export the Collada file with orientation Z up Face -Y, the imported armature will be facing the wrong way but x will be 0 and not 90. So this will save you at least one rotation alteration for the armature and meshes.

Make a copy of the armature and any meshes - You can do this by duplicating the collection - and rotate this new armature to face the correct direction. We will use this copy to help realign our working mesh and armature.

Back to the working objects. On the armature set the rotations to 0,0,0. Afterwards, unparent the working meshes from the armature (or this will cause animation issues later) using ALT P "clear and keep transformation" (or else you will have a scaling issue), and disable the armature modifier by selecting no object under modifiers->armature for each mesh object. Now select the armature and go into edit mode, select all bones and move and rotate them until they overlap your copy armature. Do this the same with each of the meshes.

Image5: Unrotated Objects and Rotated Helper Objects.
Image

Image6: Correctly Facing Objects At 0,0,0.
Image

Make certain that your mesh and armature are central using the blue Z axis line in the 3D viewport. Use the crotch of the mesh for this, and the head (base) of the "hips" bone. Now you will notice that the upper body is not perfectly aligned for either the armature or the body mesh. Now change the armature modifier back to the original armature object for each of the mesh objects. After this you may want to fix the slight kink in the upper body - especially if you are going to use the mirror modifier for creating clothes later, as it will look slightly out the higher up the model you go.

Image7: One Degree Spinal Changes - spot the difference!
Image

Make certain the armature is set to "pose position" and not "rest position". Select the armature and in "Pose Mode", rotate bone Bip01_Spine1 one degree clockwise (facing the front of the model). Now rotate bone Bip01_Spine2 one degree anticlockwise to straighten the shoulders. Back to Object mode and select the meshes and apply the armature modifier for each mesh. This will lock the mesh in that pose and remove the armature link. Back to the armature and in "pose mode" click the pose tab for the drop down and select "Apply Pose As Rest Pose" so that the armature will now default to this position.

Image8: Default to the new pose.
Image

Hurray. Just a few more things.

Finally you have all your objects at rotation 0,0,0 and facing the correct way for Torque. You may want to delete the extra meshes like tongue and teeth, incorporate the eyes into the base body mesh. The base body mesh could then also lose some extra polys such as the inside of the mouth and eyes - sewing up the lips so to speak, as not all character player models will need these things.

One final thing you may wish to do is to create a T-Pose. Go into armature "pose mode" and move the following bones, remembering that a positive move on one side of the skeleton is a negative number on the other.

shoulder(left/right) z 10 y 0
upper_arm(left/right) z 35 y 0
foreArm(left/right) z 5 y 35

Now for each mesh apply the armature modifier to set the pose and unlink it. Finally set the pose as the rest pose, and then readd the armature modifier to each mesh.

Image 9: Finished in Blender (with base01->start01 empty node heirarchy for export)
Image

And that should set you up for a perfectly workable character model that can be added to and modified to be a unique player character, exported out the usual way. Infact if you simplify the mesh by sealing the mouth and eyes to the main body mesh the tris count will drop from ~26.7K to ~23.5K. Now simplify the feet to turn the toes into a solid block you can save a further 2K tris immediately, bringing the total to ~21K. Now you can add all the extra Torque necessary nodes like mount0, mount1, catEar_left, catEar_right, etc ...

{EDIT}
Oh and the last thing the armature scale defaults to 0.1 which should be the correct scale for the stock Torque3D player character.

Image10: Exported into Torque3D using the classic base01->start01 empty node heirarchy, and forcing the import scale to 1, as it seems to default to 1000 which is huge!
Image

Cat-ears not included ...
Last edited by Steve_Yorkshire on Wed May 20, 2020 4:50 pm, edited 7 times in total.
Duion
Posts: 1583
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sat May 16, 2020 8:21 pm
I did not name my bones Bip01 etc and everything still worked fine and I have never seen that recoil system that supposedly uses them.

Regarding rotating the exported model, I made a ticket long time ago on their project to export it facing the positive y axis or what it was and it seems they still did not implement it, maybe you can make a request too and everyone else who reads this, at some point they may implement T3D export.
Steve_Yorkshire
Posts: 336
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Mon May 25, 2020 3:31 pm
Just to note; after more faffing around in Blender I discovered that you can actually "apply all transforms" via the object and it will automagically set it's position, rotation and scale to default, once you have rotated and repositioned the armature to your liking, with just the click of a button (and the same for each mesh) - thus saving all the faffing around of manual rotations.

Image

You can also export a T-Pose straight from makeHuman under their "Pose tab", but you will still have to make the 1 degree change midway up the spine to get the armature perfectly straight.
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest