[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22511] branches/blender2.5/blender: 2. 5 3DView Header:

Thomas Dinges dingto at gmx.de
Sun Aug 16 14:52:57 CEST 2009


Revision: 22511
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22511
Author:   dingto
Date:     2009-08-16 14:52:57 +0200 (Sun, 16 Aug 2009)

Log Message:
-----------
2.5 3DView Header:

* Sculpt Menu is now written in python.
* Select Menus are only for Object, Edit and Particle Mode, added code to check on that, fixed Console warnings.

* Fixed a typo in armature buttons, reported in IRC by "ebrain".

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_armature.py
    branches/blender2.5/blender/release/ui/space_view3d.py
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c

Modified: branches/blender2.5/blender/release/ui/buttons_data_armature.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_armature.py	2009-08-16 12:29:46 UTC (rev 22510)
+++ branches/blender2.5/blender/release/ui/buttons_data_armature.py	2009-08-16 12:52:57 UTC (rev 22511)
@@ -43,7 +43,7 @@
 		col = split.column()
 		col.itemR(arm, "rest_position")
 		col.itemL(text="Deform:")
-		col.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
+		col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
 		col.itemR(arm, "deform_envelope", text="Envelopes")
 		col.itemR(arm, "deform_quaternion", text="Quaternion")
 		col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")

Modified: branches/blender2.5/blender/release/ui/space_view3d.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d.py	2009-08-16 12:29:46 UTC (rev 22510)
+++ branches/blender2.5/blender/release/ui/space_view3d.py	2009-08-16 12:52:57 UTC (rev 22511)
@@ -21,11 +21,14 @@
 			row.itemM("VIEW3D_MT_view")
 			
 			# Select Menu
-			if mode_string not in ('EDIT_TEXT', ):
+			if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'):
+				# XXX: Particle Mode has Select Menu.
 				row.itemM("VIEW3D_MT_select_%s" % mode_string)
 			
 			if mode_string == 'OBJECT':
 				row.itemM("VIEW3D_MT_object")
+			elif mode_string == 'SCULPT':
+				row.itemM("VIEW3D_MT_sculpt")
 
 		layout.template_header_3D()
 
@@ -461,6 +464,42 @@
 		layout.itemO("object.restrictview_set")
 		layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
 
+# ********** Sculpt menu **********	
+	
+class VIEW3D_MT_sculpt(bpy.types.Menu):
+	__space_type__ = "VIEW_3D"
+	__label__ = "Sculpt"
+
+	def draw(self, context):
+		layout = self.layout
+		
+		sculpt = context.tool_settings.sculpt
+		brush = context.tool_settings.sculpt.brush
+		
+		layout.itemR(sculpt, "symmetry_x")
+		layout.itemR(sculpt, "symmetry_y")
+		layout.itemR(sculpt, "symmetry_z")
+		layout.itemS()
+		layout.itemR(sculpt, "lock_x")
+		layout.itemR(sculpt, "lock_y")
+		layout.itemR(sculpt, "lock_z")
+		layout.itemS()
+		layout.item_menu_enumO("brush.curve_preset", property="shape")
+		layout.itemS()
+		
+		if brush.sculpt_tool != 'GRAB':
+			layout.itemR(brush, "airbrush")
+			
+			if brush.sculpt_tool != 'LAYER':
+				layout.itemR(brush, "anchored")
+			
+			if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
+				layout.itemR(brush, "flip_direction")
+
+			if brush.sculpt_tool == 'LAYER':
+				layout.itemR(brush, "persistent")
+				layout.itemO("sculpt.set_persistent_base")
+
 # ********** Panel **********
 
 class VIEW3D_PT_3dview_properties(bpy.types.Panel):
@@ -589,6 +628,8 @@
 bpy.types.register(VIEW3D_MT_object_constraints)
 bpy.types.register(VIEW3D_MT_object_show)
 
+bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
+
 bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
 bpy.types.register(VIEW3D_PT_3dview_display)
 bpy.types.register(VIEW3D_PT_background_image)

Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c	2009-08-16 12:29:46 UTC (rev 22510)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c	2009-08-16 12:52:57 UTC (rev 22511)
@@ -2933,91 +2933,6 @@
 	return block;
 }
 
-static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused)
-{
-	bScreen *sc= CTX_wm_screen(C);
-	Sculpt *s = CTX_data_tool_settings(C)->sculpt;
-	PointerRNA rna;
-
-	RNA_pointer_create(&sc->id, &RNA_Sculpt, s, &rna);
-
-	uiItemR(layout, NULL, 0, &rna, "symmetry_x", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "symmetry_y", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "symmetry_z", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "lock_x", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "lock_y", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "lock_z", 0, 0, 0);
-
-	/* Brush settings */
-	RNA_pointer_create(&sc->id, &RNA_Brush, s->brush, &rna);
-
-	/* Curve */
-	uiItemS(layout);
-	uiItemEnumO(layout, NULL, 0, "BRUSH_OT_curve_preset", "shape", BRUSH_PRESET_SHARP);
-	uiItemEnumO(layout, NULL, 0, "BRUSH_OT_curve_preset", "shape", BRUSH_PRESET_SMOOTH);
-	uiItemEnumO(layout, NULL, 0, "BRUSH_OT_curve_preset", "shape", BRUSH_PRESET_MAX);
-
-	uiItemS(layout);
-
-	uiItemR(layout, NULL, 0, &rna, "airbrush", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "rake", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "space", 0, 0, 0);
-	uiItemR(layout, NULL, 0, &rna, "smooth_stroke", 0, 0, 0);
-
-	uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0, 0);
-}
-
-uiBlock *view3d_sculptmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
-	ScrArea *sa= CTX_wm_area(C);
-	View3D *v3d= sa->spacedata.first;
-	uiBlock *block;
-	Sculpt *sd= CTX_data_tool_settings(C)->sculpt;
-// XXX	const BrushData *br= sculptmode_brush();
-	short yco= 0, menuwidth= 120;
-	
-	block= uiBeginBlock(C, ar, "view3d_sculptmenu", UI_EMBOSSP);
-	uiBlockSetButmFunc(block, do_view3d_sculptmenu, NULL);
-	
-	uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Sculpt Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
-	uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-	uiDefIconTextBlockBut(block, view3d_sculpt_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input Settings", 0, yco-=20, 120, 19, "");
-	uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-	uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-	uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-	if(v3d)
-		uiDefIconTextBut(block, BUTM, 1, (v3d->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
-	uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-	
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Brush|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strengthen Brush|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Brush|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-	
-	uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-	/* XXX uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==FLATTEN_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Flatten|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-	uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw|D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");*/
-	
-
-	if(ar->alignment==RGN_ALIGN_TOP) {
-		uiBlockSetDirection(block, UI_DOWN);
-	}
-	else {
-		uiBlockSetDirection(block, UI_TOP);
-		uiBlockFlipOrder(block);
-	}
-
-	uiTextBoundsBlock(block, 50);
-
-	return block;
-}
-
 static void do_view3d_facesel_showhidemenu(bContext *C, void *arg, int event)
 {
 #if 0
@@ -3579,11 +3494,6 @@
 		uiDefPulldownBut(block, view3d_tpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, "");
 		xco+= xmax;
 	}
-	else if (ob && ob->mode & OB_MODE_SCULPT) {
-		xmax= GetButStringLength("Sculpt");
-		uiDefMenuBut(block, view3d_sculpt_menu, NULL, "Sculpt", xco, yco, xmax-3, 20, "");
-		xco+= xmax;
-	}
 	else if (paint_facesel_test(ob)) {
 		if (ob && ob->type == OB_MESH) {
 			xmax= GetButStringLength("Face");





More information about the Bf-blender-cvs mailing list