def draw(self, context): material = context.active_object.active_material mmd_material = material.mmd_material layout = self.layout fnMat = FnMaterial(material) col = layout.column() col.label(text='Texture:') r = col.row(align=True) tex = fnMat.get_texture() if tex: if tex.type == 'IMAGE' and tex.image: r.prop(tex.image, 'filepath', text='') r.operator('mmd_tools.material_remove_texture', text='', icon='PANEL_CLOSE') else: r.operator('mmd_tools.material_remove_texture', text='Remove', icon='PANEL_CLOSE') r.label(icon='ERROR') else: r.operator('mmd_tools.material_open_texture', text='Add', icon=ICON_FILE_FOLDER) col = layout.column() col.label(text='Sphere Texture:') r = col.row(align=True) tex = fnMat.get_sphere_texture() if tex: if tex.type == 'IMAGE' and tex.image: r.prop(tex.image, 'filepath', text='') r.operator('mmd_tools.material_remove_sphere_texture', text='', icon='PANEL_CLOSE') else: r.operator('mmd_tools.material_remove_sphere_texture', text='Remove', icon='PANEL_CLOSE') r.label(icon='ERROR') else: r.operator('mmd_tools.material_open_sphere_texture', text='Add', icon=ICON_FILE_FOLDER) col.row(align=True).prop(mmd_material, 'sphere_texture_type', expand=True) col = layout.column() row = col.row() row.prop(mmd_material, 'is_shared_toon_texture') r = row.row() r.active = mmd_material.is_shared_toon_texture r.prop(mmd_material, 'shared_toon_texture') r = col.row() r.active = not mmd_material.is_shared_toon_texture r.prop(mmd_material, 'toon_texture')
def draw(self, context): material = context.active_object.active_material mmd_material = material.mmd_material layout = self.layout fnMat = FnMaterial(material) col = layout.column(align=True) row = col.row(align=True) row.label('Texture:') r = row.column(align=True) tex = fnMat.get_texture() if tex: if tex.type == 'IMAGE' and tex.image: r2 = r.row(align=True) r2.prop(tex.image, 'filepath', text='') r2.operator('mmd_tools.material_remove_texture', text='', icon='PANEL_CLOSE') else: r.operator('mmd_tools.material_remove_texture', text='Remove', icon='PANEL_CLOSE') col.label('Texture is invalid.', icon='ERROR') else: r.operator('mmd_tools.material_open_texture', text='Add', icon='FILESEL') col = layout.column(align=True) row = col.row(align=True) row.label('Sphere Texture:') r = row.column(align=True) tex = fnMat.get_sphere_texture() if tex: if tex.type == 'IMAGE' and tex.image: r2 = r.row(align=True) r2.prop(tex.image, 'filepath', text='') r2.operator('mmd_tools.material_remove_sphere_texture', text='', icon='PANEL_CLOSE') else: r.operator('mmd_tools.material_remove_sphere_texture', text='Remove', icon='PANEL_CLOSE') col.label('Sphere Texture is invalid.', icon='ERROR') else: r.operator('mmd_tools.material_open_sphere_texture', text='Add', icon='FILESEL') r = col.row(align=True) r.prop(mmd_material, 'sphere_texture_type') col = layout.column(align=True) c = col.column() r = c.row() r.prop(mmd_material, 'is_shared_toon_texture') if mmd_material.is_shared_toon_texture: r.prop(mmd_material, 'shared_toon_texture') else: r = c.row() r.prop(mmd_material, 'toon_texture')