makehumancommunity / mpfb2

MPFB2 is a free and open source human generator for Blender
http://static.makehumancommunity.org/mpfb.html
Other
323 stars 39 forks source link

Help with conversion between metadata (height etc.) into body dimensions <-> FreeCAD sync. #191

Closed LibrEars closed 3 weeks ago

LibrEars commented 5 months ago

Hello,

thank you for all the work with MPFB2! For the open-source CAD software FreeCAD some users and I am brainstorming on how to implement basic human shapes: Human / humanoid body Workbench (makeHuman)

A simple mannequin has been created by martin. We would like to ask for help/guidance on how to proceed from there. In detail: Can someone point us were we can find the translation/conversion factors from the meta data (like height, weight etc.) to actual 3D information (length of the torso, arm etc.)? Or would you recommend a more general approach (re-using of some MPFB2-code)?

joepal1976 commented 5 months ago

This depends a bit on what your end goal is. My guess is you will have a hard time using MPFB code on a different platform than blender. But looking at the logic might be fruitful anyway.

Regarding parameter to 3d result, you'll have to understand the concept of "target". Basically you have the base mesh which is a simple wavefront obj. Then you have morphs with instructions on how to shift vertices. These are very simple things. See for example https://github.com/makehumancommunity/makehuman/blob/master/makehuman/data/targets/nose/nose-flaring-incr.target which is the morph for widening the nostrils. First column is the index of a vertex, next three are an XYZ vector for direction in which the vertex should be shifted.

In very coarse summary, this applies to things like age and height too. Conceptually you have the height increase target applied at 0.0 for base mesh shape and 1.0 for base mesh with vertices shifted to form a very tall person.

This is something that will confuse physics-oriented people: There is no concept of height in the MakeHuman logic. There are only morphs which are applied or not applied. There's no conceptual difference between a morph which widens the nostril and a morph which makes the character taller.

Anyway, the good news is that none of this is application-specific. You can take the target file and the base mesh and combine them relatively easily in whatever application you want.

My suggestion would be to start there. Download the base mesh and a bunch of targets and see if you can build a solution where you can a) display the base mesh and b) interactively morph it using target data. Once that is done, further steps can be taken with for example attaching clothes.

Some of the 3d logic might seem opaque at first, but it's not rocket science once one gets a basic introduction to the reasoning behind it.

joepal1976 commented 5 months ago

Anyway, after having skimmed through the thread too: My comment would be that it seems needlessly cumbersome to start from scratch with a separate character mesh and morph system.

You're free to use the MH assets in whatever way you want. For the protocol, there's a FAQ about this: https://static.makehumancommunity.org/mpfb/faq/build_other_chargen.html

LibrEars commented 5 months ago

thank you very much for the explanations. This is really helpful.

Am I right in the assumption that the base mesh is hm08_config.json (it says "description": "MakeHuman HM08 basemesh")? A reason for a simplified mannequin in FreeCAD is that as a CAD program takes a parametrized approach. I don't know if it is possible to take a mesh with a rig and translate this into a movable mesh objects with joints in the CAD world (mesh with constraints/assembly?).

When looking through the targets I found a folder measure (also described in the MH docs). Since FreeCAD takes a parametrized approach, I think it this were the two worlds (mesh morphs <-> physics/parametrized) are overlapping. So maybe it might be possible to use these for compatibility. Do I understand it right that those measure targets can be used to morph the base mesh in blender? If yes we could use those measure targets as base for the FreeCAD implementation.

I also opened this new feature request

joepal1976 commented 5 months ago

No, that json file is a descriptor, not the base mesh itself.

These are the resources you need:

I'll comment the feature request separately.

joepal1976 commented 3 weeks ago

No more activity for a few months.