[Bf-blender-cvs] [022ad416702] master: DRW: use object color from instancer

Campbell Barton noreply at git.blender.org
Tue Mar 12 02:38:44 CET 2019


Commit: 022ad416702dabb2086b587d04230dd078478c04
Author: Campbell Barton
Date:   Tue Mar 12 12:28:01 2019 +1100
Branches: master
https://developer.blender.org/rB022ad416702dabb2086b587d04230dd078478c04

DRW: use object color from instancer

Otherwise it's impossible to set the color of instanced library objects.

Follows convention of instancer controlling draw options.

===================================================================

M	release/scripts/startup/bl_ui/properties_object.py
M	source/blender/depsgraph/intern/depsgraph_query_iter.cc

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index f6e5380591a..f8da287f231 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -257,7 +257,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
             col.active = is_dupli
         col.prop(obj, "display_type", text="Display As")
 
-        if is_geometry or is_empty_image or is_gpencil:
+        if is_geometry or is_dupli or is_empty_image or is_gpencil:
             # Only useful with object having faces/materials...
             col = flow.column()
             col.prop(obj, "color")
diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
index fdb9ab312a4..9ce2d0b0981 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
@@ -149,6 +149,7 @@ bool deg_objects_dupli_iterator_next(BLI_Iterator *iter)
 		temp_dupli_object->base_flag = dupli_parent->base_flag | BASE_FROM_DUPLI;
 		temp_dupli_object->base_local_view_bits = dupli_parent->base_local_view_bits;
 		temp_dupli_object->dt = dupli_parent->dt;
+		copy_v4_v4(temp_dupli_object->color, dupli_parent->color);
 
 		/* Duplicated elements shouldn't care whether their original collection is visible or not. */
 		temp_dupli_object->base_flag |= BASE_VISIBLE;



More information about the Bf-blender-cvs mailing list