Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
LibrEars opened this issue Jun 4, 2024 · 5 comments
Labels
Support request - answered Issues that are requests for support rather than bug reports support request Need help with something which isn't a bug

Comments

@LibrEars
Copy link

LibrEars commented Jun 4, 2024

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)?

@LibrEars LibrEars added the support request Need help with something which isn't a bug label Jun 4, 2024
@LibrEars LibrEars changed the title Help weith conversion between metadata (height etc.) into body dimensions <-> FreeCAD sync. Help with conversion between metadata (height etc.) into body dimensions <-> FreeCAD sync. Jun 4, 2024
@joepal1976
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Author

LibrEars commented Jun 6, 2024

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
Copy link
Contributor

joepal1976 commented Jun 7, 2024

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 joepal1976 added the Support request - answered Issues that are requests for support rather than bug reports label Jun 16, 2024
@joepal1976
Copy link
Contributor

No more activity for a few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support request - answered Issues that are requests for support rather than bug reports support request Need help with something which isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants