[Bf-blender-cvs] [626064addc1] greasepencil-object: GPencil: Update Topbar popover color using palette

Antonio Vazquez noreply at git.blender.org
Thu Feb 27 17:29:50 CET 2020


Commit: 626064addc1da4c2a7c2ac8fb72ef4d00ba2544f
Author: Antonio Vazquez
Date:   Thu Feb 27 17:29:42 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB626064addc1da4c2a7c2ac8fb72ef4d00ba2544f

GPencil: Update Topbar popover color using palette

Now when select a color, the popover color is updated.

Fix by Julian Eisel

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

M	source/blender/editors/interface/interface_handlers.c

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

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 9400edc7517..47e48a6fe37 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -5798,15 +5798,27 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co
           }
           else {
             Scene *scene = CTX_data_scene(C);
+            bool updated = false;
 
             if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
               RNA_property_float_get_array(&but->rnapoin, but->rnaprop, color);
               BKE_brush_color_set(scene, brush, color);
+              updated = true;
             }
             else if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR) {
               RNA_property_float_get_array(&but->rnapoin, but->rnaprop, color);
               IMB_colormanagement_scene_linear_to_srgb_v3(color);
               BKE_brush_color_set(scene, brush, color);
+              updated = true;
+            }
+
+            if (updated) {
+              PointerRNA brush_ptr;
+              PropertyRNA *brush_color_prop;
+
+              RNA_id_pointer_create(&brush->id, &brush_ptr);
+              brush_color_prop = RNA_struct_find_property(&brush_ptr, "color");
+              RNA_property_update(C, &brush_ptr, brush_color_prop);
             }
           }



More information about the Bf-blender-cvs mailing list