[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24800] trunk/blender/source/blender: Various bugfixes:

Joshua Leung aligorith at gmail.com
Mon Nov 23 10:47:56 CET 2009


Revision: 24800
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24800
Author:   aligorith
Date:     2009-11-23 10:47:56 +0100 (Mon, 23 Nov 2009)

Log Message:
-----------
Various bugfixes:
* Tweaked the code for operator buttons so that only those operator buttons in the toolbar have their text left-aligned. This is done at layout-block level

* Silenced "file_init" print when opening the file browser

* Disabled animateability of the "active_shape_key_index" for Objects, since this property behaves in a very unpredictable manner, leading to problems with users trying to keyframe shapekey values and ending up keying the list. 

* Remove some unnecessary RNA wrapping code

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/fmodifier_ui.c
    trunk/blender/source/blender/editors/include/UI_interface.h
    trunk/blender/source/blender/editors/interface/interface_layout.c
    trunk/blender/source/blender/editors/interface/interface_widgets.c
    trunk/blender/source/blender/editors/screen/area.c
    trunk/blender/source/blender/editors/space_file/space_file.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c

Modified: trunk/blender/source/blender/editors/animation/fmodifier_ui.c
===================================================================
--- trunk/blender/source/blender/editors/animation/fmodifier_ui.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/animation/fmodifier_ui.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -331,7 +331,6 @@
 static void draw_modifier__sound(const bContext *C, uiLayout *layout, ID *id, FModifier *fcm, short width)
 {
 	FMod_Sound *data= (FMod_Sound *)fcm->data;
-	uiLayout *split, *col;
 	PointerRNA ptr;
 	
 	/* init the RNA-pointer */
@@ -348,16 +347,9 @@
 			/* blending mode */
 			uiItemR(layout, NULL, 0, &ptr, "modification", 0);
 			
-			/* split into 2 columns */
-			split= uiLayoutSplit(layout, 0.5f);
-			
-			/* col 1 */
-			col= uiLayoutColumn(split, 0);
-			uiItemR(col, NULL, 0, &ptr, "strength", 0);
-			
-			/* col 2 */
-			col= uiLayoutColumn(split, 0);
-			uiItemR(col, NULL, 0, &ptr, "delay", 0);
+			/* settings */
+			uiItemR(layout, NULL, 0, &ptr, "strength", 0);
+			uiItemR(layout, NULL, 0, &ptr, "delay", 0);
 		}
 		else
 		{

Modified: trunk/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface.h	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/include/UI_interface.h	2009-11-23 09:47:56 UTC (rev 24800)
@@ -560,6 +560,7 @@
 #define UI_LAYOUT_PANEL			0
 #define UI_LAYOUT_HEADER		1
 #define UI_LAYOUT_MENU			2
+#define UI_LAYOUT_TOOLBAR		3
  
 #define UI_UNIT_X				20
 #define UI_UNIT_Y				20

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -629,7 +629,11 @@
 		but= uiDefIconButO(block, BUT, ot->idname, context, icon, 0, 0, w, UI_UNIT_Y, NULL);
 	else
 		but= uiDefButO(block, BUT, ot->idname, context, (char*)name, 0, 0, w, UI_UNIT_Y, NULL);
-
+	
+	/* text alignment for toolbar buttons */
+	if((layout->root->type == UI_LAYOUT_TOOLBAR) && !icon)
+		but->flag |= UI_TEXT_LEFT;
+	
 	/* assign properties */
 	if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
 		PointerRNA *opptr= uiButGetOperatorPtrRNA(but);

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -2451,9 +2451,6 @@
 				
 			case BUT:
 				wt= widget_type(UI_WTYPE_EXEC);
-				if (!(but->flag & UI_HAS_ICON)) {
-					but->flag |= UI_TEXT_LEFT;
-				}
 				break;
 
 			case NUM:

Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/screen/area.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -1272,7 +1272,15 @@
 			}
 
 			if(open) {
-				panel->layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
+				short panelContext;
+				
+				/* panel context can either be toolbar region or normal panels region */
+				if (ar->regiontype == RGN_TYPE_TOOLS)
+					panelContext= UI_LAYOUT_TOOLBAR;
+				else
+					panelContext= UI_LAYOUT_PANEL;
+				
+				panel->layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, panelContext,
 					style->panelspace, 0, w-2*style->panelspace, em, style);
 
 				pt->draw(C, panel);

Modified: trunk/blender/source/blender/editors/space_file/space_file.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/space_file.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/editors/space_file/space_file.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -156,7 +156,7 @@
 static void file_init(struct wmWindowManager *wm, ScrArea *sa)
 {
 	SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
-	printf("file_init\n");
+	//printf("file_init\n");
 
 	if(sfile->layout) sfile->layout->dirty= 1;
 }

Modified: trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_fcurve.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/makesrna/intern/rna_fcurve.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -229,11 +229,6 @@
 	return remove_fmodifier_index(&fcu->modifiers, index);
 }
 
-static int rna_Sound_id_editable(PointerRNA *ptr)
-{
-	return PROP_EDITABLE;
-}
-
 #else
 
 static void rna_def_fmodifier_generator(BlenderRNA *brna)
@@ -578,7 +573,6 @@
 	prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Sound");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
-	RNA_def_property_editable_func(prop, "rna_Sound_id_editable");
 	RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this modifier.");
 
 }

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -1800,6 +1800,7 @@
 
 	prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "shapenr");
+	RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); // XXX this is really unpredictable...
 	RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range");
 	RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index.");
 	RNA_def_property_update(prop, 0, "rna_Object_active_shape_update");

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2009-11-23 09:28:42 UTC (rev 24799)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2009-11-23 09:47:56 UTC (rev 24800)
@@ -2340,7 +2340,6 @@
 	prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "set");
 	RNA_def_property_struct_type(prop, "Scene");
-	//RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
 	RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
 	RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
 	RNA_def_property_ui_text(prop, "Set Scene", "Background set scene.");





More information about the Bf-blender-cvs mailing list