makehumancommunity / mpfb2

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

gltf looks strange when using default materials #202

Closed theBSH closed 1 week ago

theBSH commented 3 months ago

Describe the bug the human does not export or its just broken. bks most of the materials in mpfb are not simple image textures i cant use fbx and the only format witch supports materials is gltf and as you can see its broken or there is no support for it.

Screenshots / logs what it is : Screenshot 2024-07-14 140731 the export: Screenshot 2024-07-14 140831

Platform and versions

joepal1976 commented 3 months ago

There are two parts of this problem: Materials and helper geometry.

For the materials: In order to work in exports to external applications, there is the new "game engine" material which does not contain any procedural aspects. You can enable this under apply assets -> library settings before loading assets or materials. Or if you already have a character, you can set material overrides when loading it from a preset.

You need a recent nightly build in order to use the game engine material.

For the helper geometry, it does not make sense to keep this in an export. It is only there for fitting clothes. Same goes for shape keys. You can bake shape keys and remove the helper geometry under operations -> base mesh.

theBSH commented 3 months ago

Or if you already have a character, you can set material overrides when loading it from a preset.

im new to this where is this option ?

joepal1976 commented 3 months ago

Take a look at the screenshots under the section about the game engine material here:

https://static.makehumancommunity.org/mpfb/releases/release_20b1.html

There should be images of both relevant panels.

Let me know if you run into trouble with it.

AdamDoesThingsSometimes commented 3 months ago

Hi :) I am experiencing what looks to be the same issue as theBSH with importing GLTF files into the Godot Engine. Things appear to export perfectly with FBX, but not GLB files; I've taken a screenshot in Godot for comparison after exporting both FBX (left) and GLTF (right):

image

It might be useful to note I'm experiencing similar effects when importing both of the exported formats back into blender (FBX: left, GLTF: Right, Back: The original human pre-export)

image

From the screenshots on the release section, it appears I'm using the GameEngine PBR materials, and they work great with FBX. I might be being daft, but my Operations/Basemesh menu has no entries when I open the dropdown:

image

As FBX works great for my use case, I am happy to keep on going with that format, but I thought it might be a nice thing to report a similar experience with GLTF files, in case it's useful for anyone looking into this.

P.S. Thank you for making such a brilliantly useful (and fun!) program/plugin, I'm enjoying using it, and hope to have humans running about in my game before long! :)

PPS: Forgot to include minor information like what version I'm using, sorry, that might be useful lol!

System information says: Build info:20240715 Blender Version (4, 1, 1) Python Version (3, 11, 7)

And I'm importing using what I hope is the latest Godot Stable release (4.2.2) :)

joepal1976 commented 3 months ago

@AdamDoesThingsSometimes : Can you post a screenshot where you have a basemesh selected (ie not a rig or a proxy, but specifically the basemesh) and the operations->basemesh menu expanded?

AdamDoesThingsSometimes commented 3 months ago

@AdamDoesThingsSometimes : Can you post a screenshot where you have a basemesh selected (ie not a rig or a proxy, but specifically the basemesh) and the operations->basemesh menu expanded?

Hi :) I can indeed, I've just had a strange thing where blender "forgot" MakeHuman after it updated, and I now can see the operations/basemesh options in the UI. Of course, there's every chance I was being daft and simply didn't have a basemesh selected!

image

In case it's helpful, I baked the shape keys and removed the helper geometry. It's imported far better this time, now that I've followed your previous notes fully. :)

I'm thinking that the extra step was (suprisingly) to have the basemesh selected while... operating on... the basemesh! I'm kicking myself for not noticing that until now! The menu looks the same as before without one selected, so I chalk this down to user incompetence on my part! :)

I can happily confirm the basemesh operations solved a lot of the issues. For comparison in Godot, the left one is GLTF and the right is FBX.

The FBX appears to have clothes without skin poking through, but the GLTF has the materials set more accurately. :) There's likely a setting or a tweak I can try - maybe it's time to dive into blender itself and fine-tune the mesh.

image

Thank you for your help pointing to what was wrong with my setup. :)

joepal1976 commented 3 months ago

The skin poking through is likely easy to fix. For the base mesh there is a "mask" modifier hiding vertices belonging to a delete group. Apparently FBX takes this into account when exporting, but for gltf you might have to "apply" it in the modifier list before doing the export.

This is a destructive operation where vertices will be actually removed, but that will at least make it certain that they're not visible after export.

AdamDoesThingsSometimes commented 3 months ago

Thank you so much for this, I now have perfectly imported GLTF characters in Godot! :)

Applying the modifiers was exactly what was needed, and as a novice, I feel I just learned something new about Blender/3D art on the way.

I can't thank you enough for taking the time and having the patience to help a muppet who misguidedly tried to help with an issue, and wound up with a case of pure-user error on my part. :)

By way of thanks, I've just subbed to the patreon (and plan to up the amount once I have the amount spare each month!), and will look to help with any tests or anything like that which I feel able to.

joepal1976 commented 3 months ago

I can't thank you enough for taking the time and having the patience to help a muppet who misguidedly tried to help with an issue, and wound up with a case of pure-user error on my part. :)

Actually, this kind of feedback is invaluable too, as it indicates a UX problem. The idea is that the user interface should be reasonably intuitive. If users don't understand why a panel is empty, then that is a real issue too.

Currently, user interface testing and feedback is pretty high up on the list of what is needed in the project.