From f74ba5a5fad3296a22a9092c6626c57ea2b60d4e Mon Sep 17 00:00:00 2001 From: Don Schnitzius Date: Thu, 8 Aug 2024 13:51:16 -0500 Subject: [PATCH] blender-qmc v1.6.0 --- CHANGELOG.md | 7 ++++ blender-qmc-plus/blender-qmc-plus/__init__.py | 37 +++++++++---------- .../color_sets/color_functions.py | 4 +- blender-qmc/blender-qmc/__init__.py | 35 ++++++++---------- .../blender-qmc/color_sets/color_functions.py | 4 +- 5 files changed, 46 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 666b5bc..7193c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### 1.7.0 + +- Add **Set Viewport Color** checkbox + - When selected, this changes the **Viewport Color** of the material. +- Rename **Selected Node** > **Selected Node Only** +- Rename **World Background** > **Set World Background** + ### 1.6.0 - Add **COCO Segmentation** set of 183 colors diff --git a/blender-qmc-plus/blender-qmc-plus/__init__.py b/blender-qmc-plus/blender-qmc-plus/__init__.py index f2121ad..e59680d 100644 --- a/blender-qmc-plus/blender-qmc-plus/__init__.py +++ b/blender-qmc-plus/blender-qmc-plus/__init__.py @@ -21,7 +21,7 @@ "name" : "QMC+ (Quick Material Colors Plus)", "description": "Sets the Base Color of a Material Shader", "author" : "Don Schnitzius", - "version" : (1, 6, 0), + "version" : (1, 7, 0), "blender" : (2, 80, 0), "location" : "3D Viewport > Sidebar > MAT > Quick Material Colors", "warning" : "", @@ -42,18 +42,10 @@ # BOOLEAN FOR PANEL class QMC_SETTINGS(bpy.types.PropertyGroup): - rename_material_more: bpy.props.BoolProperty( - name='', - default=False - ) - active_node_more: bpy.props.BoolProperty( - name='', - default=False - ) - world_color_more: bpy.props.BoolProperty( - name='', - default=False - ) + active_node_more: bpy.props.BoolProperty(name='',default=False) + rename_material_more: bpy.props.BoolProperty(name='',default=False) + diffuse_more: bpy.props.BoolProperty(name='',default=False) + world_color_more: bpy.props.BoolProperty(name='',default=False) # PARENT PANEL @@ -63,27 +55,30 @@ class QMCPanel(bpy.types.Panel): bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = "MAT" - # bl_options = {'DEFAULT_CLOSED'} + bl_options = {'DEFAULT_CLOSED'} def draw(self, context): layout = self.layout - more_bool = context.scene.more_bool active_bool = context.scene.active_bool + more_bool = context.scene.more_bool + diffuse_bool = context.scene.diffuse_bool world_bool = context.scene.world_bool srow = layout.row() scol = srow.column(align=True) scol.scale_y = 1.25 - scol.prop(more_bool, "rename_material_more") scol.prop(active_bool, "active_node_more") + scol.prop(more_bool, "rename_material_more") + scol.prop(diffuse_bool, "diffuse_more") scol.prop(world_bool, "world_color_more") scol = srow.column(align=True) scol.scale_y = 1.25 scol.scale_x = 3.0 + scol.label(text="Selected Node Only") scol.label(text="Rename Material") - scol.label(text="Selected Node") - scol.label(text="World Background") + scol.label(text="Set Viewport Color") + scol.label(text="Set World Background") # IMPORT PANELS @@ -140,15 +135,17 @@ def register(): g.c_icons.load(os.path.splitext(entry)[0], os.path.join(icons_dir, entry), "IMAGE") for cls in classes: bpy.utils.register_class(cls) - bpy.types.Scene.more_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) bpy.types.Scene.active_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) + bpy.types.Scene.more_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) + bpy.types.Scene.diffuse_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) bpy.types.Scene.world_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) def unregister(): bpy.utils.previews.remove(g.c_icons) - del bpy.types.Scene.more_bool del bpy.types.Scene.active_bool + del bpy.types.Scene.more_bool + del bpy.types.Scene.diffuse_bool del bpy.types.Scene.world_bool for cls in reversed(classes): bpy.utils.unregister_class(cls) diff --git a/blender-qmc-plus/blender-qmc-plus/color_sets/color_functions.py b/blender-qmc-plus/blender-qmc-plus/color_sets/color_functions.py index 5fcae5f..1f01342 100644 --- a/blender-qmc-plus/blender-qmc-plus/color_sets/color_functions.py +++ b/blender-qmc-plus/blender-qmc-plus/color_sets/color_functions.py @@ -148,7 +148,9 @@ def set_bsdf(name, hex, material, mat_name): def set_dif_color(thing, hex): - thing.diffuse_color = hex_to_rgb(hex) + diffuse_bool = bpy.context.scene.diffuse_bool.diffuse_more + if diffuse_bool == True: + thing.diffuse_color = hex_to_rgb(hex) def set_input_color(node, num, hex): diff --git a/blender-qmc/blender-qmc/__init__.py b/blender-qmc/blender-qmc/__init__.py index b3bcf6b..f80b4eb 100644 --- a/blender-qmc/blender-qmc/__init__.py +++ b/blender-qmc/blender-qmc/__init__.py @@ -21,7 +21,7 @@ "name" : "QMC (Quick Material Colors)", "description": "Sets the Base Color of a Material Shader", "author" : "Don Schnitzius", - "version" : (1, 6, 0), + "version" : (1, 7, 0), "blender" : (2, 80, 0), "location" : "3D Viewport > Sidebar > MAT > Quick Material Colors", "warning" : "", @@ -42,18 +42,10 @@ # BOOLEAN FOR PANEL class QMC_SETTINGS(bpy.types.PropertyGroup): - rename_material_more: bpy.props.BoolProperty( - name='', - default=False - ) - active_node_more: bpy.props.BoolProperty( - name='', - default=False - ) - world_color_more: bpy.props.BoolProperty( - name='', - default=False - ) + active_node_more: bpy.props.BoolProperty(name='',default=False) + rename_material_more: bpy.props.BoolProperty(name='',default=False) + diffuse_more: bpy.props.BoolProperty(name='',default=False) + world_color_more: bpy.props.BoolProperty(name='',default=False) # PARENT PANEL @@ -67,23 +59,26 @@ class QMCPanel(bpy.types.Panel): def draw(self, context): layout = self.layout - more_bool = context.scene.more_bool active_bool = context.scene.active_bool + more_bool = context.scene.more_bool + diffuse_bool = context.scene.diffuse_bool world_bool = context.scene.world_bool srow = layout.row() scol = srow.column(align=True) scol.scale_y = 1.25 - scol.prop(more_bool, "rename_material_more") scol.prop(active_bool, "active_node_more") + scol.prop(more_bool, "rename_material_more") + scol.prop(diffuse_bool, "diffuse_more") scol.prop(world_bool, "world_color_more") scol = srow.column(align=True) scol.scale_y = 1.25 scol.scale_x = 3.0 + scol.label(text="Selected Node Only") scol.label(text="Rename Material") - scol.label(text="Selected Node") - scol.label(text="World Background") + scol.label(text="Set Viewport Color") + scol.label(text="Set World Background") # IMPORT PANELS @@ -138,15 +133,17 @@ def register(): g.c_icons.load(os.path.splitext(entry)[0], os.path.join(icons_dir, entry), "IMAGE") for cls in classes: bpy.utils.register_class(cls) - bpy.types.Scene.more_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) bpy.types.Scene.active_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) + bpy.types.Scene.more_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) + bpy.types.Scene.diffuse_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) bpy.types.Scene.world_bool = bpy.props.PointerProperty(type=QMC_SETTINGS) def unregister(): bpy.utils.previews.remove(g.c_icons) - del bpy.types.Scene.more_bool del bpy.types.Scene.active_bool + del bpy.types.Scene.more_bool + del bpy.types.Scene.diffuse_bool del bpy.types.Scene.world_bool for cls in reversed(classes): bpy.utils.unregister_class(cls) diff --git a/blender-qmc/blender-qmc/color_sets/color_functions.py b/blender-qmc/blender-qmc/color_sets/color_functions.py index 5fcae5f..1f01342 100644 --- a/blender-qmc/blender-qmc/color_sets/color_functions.py +++ b/blender-qmc/blender-qmc/color_sets/color_functions.py @@ -148,7 +148,9 @@ def set_bsdf(name, hex, material, mat_name): def set_dif_color(thing, hex): - thing.diffuse_color = hex_to_rgb(hex) + diffuse_bool = bpy.context.scene.diffuse_bool.diffuse_more + if diffuse_bool == True: + thing.diffuse_color = hex_to_rgb(hex) def set_input_color(node, num, hex):