animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.76k stars 308 forks source link

Editing Texture Keys in MB-Dev #333

Closed animate1978 closed 3 years ago

animate1978 commented 3 years ago

So I have re-introduced Roughness into MB-Lab and going through the code I am trying to add this to the list of things you can edit in MB-Dev.

WTF_001

Since Subdermal textures don't exist in MB-Lab anymore I wanted to change the entries for the textures. Below is the code I have changed....

# Now all textures and materials.
                        b_m_c_c.separator(factor=1)
                        if creation_tools_ops.get_content(key, "texture_albedo") != "":
                            b_m_c_c.label(text="Albedo : " + creation_tools_ops.get_content(key, "texture_albedo"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_albedo")
                        if creation_tools_ops.get_content(key, "texture_bump") != "":
                            b_m_c_c.label(text="Bump : " + creation_tools_ops.get_content(key, "texture_bump"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_bump")
                        if creation_tools_ops.get_content(key, "texture_displacement") != "":
                            b_m_c_c.label(text="Displacement : " + creation_tools_ops.get_content(key, "texture_displacement"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_displacement")
                        if creation_tools_ops.get_content(key, "texture_frecklemask") != "":
                            b_m_c_c.label(text="Frekles : " + creation_tools_ops.get_content(key, "texture_frecklemask"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_frecklemask")
                        if creation_tools_ops.get_content(key, "texture_blush") != "":
                            b_m_c_c.label(text="Blush : " + creation_tools_ops.get_content(key, "texture_blush"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_blush")
                        if creation_tools_ops.get_content(key, "texture_sebum") != "":
                            b_m_c_c.label(text="Sebum : " + creation_tools_ops.get_content(key, "texture_sebum"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_sebum")
                        if creation_tools_ops.get_content(key, "texture_roughness") != "":
                            b_m_c_c.label(text="Roughness : " + creation_tools_ops.get_content(key, "texture_roughness"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_roughness")
                        if creation_tools_ops.get_content(key, "texture_eyes") != "":
                            b_m_c_c.label(text="Eyes : " + creation_tools_ops.get_content(key, "texture_eyes"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_eyes")
                        if creation_tools_ops.get_content(key, "texture_eyelash_albedo") != "":
                            b_m_c_c.label(text="Eyelash albedo : " + creation_tools_ops.get_content(key, "texture_eyelash_albedo"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_eyelash_albedo")
                        if creation_tools_ops.get_content(key, "texture_iris_color") != "":
                            b_m_c_c.label(text="Iris color : " + creation_tools_ops.get_content(key, "texture_iris_color"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_iris_color")
                        if creation_tools_ops.get_content(key, "texture_iris_bump") != "":
                            b_m_c_c.label(text="Iris bump : " + creation_tools_ops.get_content(key, "texture_iris_bump"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_iris_bump")
                        if creation_tools_ops.get_content(key, "texture_sclera_color") != "":
                            b_m_c_c.label(text="Sclera color : " + creation_tools_ops.get_content(key, "texture_sclera_color"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_sclera_color")
                        if creation_tools_ops.get_content(key, "texture_sclera_mask") != "":
                            b_m_c_c.label(text="Sclera mask : " + creation_tools_ops.get_content(key, "texture_sclera_mask"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_sclera_mask")
                        if creation_tools_ops.get_content(key, "texture_translucent_mask") != "":
                            b_m_c_c.label(text="Transluscent : " + creation_tools_ops.get_content(key, "texture_translucent_mask"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_translucent_mask")
                        if creation_tools_ops.get_content(key, "texture_lipmap") != "":
                            b_m_c_c.label(text="lip map : " + creation_tools_ops.get_content(key, "texture_lipmap"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_lipmap")
                        if creation_tools_ops.get_content(key, "texture_tongue_albedo") != "":
                            b_m_c_c.label(text="Tongue albedo" + creation_tools_ops.get_content(key, "texture_tongue_albedo"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_tongue_albedo")
                        if creation_tools_ops.get_content(key, "texture_teeth_albedo") != "":
                            b_m_c_c.label(text="Teeth albedo : " + creation_tools_ops.get_content(key, "texture_teeth_albedo"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_teeth_albedo")
                        if creation_tools_ops.get_content(key, "texture_nails_albedo") != "":
                            b_m_c_c.label(text="Nails albedo : " + creation_tools_ops.get_content(key, "texture_nails_albedo"), icon='CHECKMARK')
                        else:
                            b_m_c_c.prop(scn, "mbcrea_texture_nails_albedo")

elif key in config_content["character_list"]:
        if not key in config_content:
            config_content[key] = {
                "description": "", "template_model": "", "name": key,
                "label": "", "texture_albedo": "", "texture_bump": "",
                "texture_displacement": "", "texture_eyes": "",
                "texture_tongue_albedo": "", "texture_teeth_albedo": "",
                "texture_nails_albedo": "", "texture_eyelash_albedo": "",
                "texture_frecklemask": "", "texture_blush": "", 
                "texture_sebum": "", "texture_lipmap": "", 
                "texture_roughness": "", "texture_iris_color": "",
                "texture_iris_bump": "", "texture_sclera_color": "",
                "texture_translucent_mask": "", "texture_sclera_mask": "",
                "morphs_extra_file": "", "shared_morphs_file": "",
                "shared_morphs_extra_file": "", "bounding_boxes_file": "",
                "proportions_folder": "", "joints_base_file": "",
                "joints_offset_file": "", "measures_file": "",
                "presets_folder": "", "transformations_file": "",
                "vertexgroup_base_file": "", "vertexgroup_muscle_file": ""}
        if not key_in in config_content[key]:
            config_content[key][key_in] = content
        elif key_in != None:
            config_content[key][key_in] = content

Problem when I try to see the list in MB-Dev.... this prints in the console output...

rna_uiItemR: property not found: Scene.mbcrea_texture_roughness
/home/farishta/blender-2.91.0-linux64/2.91/scripts/addons/MB-Lab/__init__.py:3703

What am I missing?

animate1978 commented 3 years ago

Found my issue!!

FIXED