Page 2 of 4

Re: How can I mark the body part in makehuman?

PostPosted: Wed Jul 28, 2021 5:16 pm
by loki1950
Animations work because of the bones in the defined skeleton marking a place on the mesh(body) does not change effect that skeleton has on the body. BTW each joint of the skeleton can have constraints that define possible movement ranges. So bottom line the mark on the body will follow the animation that is what the weight file defines,it's easier to think of it as a series of layers that work as one object.

Enjoy the Choice :)

Re: How can I mark the body part in makehuman?

PostPosted: Thu Jul 29, 2021 8:00 am
by makehuman987
Thanks a lot. Your answer totally dispels my worries, I think I can follow you two's answers and try to use makehuman and Blender combinationally. Thanks again.

Re: How can I mark the body part in makehuman?

PostPosted: Thu Jul 29, 2021 6:54 pm
by punkduck
Hi

Okay, for blender:

Each 3d point (vertex) can be put into different vertex groups. These groups are just a bunch of vertices with a feature or even simpler: a float value between 0 and 1 is assigned. This value could be a weight (to be influenced by bones), a region, where hair should grow, a collision zone for cloth etc. It is just a group, so you can use it for everything.

One example from our tutorial, the yellow selected vertices are groups to influence the clothes to follow the skin or helper:

http://www.makehumancommunity.org/wiki/Documentation:MakeClothes_Vertex-Groups

What you should do: work with a standard body to assign groups the fist time, when you use a skeleton it has already groups, so best to work with the obj itself in your case (and keep vertex order! the blender importer gives you different options)

After importing: first create a vertex-group. Then select vertices in edit mode (Blender has a lot of modes to select vertices, you need to learn this and decide for the best. Otherwise it does not make much sense), then assign a value. In your case it would be bool (hand = yes or no), use 1.0 which is also the default from blender if you do not change it. You need as many groups as you have different parts you need to remember.

I wrote a tool to export weights for a skeleton. But it would also export weights or groups for everything else. This tool (plugin) you need to install.

Blender has a folder inside called scrips/addons. Create a further folder inside addons (like mh_extras) and put all files from

https://github.com/black-punkduck/MakeHuman-Helpers/tree/master/blender2_8/makehuman_extras

inside this folder. In preferences you need to activate the plugin, which will appear because of the __init__,py file.

After being activated, it will be visible when you press N.

The plugin is mostly designed for symmetry purposes. But an export method for the weights (= vertex groups) is also given, scroll down to "Exporting Weights" in the tutorial on github:

https://github.com/black-punkduck/MakeHuman-Helpers/wiki/blender279weightplugin.md

Do not wonder: 2.8 means newer versions than 2.80, so this tool also should work for the newest version, ... 2.79 was before that. The documentation I changed a little but the name I did not change.

Last not least: this is the example of the weights file (it is a new version ... and better readable then the file of the current version).

https://github.com/makehumancommunity/makehuman/blob/master/makehuman/data/rigs/default_weights.mhw

You can see the different groups like breast.L and then each vertex number + a float value. In your case it would be e.g. hand.L for left hand and then vertex-numbers and always a 1.0 ...

Because of this example you can decide if that may fit your purposes.

Just a hint: be aware, Blender is not the easiest program, when I started, I used the word "wtf" quite often :)

Greetings
Punkduck

Re: How can I mark the body part in makehuman?

PostPosted: Thu Aug 26, 2021 2:52 am
by makehuman987
Hi, dear punkduck:
Sorry for a long separation from this project for some reason, now I've come back to this medical project. I saw in your example .mhw file you used the "group" such as breast-L, clavicle and so on, and each vertex has a weight in different groups. I was wondering why you choose these parts as groups. In my situation, I need to mark 39 parts in the body, as shown in the attachment. your reply mentioned "as many groups as you have the body parts" , does that mean I need to create 39 groups ? And if it's so, how can I decide which vertices belong to which groups?
My origin thought is to export the character finished in makehuman to blender with weights and group partition completed, thus the next step is to mark in the blender.
A long separation may make me unfamiliar with makehuman and out of the discussion before, so any comments and instructions are welcome and I will take a try.

Thanks again.

Re: How can I mark the body part in makehuman?

PostPosted: Fri Aug 27, 2021 5:44 am
by joepal
If your end goal is blender, it is possible you will have an easier ride if you go for setting up body part selections in MPFB rather than in MakeHuman.

In MPFB2, you can define extra vertex groups here: https://github.com/makehumancommunity/m ... _groups.py

For example, you could add a new entry on line 16:

Code: Select all
vertex_group_information["basemesh"]["noseTip"] = [5052, 5054, 11670, 296, 297, 7063, 301, 302, 7067]


The indices of the verts can be found by checking the "indices" checkbox:

show_verts.png


The next time you import a model from MH or create a new model directly in MPFB2, you'd have a vertex group "noseTip" containing these vertices.

In this file you can also specify vertex groups for any proxy you intend to use.

Re: How can I mark the body part in makehuman?

PostPosted: Mon Aug 30, 2021 2:30 am
by makehuman987
hi, joepal:
Thanks for your reply. I saw the .py file, I would like to know why you choose [5052, 5054, 11670, 296, 297, 7063, 301, 302, 7067] as verts of nose? Is this a default way in makehuman? Furthermore, how did you decide the weights for vertices in different groups?
I just want to mark on the body thus I would like not to choose verts for groups on my own . I think the vertices you chosen for different groups are just used to compute the deformation relationship between meshes and bones, but the markers are just labels which should have nothing to do with this deformation.

Re: How can I mark the body part in makehuman?

PostPosted: Tue Aug 31, 2021 5:36 am
by joepal
The vertex order is fixed, meaning vertex 297 is always the tip of the nose.

The reason the verts are where they are is because that is where they ended up when designing the model. That design process was an artistic endeavour where the focus was to produce a realistic graphical output. The focus was not to enable selection of body parts by index ranges.

The same can be said about weight painting. The goal with weight painting is to coordinate deformations, not to enable structured selection of vertices.

A vertex can belong to multiple weight paint groups, because that is the fundamental function of weight painting: a vertex on the border between neck and clavicle can be, for example, 50% influenced by a neck movement and 50% influenced by a shoulder movement.

https://docs.blender.org/manual/en/late ... ction.html

Re: How can I mark the body part in makehuman?

PostPosted: Tue Aug 31, 2021 11:26 am
by makehuman987
Hi, dear joepal:
yes, you are right " why the verts are there ", I was just wondering there were much more than 9 meshes around the nose(for example about 20 meshes), just as your pic show, why these ​9 verts are chosen in the nose group instead of other verts? There must be some principles for which verts are chosen for a group and which not, because these verts are all around the group and why some of them are so lucky?
​Forgive me for focusing on this question. Since there are some groups specified in makehuman, while I have 39 groups to be specified(as the pic I show), So I have to know which verts belongs to certain group, for example, part 14(the left arm shown in the picture).

Re: How can I mark the body part in makehuman?

PostPosted: Tue Aug 31, 2021 3:44 pm
by joepal
The image was an illustration on how to select vertices in blender and get to know their indices. There is no predefined group for the nose.

You would have to do this or use an equivalent method for each group you want to define, since you need to list the indices.

Re: How can I mark the body part in makehuman?

PostPosted: Wed Sep 01, 2021 2:20 am
by makehuman987
Thanks a lot, joepal.
I think that would be a tough task, :cry: Could you kindly give me some guidelines or advices? That would be of great help.
Thanks again.