[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59692] branches/soc-2013-ui_replay/source /blender/editors: Brushes are presented in a more space efficient manner.

Vincent Akkermans vincent at ack-err.net
Sat Aug 31 16:07:06 CEST 2013


Revision: 59692
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59692
Author:   ack-err
Date:     2013-08-31 14:07:05 +0000 (Sat, 31 Aug 2013)
Log Message:
-----------
Brushes are presented in a more space efficient manner. Color picker is now not a full blown widget, but a simple one.

* Fixed a bug whereby a variable wasn't declared at the start of a block.

Modified Paths:
--------------
    branches/soc-2013-ui_replay/source/blender/editors/armature/armature_relations.c
    branches/soc-2013-ui_replay/source/blender/editors/interface/interface_templates.c

Modified: branches/soc-2013-ui_replay/source/blender/editors/armature/armature_relations.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/armature/armature_relations.c	2013-08-31 11:01:55 UTC (rev 59691)
+++ branches/soc-2013-ui_replay/source/blender/editors/armature/armature_relations.c	2013-08-31 14:07:05 UTC (rev 59692)
@@ -695,9 +695,9 @@
 		OPERATOR_RETVAL_CHECK(retval);
 		return retval;
 	} else {
+		int allchildbones = 0;
 		pup = uiPupMenuBegin(C, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Make Parent"), ICON_NONE);
 		layout = uiPupMenuLayout(pup);
-		int allchildbones = 0;
 		
 		CTX_DATA_BEGIN(C, EditBone *, ebone, selected_editable_bones)
 		{

Modified: branches/soc-2013-ui_replay/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/interface/interface_templates.c	2013-08-31 11:01:55 UTC (rev 59691)
+++ branches/soc-2013-ui_replay/source/blender/editors/interface/interface_templates.c	2013-08-31 14:07:05 UTC (rev 59692)
@@ -649,44 +649,47 @@
 	
 	/* first row: text button with name */
 	row = uiLayoutRow(col, TRUE);
-	char name[UI_MAX_NAME_STR];
-	const short user_alert = (id->us <= 0);
+	
+	if (id) {
+		char name[UI_MAX_NAME_STR];
+		const short user_alert = id->us <= 0;
 
-	//text_idbutton(id, name);
-	name[0] = '\0';
-	but = uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y,
-					&idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
-	uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME));
-	if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
+		//text_idbutton(id, name);
+		name[0] = '\0';
+		but = uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y,
+						&idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
+		uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME));
+		if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
 
-	/* second row */
-	row = uiLayoutRow(col, TRUE);
-		
-	if (id->us > 1) {
-		char numstr[32];
+		/* second row */
+		row = uiLayoutRow(col, TRUE);
+			
+		if (id->us > 1) {
+			char numstr[32];
 
-		BLI_snprintf(numstr, sizeof(numstr), "%d", id->us);
+			BLI_snprintf(numstr, sizeof(numstr), "%d", id->us);
 
-		but = uiDefBut(block, BUT, 0, numstr, 0, 0, 6 * UI_UNIT_X + ((id->us < 10) ? 0 : 10), UI_UNIT_Y,
-					   NULL, 0, 0, 0, 0,
-					   TIP_("Display number of users of this data (click to make a single-user copy)"));
+			but = uiDefBut(block, BUT, 0, numstr, 0, 0, 6 * UI_UNIT_X + ((id->us < 10) ? 0 : 10), UI_UNIT_Y,
+						   NULL, 0, 0, 0, 0,
+						   TIP_("Display number of users of this data (click to make a single-user copy)"));
 
-		uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
-		if (/* test only */
-			(id_copy(id, NULL, true) == false) ||
-			(idfrom && idfrom->lib) ||
-			(editable == FALSE) ||
-			/* object in editmode - don't change data */
-			(idfrom && GS(idfrom->name) == ID_OB && (((Object *)idfrom)->mode & OB_MODE_EDIT)))
-		{
-			uiButSetFlag(but, UI_BUT_DISABLED);
+			uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
+			if (/* test only */
+				(id_copy(id, NULL, true) == false) ||
+				(idfrom && idfrom->lib) ||
+				(editable == FALSE) ||
+				/* object in editmode - don't change data */
+				(idfrom && GS(idfrom->name) == ID_OB && (((Object *)idfrom)->mode & OB_MODE_EDIT)))
+			{
+				uiButSetFlag(but, UI_BUT_DISABLED);
+			}
 		}
-	}
 
-	if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
-	
-	if (id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
-		uiDefButR(block, TOG, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL);
+		if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
+		
+		if (id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
+			uiDefButR(block, TOG, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL);
+		}
 	}
 	
 	if (flag & UI_ID_ADD_NEW) {




More information about the Bf-blender-cvs mailing list