[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50845] trunk/blender/source/blender/ editors/interface/interface_regions.c: Fix #32396: EyeDropper does nothing on "New" in Uv image editor

Sergey Sharybin sergey.vfx at gmail.com
Mon Sep 24 15:02:09 CEST 2012


Revision: 50845
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50845
Author:   nazgul
Date:     2012-09-24 13:02:08 +0000 (Mon, 24 Sep 2012)
Log Message:
-----------
Fix #32396: EyeDropper does nothing on "New" in Uv image editor

For now simply hide color picker button for properties which doesn't
have RNA path. Trying to make color picker working would end up with
design limitations like not bale to run two operators the same time.

Used RNA_property_path_from_ID_check for check which is marked as
slow and need to be used with care. Since this function is only called
from a popup, shouldn't be a big problem.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_regions.c

Modified: trunk/blender/source/blender/editors/interface/interface_regions.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_regions.c	2012-09-24 12:15:49 UTC (rev 50844)
+++ trunk/blender/source/blender/editors/interface/interface_regions.c	2012-09-24 13:02:08 UTC (rev 50845)
@@ -2144,8 +2144,10 @@
 	uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
 	uiBlockEndAlign(block);
 
-	bt = uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth + 10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
-	uiButSetFunc(bt, close_popup_cb, bt, NULL);
+	if (RNA_property_path_from_ID_check(ptr, prop)) {
+		bt = uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth + 10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
+		uiButSetFunc(bt, close_popup_cb, bt, NULL);
+	}
 	
 	/* RGB values */
 	uiBlockBeginAlign(block);




More information about the Bf-blender-cvs mailing list