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

MPFB2 needs a PBR material which translates to external game engines (since the MakeSkin model does not) #138

Closed
Miracle8248 opened this issue Aug 31, 2023 · 12 comments
Assignees
Labels
bug Something isn't working fix exists - testing needed
Milestone

Comments

@Miracle8248
Copy link

Actually I want to export my model rigged and textured so that I can use that in any software but when i export from blender and upload it into blender I see there are no textures so how can I get textures in my fbx files even i export with textures

@Miracle8248 Miracle8248 added the support request Need help with something which isn't a bug label Aug 31, 2023
@joepal1976
Copy link
Contributor

joepal1976 commented Aug 31, 2023

As said, how Blender handles FBX exports is something MPFB has somewhat limited control over. The same goes for how external applications then handles the FBX exports.

This said, it is obvously problematic that Blender cannot export a rather simple material and then read it back. I have no good solution for this right now. Maybe there is something which could be done with how materials are defined. I will have to research this.

In the meantime, there is an instruction video for Unity where a procedure for getting around the issue is demonstrated (explicitly listing the materials in unity after import). Maybe that can be of some help: https://youtu.be/YypDcUpON8A?si=YCxHg9sc3KN1WoQR

I'll convert the current issue into a bug report for investigating what can be done (if anything) about FBX exports.

@joepal1976 joepal1976 changed the title Help me Blender cannot export even a simple diffuse/normalmap MakeSkin material to FBX and then read it back Aug 31, 2023
@joepal1976 joepal1976 added bug Something isn't working and removed support request Need help with something which isn't a bug labels Aug 31, 2023
@joepal1976 joepal1976 self-assigned this Aug 31, 2023
@Miracle8248
Copy link
Author

Ok thanks i hope problem will solved

@Miracle8248
Copy link
Author

Miracle8248 commented Sep 5, 2023

And one more problem there are no textures I'm unreal engine 5 too which exported from blender

@joepal1976
Copy link
Contributor

Further research: Blender will manage to persist a diffuse texture to FBX only if it is directly connected to the color socket on the principled node. Otherwise it will be bundled but ignored on import.

Unfortunately, wiring the connection that way will break the PBR setup of MakeSkin. But maybe it would be possible to have a drastically simplified material setup specifically for external applications? Research continues...

@joepal1976
Copy link
Contributor

There is now basic support for a new material type "GameEngine". Before creating or adding any character or assets, set material types in the library settings panel:

image

Note that this is only available in the blender4 branch and blender4 nightly builds.

Note to self, still to do:

  • Allow overriding to game engine for skin, eyes and clothes when loading from preset
  • Allow usage of game engine when importing from makehuman
  • Allow usage of game engine when loading from an explicit mhclo file
  • Check serialization of game engine material when saving a preset
  • Handle game engine material in alternate material dropdown

@joepal1976 joepal1976 changed the title Blender cannot export even a simple diffuse/normalmap MakeSkin material to FBX and then read it back MPFB2 needs a PBR material which translates to external game engines (since the MakeSkin model does not) May 7, 2024
@joepal1976 joepal1976 added this to the 2.0 beta 1 milestone May 7, 2024
@joepal1976
Copy link
Contributor

Now the game engine material works with eyes, bodyparts, clothes and skin. It can be serialized and deserialized. When exporting a character with game engine materials to FBX and then importing it back into blender, the character looks reasonably the same.

Remains to test exports with actual game engines such as unity.

@joepal1976
Copy link
Contributor

Well, an export to unity looks decent at least. First image is Eevee, second is Unity right after import. No need to adjust the textures manually.

ge_eevee
ge_unity

@joepal1976
Copy link
Contributor

Assumed to be working as intended. Open new issues if something is wrong with it.

@Miracle8248
Copy link
Author

Ok thanks

@Miracle8248
Copy link
Author

Assumed to be working as intended. Open new issues if something is wrong with it.

I am sorry if I waste your time

@joepal1976
Copy link
Contributor

Assumed to be working as intended. Open new issues if something is wrong with it.

I am sorry if I waste your time

This was just the assumption based on the fixes that has been added the last few weeks. If there are still things which need to be improved, I obviously want to hear about them. Getting such feedback is helpful, not a waste of time.

@Miracle8248
Copy link
Author

Ok thanks I will report any issues if I find in future too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix exists - testing needed
Projects
None yet
Development

No branches or pull requests

2 participants