MPFB2 - create human without helper geometry

Discussions about MakeHuman, Blender and MPFB. It is ok to ask for general Blender support here, even if it isn't directly related to MakeHuman

Re: MPFB2 - create human without helper geometry

Postby joepal » Wed Dec 21, 2022 8:17 pm

marvisb wrote:What if I wanted to keep the shapekeys though?


This sounds like something that is extremely cumbersome to do manually, but which shouldn't be all that hard to script.

No promises on timeline, but I've added this as a feature request at https://github.com/makehumancommunity/mpfb2/issues/72. You can add any additional input on what would be needed there, if you want.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB2 - create human without helper geometry

Postby tomcat » Thu Dec 22, 2022 6:26 pm

joepal wrote:
marvisb wrote:What if I wanted to keep the shapekeys though?


This sounds like something that is extremely cumbersome to do manually, but which shouldn't be all that hard to script.


In fact, it turns out to be the basis of the character generator in the game engine. And manually transferring the form keys is really very difficult. If this is implemented, that's just wonderful!
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 336
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: MPFB2 - create human without helper geometry

Postby joepal » Fri Dec 23, 2022 12:35 pm

There's now a preliminary implementation for keeping shape keys after deleting helpers: https://github.com/makehumancommunity/mpfb2/issues/72

To test, simply model a character as you would normally do. Then as a last step before export, go to operations -> basemesh and click "delete helpers". Helpers should then be removed, but all shape keys should have been recreated to fit the new mesh.

I will not be surprised if you run into strange crashes if you then try to continue working with the character in blender. For example, any asset loading or model refitting will probably crash horribly. But the export should be much cleaner.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB2 - create human without helper geometry

Postby marvisb » Thu Dec 29, 2022 12:31 am

Hey there, I tested this and it works!

Using this method, I was able to import and retarget a character with many morph targets in Unreal Engine 5.

Some things I noticed --
After using the delete helpers feature, there are remains of what I suspect is eyelash helper geometry. They are missing some faces. I was going to use them anyway so I don't consider this a problem.
After deleting helpers, I can continue to use most of the model parameters / add more shapekeys. This is actually a pleasant surprise.
There's some other situation related to the "phenotype" settings -- sometimes 3 or 4 shapekeys are added which distort the character. I deal with this by deleting them when they appear. I don't think this is specifically related to the 'delete helpers' feature, I had it before too.

Anyway thank you, this is amazingly helpful.
marvisb
 
Posts: 10
Joined: Tue Dec 20, 2022 11:24 pm

Re: MPFB2 - create human without helper geometry

Postby joepal » Fri Dec 30, 2022 2:01 pm

Thanks for the report. Yes, many morphs work surprisingly well even without helpers. However, you won't be able to refit most clothes after the delete. This might not be a problem if you, for example, only change details around the mouth. However, changing things like the height of the character will probably mess up most attached assets.

I will be very interested in hearing more details about the phenotype issue. This was new to me. Maybe you can capture a screenshot next time it happens?

I'm curious about the eyelash helper too. Maybe the vertex group spec for that particular helper is faulty somehow.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB2 - create human without helper geometry

Postby marvisb » Fri Dec 30, 2022 10:22 pm

Okay, I can easily reproduce the issue -- here are some pictures.

https://imgur.com/a/qzizOv4

The problem is basically duplicate phenotype shapekeys are added whenever a single phenotype value is adjusted. These duplicates warp the mesh, but it is solved by deleting the extras.

This particular character mesh is imported from MakeHuman not made from scratch in MPFB, not sure how relevant that is.

I have encountered something with the eyes as well -- morphing the area around the eyes works beautifully, but the actual eyeballs remain in the default position. This becomes a problem when the eye apertures are translated up, down, or to either side. This is probably some mistake I made, however, or something I need to compensate for within Unreal Engine.

Currently I have no morphs for alteration of the character height, or alteration of the length of limbs or any other 'length' body proportions, because that would cause problems within the game engine that I don't want to deal with at the moment. It would be nice, however I need to figure out how to maintain the proportion of the character mesh with the skeleton.

So, about the clothes. What I was going to do is export the base character mesh and use that as an 'avatar' in Marvelous Designer, which is what I use to create clothes. I haven't really used MakeClothes before and am not aware of its capabilities, but perhaps I need it. Obviously the clothes will have the same skeleton as the character, which I can do by exporting from MD, importing to blender, copy the skeleton and parent the clothes to it, and weight them, or something like that, I have done this before a few years ago.

I was thinking/hoping there was some way to copy the morph targets from the character mesh to the clothing, but now that I am working on it, I'm not so sure it's possible to do it that way. My understanding is shape keys / morph targets need the same vertex count (or topology), and obviously this is not the case with the clothes. Perhaps this is where MPFB clothing features comes in, but currently I have no idea how to integrate that with Marvelous Designer.

The eyelashes is a bit of a puzzle to me. the UV of the eyelashes seem to correspond to a spot in the upper-right corner of the body texture, which for me is empty. I do, however, have a separate eyelash texture from MakeHuman. They should be a separate material than the skin because they need transparency and do not need the features of my skin material, which has cumulative layers for dirt etc. However for my purposes eyelashes are a small concern -- that is a very small detail in the perspective of my project, where the camera through which the models are viewed is at a significant distance.
Actually, the character in MakeHuman does not have eyelashes. So that is why they are missing and only the helpers are left. Ah. I will have to redo some steps.

At some point I am going to have to add more bones. I have been using the community asset "UEngine" rig with default pose and that has worked for basic animation retargeting. But I would like some extra bones that aren't in the UEngine skeleton. I can probably add them myself but that will come later, right now I have to figure out how I am going to handle the clothing.
I initially tried to retarget the default MakeHuman skeleton because it has a nice supply of bones, but I had trouble. There is not a single "pelvis" bone but rather two, and this complicates retargeting. Also the character root was not on the ground etc. These I can fix myself with some more research.

I made a rudimentary editor utility in Unreal to copy all the morph targets from the base skeletal mesh into a data table, and also copy them from that list to a stuct attached to each instance of the mesh. This struct is then individual to each instance of the mesh and can be independently modified, then applied. I am still working out the best way to handle it all but this works so far, which is excellent!

Sorry if some of this is too off-topic

I should clarify that I am by no means an expert at rigging, character animation, or anything, so some of my issues may just be due to my own incompetence...
marvisb
 
Posts: 10
Joined: Tue Dec 20, 2022 11:24 pm

Re: MPFB2 - create human without helper geometry

Postby tomcat » Fri Dec 30, 2022 11:25 pm

marvisb wrote:I have encountered something with the eyes as well -- morphing the area around the eyes works beautifully, but the actual eyeballs remain in the default position.



That's the way it's supposed to be. Transformation is applied to body parts separately. For example, in this screenshot:

Image

the "Mouth Open" transformation is applied to the meshes: 1). body (head); 2). teeth and 3). tongue.
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 336
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: MPFB2 - create human without helper geometry

Postby joepal » Sun Jan 01, 2023 4:15 pm

marvisb wrote:This particular character mesh is imported from MakeHuman not made from scratch in MPFB, not sure how relevant that is.


Yeah, that explains it. If you create a new human "from makehuman", you don't get the modifier information, only a baked mesh. If you instead do "from presets" -> "load MHM", you'll get the relevant modifier info, and it will be as if you created from scratch.

So this is a known deficit, but there should probably be a big visible warning if you try to model on a "from makehuman" character.

marvisb wrote:I have encountered something with the eyes as well -- morphing the area around the eyes works beautifully, but the actual eyeballs remain in the default position. This becomes a problem when the eye apertures are translated up, down, or to either side. This is probably some mistake I made, however, or something I need to compensate for within Unreal Engine.


Unfortunately, the eyes are not a part of the base mesh. They are a clothes type mesh which is fitted to the clothes helpers. If you toggle the "hide helpers" mask modifier in blender, you'll see that there are helper orbs in the eye sockets.

So if you delete the helpers, the eyes can no longer be fitted.

As a workaround, you could create a separate eyes clothing item and fit it to the eye sockets instead of the helper orbs. The downside is that this will prevent the eyes from being posable in the normal way, but maybe that is acceptable.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB2 - create human without helper geometry

Postby Skalli » Wed Jan 04, 2023 2:39 pm

I'm currently working on a prototype for a game and played around with MPFB2 too, I'm happy with the workflow, but same issue with exporting to the game engine and shape keys happened. For reference, I'm using Godot and currently the nightly build from December 2nd.
I'm not entirely sure if the problem stems from Blender export or the plug-in itself.
I have a sub division modifier on the model and use another topology (namely the Adult Female 2020 v1).
The thing is, if I export (I use GLTF 2.0 as it is the least problematic overall and supports pretty much all features I need) the Shape Keys go missing.
I have tried deleting the Helpers as mentioned in this thread. I could track my problem down to Sub Division modifiers. Removing them made the shape keys not all disapear. I wanted to mention this just if someone else runs into the same problem.
The relevant part:
Removing helpers cause both meshes to be exported properly, but the used topology doesn't have the shape keys. The Human model does, but that's not much helpful.

A small workaround was to set the wanted shape, duplicate the Adult Female object, unparent it, and the undo the transformation. Then I can use the duplicate to create the wanted shape key.
This can be done with helpers active.
A more detailed description:
The base setup looks like this:
OverviewBlender.png

The 'adult female' is the body that gets exported.
I set the shape change that I want, e.g. with pregnant belly by setting 'stomach-pregnant-decr-incr' to 1 and duplicate the object. The it's important to unparent it, otherwise the next changes will still be applied to this duplicate.
After creating the duplicate I undo the last change, e.g. set 'stomach-pregnant-decr-incr' to 0 again.
Now on the original I can create the shape key from the duplicated object with the pregnant belly.
If I export now, the shape key is still there and in Godot I can set the pregnancy value anything between 0 and 1 and get plausible results.
ResultGodot.png

The downside of this method is, that it has to be done for every shape key one want available in the game, which can be tedious with many shape keys, e.g. for a character creator. For smaller changes with a specific purpose it's viable though.

I will still try to figure out how best to get the subdivision modifiers in there. I saw a script for applying it with shape keys, which would make the total result smoother, but haven't tested it.
I hope this helps someone.
Skalli
 
Posts: 1
Joined: Wed Jan 04, 2023 12:22 pm
Location: Germany

Re: MPFB2 - create human without helper geometry

Postby joepal » Wed Jan 04, 2023 2:58 pm

I don't think it was ever intended that child meshes such as proxies and clothes would have shape keys. Their shapes are interpolated from the end result of the base mesh after shape keys, so they do not need shape keys of their own.

This said, there is some support for proxy specific targets. That is, shape keys that are specifically written for a topology or a piece of clothes. These would need to be manufactured though, as there is no pre-existing setup for topologies.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

PreviousNext

Return to Blender and MPFB

Who is online

Users browsing this forum: No registered users and 1 guest

cron