Commit: 85582e223572dc627f1ea53314353d1b8a71967d
Author: Stefan Werner
Date:   Wed Jul 19 12:11:49 2017 +0200
Branches: temp_cryptomatte
https://developer.blender.org/rB85582e223572dc627f1ea53314353d1b8a71967d

Cryptomatte: fixed an issue where the eye dropper blocked all "e" key events

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

M       source/blender/editors/interface/interface_eyedropper.c
M       source/blender/editors/interface/interface_intern.h
M       source/blender/editors/interface/interface_ops.c
M       source/blender/editors/interface/interface_templates.c

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

diff --git a/source/blender/editors/interface/interface_eyedropper.c 
b/source/blender/editors/interface/interface_eyedropper.c
index 338f3d4d06c..ee800eed757 100644
--- a/source/blender/editors/interface/interface_eyedropper.c
+++ b/source/blender/editors/interface/interface_eyedropper.c
@@ -120,6 +120,7 @@ wmKeyMap *eyedropper_modal_keymap(wmKeyConfig *keyconf)
        WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_id");
        WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_depth");
        WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_driver");
+       WM_modalkeymap_assign(keymap, "UI_OT_eyedropper_color_separate");
 
        return keymap;
 }
@@ -450,14 +451,14 @@ static int eyedropper_exec(bContext *C, wmOperator *op)
        }
 }
 
-static int eyedropper_poll(bContext *C)
+static int eyedropper_separate(bContext *C)
 {
-#if 1
-       // this is how this function was until sep 2016 -
-       // the now added check breaks the eye dropper button for cryptomattes
        if (!CTX_wm_window(C)) return 0;
        else return 1;
-#else
+}
+
+static int eyedropper_poll(bContext *C)
+{
        PointerRNA ptr;
        PropertyRNA *prop;
        int index_dummy;
@@ -472,7 +473,6 @@ static int eyedropper_poll(bContext *C)
        }
 
        return 0;
-#endif
 }
 
 void UI_OT_eyedropper_color(wmOperatorType *ot)
@@ -495,6 +495,27 @@ void UI_OT_eyedropper_color(wmOperatorType *ot)
        /* properties */
 }
 
+void UI_OT_eyedropper_color_separate(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "Eyedropper";
+       ot->idname = "UI_OT_eyedropper_color_separate";
+       ot->description = "Sample a color from the Blender Window to store in a 
property";
+
+       /* api callbacks */
+       ot->invoke = eyedropper_invoke;
+       ot->modal = eyedropper_modal;
+       ot->cancel = eyedropper_cancel;
+       ot->exec = eyedropper_exec;
+       ot->poll = eyedropper_separate;
+
+       /* flags */
+       ot->flag = OPTYPE_BLOCKING | OPTYPE_INTERNAL;
+
+       /* properties */
+}
+
+
 /** \} */
 
 
diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index 067279777ba..f1f38f59bef 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -743,5 +743,6 @@ void UI_OT_eyedropper_color(struct wmOperatorType *ot);
 void UI_OT_eyedropper_id(struct wmOperatorType *ot);
 void UI_OT_eyedropper_depth(struct wmOperatorType *ot);
 void UI_OT_eyedropper_driver(struct wmOperatorType *ot);
+void UI_OT_eyedropper_color_separate(struct wmOperatorType *ot);
 
 #endif  /* __INTERFACE_INTERN_H__ */
diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index fb95cdf389b..79547a82941 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1128,6 +1128,7 @@ void ED_operatortypes_ui(void)
        WM_operatortype_append(UI_OT_eyedropper_id);
        WM_operatortype_append(UI_OT_eyedropper_depth);
        WM_operatortype_append(UI_OT_eyedropper_driver);
+       WM_operatortype_append(UI_OT_eyedropper_color_separate);
 }
 
 /**
diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 0aee8a63737..ecf2d04f97f 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2458,7 +2458,7 @@ void uiTemplateEyedropper(uiLayout *layout, PointerRNA 
*ptr, const char *propnam
        uiLayoutRow(col, true);
 
        uiDefBut(block, UI_BTYPE_LABEL, 0, RNA_property_ui_name(prop), 0, 19, 
145, 19, NULL, 0, 0, 0, 0, RNA_property_ui_description(prop));
-       but = uiDefIconButO(block, UI_BTYPE_BUT, "UI_OT_eyedropper_color", 
WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
+       but = uiDefIconButO(block, UI_BTYPE_BUT, 
"UI_OT_eyedropper_color_separate", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, 0, 0, 
UI_UNIT_X, UI_UNIT_Y, NULL);
        but->rnapoin = *ptr;
        but->rnaprop = prop;
        but->rnaindex = -1;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to