[Bf-blender-cvs] [f328f45] master: Fix T39692: Text fields in datablocks editor are broken

Bastien Montagne noreply at git.blender.org
Sun Apr 27 22:35:52 CEST 2014


Commit: f328f45e22abafbb4eb88fc441c9b3707624901f
Author: Bastien Montagne
Date:   Sun Apr 27 22:33:05 2014 +0200
https://developer.blender.org/rBf328f45e22abafbb4eb88fc441c9b3707624901f

Fix T39692: Text fields in datablocks editor are broken

Make RNAPointer props un-editable here, we simply cannot handle this.

Also correct previous commit, asking for autonaming for all items was a bit extreme,
this is only needed for enums!

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

M	source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index b5d4481..09e971f 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -755,17 +755,28 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
 			if (tselem->type == TSE_RNA_PROPERTY) {
 				ptr = &te->rnaptr;
 				prop = te->directdata;
-				
-				if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem, soops)))) {
-					uiDefAutoButR(block, ptr, prop, -1, NULL, ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
-					              UI_UNIT_Y - 1);
+
+				if (!TSELEM_OPEN(tselem, soops)) {
+					if (RNA_property_type(prop) == PROP_POINTER) {
+						uiBut *but = uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, sizex, te->ys,
+						                           OL_RNA_COL_SIZEX, UI_UNIT_Y - 1);
+						uiButSetFlag(but, UI_BUT_DISABLED);
+					}
+					else if (RNA_property_type(prop) == PROP_ENUM) {
+						uiDefAutoButR(block, ptr, prop, -1, NULL, ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
+						              UI_UNIT_Y - 1);
+					}
+					else {
+						uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
+						              UI_UNIT_Y - 1);
+					}
 				}
 			}
 			else if (tselem->type == TSE_RNA_ARRAY_ELEM) {
 				ptr = &te->rnaptr;
 				prop = te->directdata;
 				
-				uiDefAutoButR(block, ptr, prop, te->index, NULL, ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
+				uiDefAutoButR(block, ptr, prop, te->index, "", ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
 				              UI_UNIT_Y - 1);
 			}
 		}




More information about the Bf-blender-cvs mailing list