Can I create custom skeleton

This forum is aimed at user contributions, in the form of assets, side projects, code patches and similar.

Moderator: joepal

Can I create custom skeleton

Postby AqP » Wed Nov 13, 2013 3:35 pm

I'm new to Makehuman and I'd like to create a custom skeleton for my platform, so that it's available as one of the options within Makehuman. Is this something I can do either as a user or as a developer?
AqP
 
Posts: 19
Joined: Wed Nov 13, 2013 3:29 pm

Re: Can I create custom skeleton

Postby duststorm » Wed Nov 13, 2013 5:47 pm

By programming it you can achieve anything. But I'm not sure whether there is an easy data-based approach. Thomas is the one who designed it, he will know more.

If you want to include a custom skeleton in a pipeline, you can also write a script in your target DCC tool (for example a python script when you are using blender) which adds your custom rig to the human. You can define the bones and vertex weights in a file and apply them. This is possible because you can exploit the fact that the human always has the same vertex indices.
A tool like blender even has a tool built-in to copy vertex weights from one mesh to the other based on vertex index, which allows very easy transfer of a rig without the need for writing a plugin. So you could define your own rig on a human model in blender, and then transfer it to any other human you export from MH with a few clicks.
See this post for more details: viewtopic.php?p=21209#p21209
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Can I create custom skeleton

Postby ThomasL » Thu Nov 14, 2013 3:42 am

If all you want to do is to rename the bones and perhaps merge some of the vertexgroups together, then yes, it is rather easy. The skeletons are defined by the json files in the data/rigs directory. If you look at some of the files there, you should be able to figure out how it work. Note that json files are rather picky about commas at the end of lines.

Unfortunately, you must also program a button in the Skeletons tab. Open plugins/3_libraries_skeleton/skeletonlibrary.py, copy the code for one of the buttons (around line 200), and modify the button to load your own rig.

Note to Jonas: The skeleton buttons should of course be created automatically. Can the code for proxy choosing be reused?

OTOH, if you want to define a new skeleton from scratch, with a completely new set of bones and vertex weights, then the answer is new. There is only one basic rig (or two, if you count the muscles rig as a separate rig), and all other rigs are derived from the basis.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Can I create custom skeleton

Postby duststorm » Thu Nov 14, 2013 10:51 am

We're working on it. For the status see the issue tracker. Since revision r6436 MH will show all .json files in data/rigs in the skeleton chooser.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Can I create custom skeleton

Postby AqP » Thu Nov 14, 2013 6:59 pm

Thanks both, this looks like it will work for me.
AqP
 
Posts: 19
Joined: Wed Nov 13, 2013 3:29 pm

Re: Can I create custom skeleton

Postby AqP » Fri Nov 15, 2013 8:36 pm

I created a new JSON file for the skeleton I need and also the new button. So far so good.

Now however I have a different hierarchy than required. I'd appreciate any suggestions for how to get around this. Ignore the names of the root and spine bones.

What I want:

Root
__ Pelvis
__ __ Spine
__ __ __ Spine 1
__ __ __ __ L thigh -> left leg
__ __ __ __ R thigh -> right leg
__ __ __ __ Spine 2
__ __ __ __ __ Neck
__ __ __ __ __ __ Head
__ __ __ __ __ __ L Clavicle -> left arm
__ __ __ __ __ __ R Clavicle -> right arm

What I get from the Makehuman skeleton merged by my JSON file

Root
__ L thigh
__ R thigh
__ Pelvis
__ __ Spine
__ __ __ Spine 1
__ __ __ __ Spine 2
__ __ __ __ __ L Clavicle -> left arm (all ok from here on)
__ __ __ __ __ R Clavicle -> right arm (all ok from here on)
__ __ __ __ __ Neck -> Head

2 issues - legs should be 4 levels down from root instead of one level down; clavicles (shoulders) should be one level lower, children of neck instead of siblings of neck.
AqP
 
Posts: 19
Joined: Wed Nov 13, 2013 3:29 pm

Re: Can I create custom skeleton

Postby ThomasL » Tue Nov 19, 2013 7:36 pm

There is no easy way to change the hierarchy. You can equip the rig with a reverse hip by setting useReverseHip to true (cf data/mhx/advanced.json), but that's about it. There is no way to parent the thighs to the third bone in the spine in MH. You have to import the rigged character into Blender or some other app, and reparent the bones there.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Can I create custom skeleton

Postby AqP » Tue Nov 19, 2013 9:09 pm

Thanks Thomas, I have tried reparenting in Blender and the result is that while I can now import the character, it gets deformed when animated. I put this down to 2 factors:

1) after creating my 43 bone skeleton JSON file, which I expected to merge the vertex groups for the merged bones, I am getting unweighted vertices all over the character, creating spikes coming out of it. Examples
- the cheek area of the character's face is not weighted to anything;
- vertices in the fingers end up not weighted to either remaining finger bone.

2) bad rotations in the skeleton's root bone can make the character distort when animated. This generally causes long deformed limbs rather than spikes.

So perhaps I should give up on this and use my existing rig for the character. But I need a T pose rather than an A pose. I'm still using r6419 as it's the latest Mac nightly build.
AqP
 
Posts: 19
Joined: Wed Nov 13, 2013 3:29 pm

Re: Can I create custom skeleton

Postby duststorm » Wed Nov 20, 2013 12:36 am

You can use the rigging of MH and just change the hierarchy of the bones in blender. As long as you assign sensible joint locations to your bones that should work fine. Perhaps use a simple rig without hidden bones so you can't be surprised by hidden magic features.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium


Return to User contributions

Who is online

Users browsing this forum: No registered users and 1 guest