MPFB 2

Locked forum where the devs and staff post news about the makehuman software

MPFB 2 to Unreal

Postby AssetDK » Thu May 06, 2021 7:08 pm

My "general goal" is the make the makehuman characters a bit more easy to use in Unreal, so I made this tutorial http://www.makehumancommunity.org/wiki/Documentation:Saving_models_for_Unreal_Engine_and_how_to_import_them_there and I also made a Blender tool to "copy" the MH shape keys into blender, when importing into blender, so these shape keys can be used to customize the characters in Unreal. For the last part I made "MHC - UE4 Generic Character customization for MakeHuman, and other characters" http://www.makehumancommunity.org/wiki/Documentation:Unreal_MHC#Customization.

The general idea is that you should be able to make as many characters as you like for Unreal. So you will be able to populate your games with random characters high quality characters. For this to work there is now only very few missing elements. One of those would be a way to transplant a MetaHuman head to a makehuman body! I already managed to do this, but I think that it would make a lot of sense if we could make this work with a baked/lower quality of the textures - that is it should be possible to "swap" the MetaHuman head materials and hair, directly to the makehuman character... and then switch to the metahuman head for Lod0 closeups. Just as one example of what could be.
( This is an example of MH with a metahuman head - not perfect yet: viewtopic.php?f=14&t=18462&start=60#p53940 )

In this way you will get the best of both worlds. On the same node, you could also transfer some of the MH shape keys to the MetaHuman head, as you could transfer the "live link" shape keys to the makehuman heads - giving people the "sliders" what they want!

If you take a look at what people want to do it appears that MakeHuman can deliver both the body and the "morph targets", in one way or an other (See these requests here https://www.youtube.com/watch?v=ys3JivS-iXU&t=3990s )

Anyway; I would be very happy to help out in what ever way I can - within the limits of my time. Perhaps I can make some tutorials and I am definitely going to get the Unreal customize tool working.
AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

Re: MPFB 2 - getting started

Postby joepal » Fri May 07, 2021 6:12 am

AssetDK wrote:Hi - I made a simple tool for Blender and makehuman, but it looks like you made it obsolete. :lol:

Code: Select all
json.decoder.JSONDecodeError: Invalid \escape: line 204 column 28 (char 5914)

location: <unknown location>:-1


I guess that I need some new .mhmat files or did I not install correctly!


No, this looks more like a unicode decode error. The existing MHMAT file format should work, although I haven't really catered for file contents being anything other than UTF-8.

It should be possible to increase the log level of material.makeskinmaterial to DUMP on the developer -> log levels panel in MPFB2. Can you do so and repeat the procedure and then either post the log file or the last few hundred lines of the console output? The location of the log file should be printed to the console when starting blender with MPFB2 enabled.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4103
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB 2 to Unreal

Postby joepal » Fri May 07, 2021 7:55 am

AssetDK wrote:Anyway; I would be very happy to help out in what ever way I can - within the limits of my time. Perhaps I can make some tutorials and I am definitely going to get the Unreal customize tool working.


I think the thing that is needed the most in regards to MPFB2 now is putting it to work, finding bugs and suggesting improvements. Getting sent stack traces as the one above is very useful.

Another design goal I have is that the code should be comprehensible and reasonably easy to get into. I'd love to see someone step in and try to add something, no matter how small, and report back on what was most difficult to understand in regards to code structure.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4103
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB 2 - getting started

Postby AssetDK » Fri May 07, 2021 10:33 am

joepal wrote:It should be possible to increase the log level of material.makeskinmaterial to DUMP on the developer -> log levels panel in MPFB2. Can you do so and repeat the procedure and then either post the log file or the last few hundred lines of the console output? The location of the log file should be printed to the console when starting blender with MPFB2 enabled.


I will look into that, I am not sure if UTF-8 is in play...
AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

Re: MPFB 2 to Unreal

Postby AssetDK » Fri May 07, 2021 1:16 pm

joepal wrote:... Another design goal I have is that the code should be comprehensible and reasonably easy to get into. I'd love to see someone step in and try to add something, no matter how small, and report back on what was most difficult to understand in regards to code structure.


I will take a look, I have a solid programming bacground but very littlle Python - so that should be good. Also I really struggle with Blender, it is very open, but also quite confusing... those that use Blender a lot may have a better grasp on things, but if you use it on/off things do not always work out as you remebered...

Initally I will take a look into how I can use the tool, perhaps add some commnets on how to make it more accesibel (for people that do not grasp Blender) and then I may inspect some of the options that I need to know to get things working with Unreal. Sadly I don't have much time, but lets see.

:!: First thing I notiiced is that there is an option to check for user content, :idea: it would be nice if I could "run" it and see what it finds, and perhaps there should be a :idea: hint about what "user content" (or what ever term it is) actually meanns. My guess it that it's related to the .mhmat files etc. but I'm not sure.
AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

Re: MPFB 2

Postby Aranuvir » Sat May 08, 2021 8:57 am

Invalid \escape

No, this looks more like a unicode decode error.

Looks more like an issue with handling of backslashes in JsonCall, which, meanwhile, was fixed ;) ...
Aranuvir
 
Posts: 1273
Joined: Sun Oct 12, 2014 2:12 pm

Re: MPFB 2 to Unreal

Postby AssetDK » Sat May 08, 2021 10:47 am

joepal wrote: Another design goal I have is that the code should be comprehensible and reasonably easy to get into. I'd love to see someone step in and try to add something, no matter how small, and report back on what was most difficult to understand in regards to code structure.


I will try to help out - but perhaps others would also want to dive in?

So I just started up my Visual Studio Code (VSC), that I used for MakeShapes, and it looks like I can simply access the MPFB2-latest with only a few problems. So I guess the fist task could be to make a quick "getting started" with VSC and Blender. Also I would like to recommend that you use Blender launcher, as you will probably need to run different versions of Blender.

Depending on what you think I can see that VSCode actually supports load from and to GitHub - although I did get my addon to GitHub I am a novice on that also, so I don't know what workflow would make sense to go for.
I downloaded MPFB2-latest.zip from https://download.tuxfamily.org/makehuman/plugins/ - but perhaps it would be better to link directly from VSCode to GitHub... what do you recommend?

Anyways I started a post regarding using VSC for MPFB2 i hope this will make a good starting point for anyone that want to get into this... Getting MPFB 2 started with VS code - time for a break and some family time! ;)
AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

Re: MPFB 2 - getting started

Postby AssetDK » Tue May 11, 2021 7:21 pm

joepal wrote:...
No, this looks more like a unicode decode error. The existing MHMAT file format should work, although I haven't really catered for file contents being anything other than UTF-8.

It should be possible to increase the log level of material.makeskinmaterial to DUMP on the developer -> log levels panel in MPFB2. Can you do so and repeat the procedure and then either post the log file or the last few hundred lines of the console output? The location of the log file should be printed to the console when starting blender with MPFB2 enabled.


I tried that and this is what I get on the Debug console (in VSC) - I don't know if this is enough to go by, but I will try to find the log to see if that contains more information:

[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig
[WARN ] material.mhmaterial ....................: Not a valid key: shaderConfig

I guess this is the log I could find, I am not quite sure where I find the console you refer to, perhaps it is the same thing:

Code: Select all
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False, confirm=False)
Deleted 3 object(s)
bpy.context.scene.MPFB_DEV_chosen_level = '6'
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
bpy.ops.object.shade_smooth()
bpy.ops.transform.resize(value=(0.1, 0.1, 0.1), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, True, True), mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
bpy.ops.object.transform_apply(scale=True)
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
bpy.ops.mpfb.create_human()
Human created. You can adjust the phenotype values on the modeling panel.
bpy.context.scene.MPFB_DEV_available_loggers = 'material.makeskinmaterial'
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)
bpy.context.space_data.recent_folders_active = 1
Python: Traceback (most recent call last):
  File "C:\Users\asset\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\mpfb\ui\makeskin\operators\importmaterial.py", line 47, in execute
    mhmat.apply_node_tree(material)
  File "C:\Users\asset\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\mpfb\entities\material\makeskinmaterial.py", line 68, in apply_node_tree
    node_tree_dict = json.loads(template_data)
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 204 column 28 (char 5914)

location: <unknown location>:-1
AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

Re: MPFB 2

Postby joepal » Wed May 12, 2021 10:51 am

I've pushed functionality for exporting log files now. You can find this on the developer panel.

This is only in the source so far, but will be build automatically tonight.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4103
Joined: Wed Jun 04, 2008 11:20 am

Re: MPFB 2

Postby AssetDK » Thu May 13, 2021 8:39 am

joepal wrote:... This is only in the source so far, but will be build automatically tonight.


Thanks I will look into this between everything else....

Default log with material.makeskinmaterial DUMP and the

Code: Select all
[WARN ] services.locationservice ...............: mh_user_dir is not explicitly set, and autodiscovery is enabled
[INFO ] services.locationservice ...............: Will attempt to autodiscover mh user data via local paths
[INFO ] services.locationservice ...............: Autodiscovered mh user data at C:\Users\asset\Documents\makehuman\v1py3\data
[INFO ] services.uiservice .....................: Rebuilding the list of available importer presets (for presets panel)
[INFO ] services.uiservice .....................: Rebuilding the list of available importer presets (for importer panel)
[INFO ] mpfb.init ..............................: Socket service says makeHuman user dir is at C:\Users\asset\Documents\makehuman\v1py3
[INFO ] mpfb.init ..............................: MPFB initialization has finished.
[INFO ] mpfb.init ..............................: Socket service says makeHuman user dir is at C:\Users\asset\Documents\makehuman\v1py3
[INFO ] mpfb.init ..............................: MPFB initialization has finished.
[INFO ] services.uiservice .....................: Rebuilding the list of available enhanced settings (for enhanced settings panel)
[DEBUG] material.makeskinmaterial ..............: bumpMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: diffuseTexture is set in mhmat
[DEBUG] material.makeskinmaterial ..............: displacementMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: metallicMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: normalMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: roughnessMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: transmissionMapTexture is not set in mhmat
[DUMP ] material.makeskinmaterial ..............: template_values
{   'bump_or_normal': 'false',
    'bumpmap_filename': '""',
    'diffuse_filename': '"C:\\Users\\asset\\Documents\\makehuman\\v1py3\\data\\skins\\Light_Skin_Male_Freckles/young_lightskinned_male_diffuse_Freckles.png"',
    'displacementmap_filename': '""',
    'has_bumpmap': 'false',
    'has_diffuse': 'true',
    'has_displacementmap': 'false',
    'has_metallicmap': 'false',
    'has_normalmap': 'false',
    'has_roughnessmap': 'false',
    'has_transmissionmap': 'false',
    'metallicmap_filename': '""',
    'normalmap_filename': '""',
    'roughnessmap_filename': '""',
    'transmissionmap_filename': '""'}


Additional information printed on the VSC terminal

Code: Select all
DEBUG] material.makeskinmaterial ..............: bumpMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: diffuseTexture is set in mhmat
[DEBUG] material.makeskinmaterial ..............: displacementMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: metallicMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: normalMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: roughnessMapTexture is not set in mhmat
[DEBUG] material.makeskinmaterial ..............: transmissionMapTexture is not set in mhmat
[DUMP ] material.makeskinmaterial ..............: template_values
{   'bump_or_normal': 'false',
    'bumpmap_filename': '""',
    'diffuse_filename': '"C:\\Users\\asset\\Documents\\makehuman\\v1py3\\data\\skins\\Light_Skin_Male_Freckles/young_lightskinned_male_diffuse_Freckles.png"',
    'displacementmap_filename': '""',
    'has_bumpmap': 'false',
    'has_diffuse': 'true',
    'has_displacementmap': 'false',
    'has_metallicmap': 'false',
    'has_normalmap': 'false',
    'has_roughnessmap': 'false',
    'has_transmissionmap': 'false',
    'metallicmap_filename': '""',
    'normalmap_filename': '""',
    'roughnessmap_filename': '""',
    'transmissionmap_filename': '""'}
Python: Traceback (most recent call last):
  File "C:\Users\asset\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\mpfb\ui\makeskin\operators\importmaterial.py", line 47, in execute
    mhmat.apply_node_tree(material)
  File "C:\Users\asset\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\mpfb\entities\material\makeskinmaterial.py", line 68, in apply_node_tree
    node_tree_dict = json.loads(template_data)
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "d:\Blender\stable\blender-2.92.0-windows64\2.92\python\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 204 column 28 (char 5914)

location: <unknown location>:-1



Contents of .mhmat file

Code: Select all
# MakeHuman Material definition

name lightskinmaleMaterial

// Color shading attributes
diffuseColor  1 1 1
specularColor  0.02745 0.02745 0.02745
shininess 1
opacity 0

// Textures and properties
diffuseTexture young_lightskinned_male_diffuse_Freckles.png

// Shader programme
shader data/shaders/glsl/phong
shaderParam litsphereTexture data/litspheres/lit_standard_skin.png

// Configure built-in shader defines
shaderConfig diffuse true
shaderConfig bump false
shaderConfig normal  false
shaderConfig displacement  false
shaderConfig spec  false
shaderConfig vertexColors false

AssetDK
 
Posts: 51
Joined: Wed Dec 25, 2019 1:46 pm

PreviousNext

Return to News from the crew

Who is online

Users browsing this forum: Geoff and 1 guest