From 16fac020e07d7ad0caa5901c0740c88e9772194f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 19 Apr 2018 09:45:52 +0200 Subject: Workbench: Option to use Object color - added `object_color_type` where the user can set if the collection determines the color, or the object will be used for the color. Implemented it as an enum as later this can have a random color option. - moved OB_LIGHTING_* to DNA_view3d_types and renamed it. - Fixed some DRY in workbench_materials.c. Can remove more DRY's but will need to discuss the responsibility of the workbench engine as it might become part of the eevee renderer. --- release/scripts/startup/bl_ui/properties_collection.py | 1 + release/scripts/startup/bl_ui/properties_render.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index e0ac7786b50..25b4664ab83 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -96,6 +96,7 @@ class COLLECTION_PT_workbench_settings(CollectionButtonsPanel, Panel): collection_props = collection.engine_overrides['BLENDER_WORKBENCH'] col = layout.column() + col.template_override_property(collection_props, scene_props, "object_color_type") col.template_override_property(collection_props, scene_props, "object_color") diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 9b9cfee5dc7..a0d7e9b1026 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -907,7 +907,9 @@ class RENDER_PT_workbench_collection_settings(RenderButtonsPanel, Panel): props = context.scene.collection_properties['BLENDER_WORKBENCH'] col = layout.column() - col.prop(props, "object_color") + col.prop(props, "object_color_type") + if props.object_color_type == 'COLLECTION': + col.prop(props, "object_color") classes = ( -- cgit v1.2.3