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

Thomas Dinges dingto at gmx.de
Sun Aug 2 18:44:32 CEST 2009


Revision: 22149
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22149
Author:   dingto
Date:     2009-08-02 18:44:32 +0200 (Sun, 02 Aug 2009)

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

* Removed redundant color picker panels from the Properties Panel.
* Deleted some old C Buttons Code. (Background Image, Weight Paint, View and the Color pickers.)
* Added missing Particle Mode Buttons into the Toolbar. They need a check if the system is editable or not. 
* Pose Mode Panels in Toolbar were not working due to wrong context. Fixed. 

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

Modified: branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-08-02 16:23:18 UTC (rev 22148)
+++ branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-08-02 16:44:32 UTC (rev 22149)
@@ -252,7 +252,7 @@
 class View3DPanel(bpy.types.Panel):
 	__space_type__ = "VIEW_3D"
 	__region_type__ = "TOOLS"
-	__context__ = "posemode"
+	__context__ = "pose_mode"
 
 class VIEW3D_PT_tools_posemode(View3DPanel):
 	__label__ = "Pose Tools"
@@ -325,8 +325,25 @@
 		settings = self.paint_settings(context)
 		brush = settings.brush
 
+		# XXX This needs a check if psys is editable.
 		if context.particle_edit_object:
 			layout.column().itemR(settings, "tool", expand=True)
+			if settings.tool != 'NONE':
+				col = layout.column(align=True)
+				col.itemR(brush, "size", slider=True)
+				col.itemR(brush, "strength", slider=True)
+				
+			if settings.tool == 'ADD':
+				layout.itemR(settings, "add_interpolate")
+				
+				col = layout.column()
+				col.itemR(brush, "steps", slider=True)
+				col.itemR(settings, "add_keys", slider=True)
+			elif settings.tool == 'LENGTH':
+				layout.itemR(brush, "length_mode", expand=True)
+			elif settings.tool == 'PUFF':
+				layout.itemR(brush, "puff_mode", expand=True)
+				
 		else:
 			layout.split().row().template_ID(settings, "brush")
 
@@ -354,7 +371,7 @@
 			row = col.row(align=True)
 			row.itemR(brush, "falloff", slider=True)
 			row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
-			if context.vertex_paint_object:
+			if context.vertex_paint_object or context.texture_paint_object:
 				col.itemR(brush, "color", text="")
 			if context.texture_paint_object:
 				row = col.row(align=True)
@@ -443,6 +460,8 @@
 #		col.itemL(text="Multiply:")
 #		col.itemR(wpaint, "mul", text="")
 
+# Also missing now:
+# Soft, Vgroup, X-Mirror and "Clear" Operator.
 
 # ********** default tools for vertexpaint ****************
 
@@ -513,11 +532,20 @@
 		pe = context.tool_settings.particle_edit
 
 		col = layout.column(align=True)
-
 		col.itemR(pe, "emitter_deflect", text="Deflect")
 		sub = col.row()
+		sub.active = pe.emitter_deflect
 		sub.itemR(pe, "emitter_distance", text="Distance")
-		sub.active = pe.emitter_deflect
+		
+		col = layout.column(align=True)
+		col.itemL(text="Keep:")
+		col.itemR(pe, "keep_lengths", text="Lenghts")
+		col.itemR(pe, "keep_root", text="Root")
+		
+		col = layout.column(align=True)
+		col.itemL(text="Draw:")
+		col.itemR(pe, "show_time", text="Time")
+		col.itemR(pe, "show_children", text="Children")
 
 bpy.types.register(VIEW3D_PT_tools_objectmode)
 bpy.types.register(VIEW3D_PT_tools_editmode_mesh)

Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c	2009-08-02 16:23:18 UTC (rev 22148)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c	2009-08-02 16:44:32 UTC (rev 22149)
@@ -1002,74 +1002,6 @@
 }
 #endif // XXX not used
 
-static void weight_paint_buttons(Scene *scene, uiBlock *block)
-{
-	VPaint *wpaint= scene->toolsettings->wpaint;
-	Object *ob;
-	ob= OBACT;
-	
-	if(ob==NULL || ob->type!=OB_MESH) return;
-
-	/* XXX	
-	uiBlockBeginAlign(block);
-	uiDefButF(block, NUMSLI, B_REDR, "Weight:",10,170,225,19, &wpaint->weight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength");
-	
-	uiDefBut(block, BUT, B_WEIGHT0_0 , "0",			 10,150,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_WEIGHT1_4 , "1/4",		 55,150,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_WEIGHT1_2 , "1/2",		 100,150,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_WEIGHT3_4 , "3/4",		 145,150,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_WEIGHT1_0 , "1",			 190,150,45,19, 0, 0, 0, 0, 0, "");
-	
-	uiDefButF(block, NUMSLI, B_NOP, "Opacity ",		10,130,225,19, &wpaint->a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
-	
-	uiDefBut(block, BUT, B_OPA1_8 , "1/8",		10,110,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_OPA1_4 , "1/4",		55,110,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_OPA1_2 , "1/2",		100,110,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_OPA3_4 , "3/4",		145,110,45,19, 0, 0, 0, 0, 0, "");
-	uiDefBut(block, BUT, B_OPA1_0 , "1",		190,110,45,19, 0, 0, 0, 0, 0, "");
-	
-	uiDefButF(block, NUMSLI, B_NOP, "Size ",	10,90,225,19, &wpaint->size, 2.0, 64.0, 0, 0, "The size of the brush");
-	
-	uiBlockBeginAlign(block);
-	uiDefButS(block, ROW, B_NOP, "Mix",		250,170,60,17, &wpaint->mode, 1.0, 0.0, 0, 0, "Mix the vertex colors");
-	uiDefButS(block, ROW, B_NOP, "Add",		250,152,60,17, &wpaint->mode, 1.0, 1.0, 0, 0, "Add the vertex colors");
-	uiDefButS(block, ROW, B_NOP, "Sub",		250,134,60,17, &wpaint->mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
-	uiDefButS(block, ROW, B_NOP, "Mul",		250,116,60,17, &wpaint->mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
-	uiDefButS(block, ROW, B_NOP, "Blur",		250, 98,60,17, &wpaint->mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values");
-	uiDefButS(block, ROW, B_NOP, "Lighter",	250, 80,60,17, &wpaint->mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
-	uiDefButS(block, ROW, B_NOP, "Darker",		250, 62,60,17, &wpaint->mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
-	uiBlockEndAlign(block);
-	*/
-	
-	/* draw options same as below */
-	uiBlockBeginAlign(block);
-	if (FACESEL_PAINT_TEST) {
-		Mesh *me= ob->data;
-		uiDefButBitI(block, TOG, ME_DRAWFACES, B_REDR, "Faces",	10,45,60,19, &me->drawflag, 0, 0, 0, 0, "Displays all faces as shades");
-		uiDefButBitI(block,TOG, ME_DRAWEDGES, B_REDR,"Edges",70,45,60,19, &me->drawflag, 2.0, 0, 0, 0,  "Displays edges of visible faces");
-	 	uiDefButBitI(block,TOG, ME_HIDDENEDGES, B_REDR,"Hidden Edges",130,45,100,19, &me->drawflag, 2.0, 1.0, 0, 0,  "Displays edges of hidden faces");
-	} else{ 
- 		uiDefButBitC(block, TOG, OB_DRAWWIRE, B_REDR, "Wire",	10,45,75,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
-	}
-	uiBlockEndAlign(block);
-	
-	uiBlockBeginAlign(block);
-	uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 	10,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Paint on all faces inside brush (otherwise only on face under mouse cursor)");
-	uiDefButBitS(block, TOG, VP_SOFT, 0, "Vert Dist", 70,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Use distances to vertices (instead of all vertices of face)");
-	uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft",		130,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Use a soft brush");
-	uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 	190,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
-	uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray",		250,20,55,19, &wpaint->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
-	uiBlockEndAlign(block);
-	
-	if(ob) {
-		uiBlockBeginAlign(block);
-		uiDefButBitS(block, TOG, VP_ONLYVGROUP, B_REDR, "Vgroup",		10,0,100,19, &wpaint->flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group.");
-		uiDefButBitS(block, TOG, VP_MIRROR_X, B_REDR, "X-Mirror",	110,0,100,19, &wpaint->flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name");
-		uiDefBut(block, BUT, B_CLR_WPAINT, "Clear",					210,0,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices");
-		uiBlockEndAlign(block);
-	}
-}
-
 static void brush_idpoin_handle(bContext *C, ID *id, int event)
 {
 	Brush **br = current_brush_source(CTX_data_scene(C));
@@ -1155,23 +1087,6 @@
 	else if(ob->flag & OB_POSEMODE) {
 		v3d_posearmature_buts(block, v3d, ob, lim);
 	}
-	else if(G.f & G_WEIGHTPAINT) {
-		BLI_strncpy(pa->drawname, "Weight Paint Properties", sizeof(pa->drawname));
-		weight_paint_buttons(scene, block);
-	}
-	else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) {
-		static float hsv[3], old[3];	// used as temp mem for picker
-		Brush **br = current_brush_source(scene);
-
-		BLI_strncpy(pa->drawname, "Paint Properties", sizeof(pa->drawname));
-		if(br && *br)
-			/* 'f' is for floating panel */
-			uiBlockPickerButtons(block, (*br)->rgb, hsv, old, hexcol, 'f', B_REDR);
-	}
-	else if(G.f & G_PARTICLEEDIT){
-		BLI_strncpy(pa->drawname, "Particle Edit Properties", sizeof(pa->drawname));
-// XXX		particle_edit_buttons(block);
-	} 
 	else {
 		BoundBox *bb = NULL;
 		
@@ -1257,133 +1172,6 @@
 	}
 }
 
-#if 0 // XXX not used anymore
-static void view3d_panel_background(const bContext *C, Panel *pa)
-{
-	View3D *v3d= CTX_wm_view3d(C);
-	uiBlock *block;
-
-	block= uiLayoutFreeBlock(pa->layout);
-	uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
-
-	if(v3d->flag & V3D_DISPBGPIC) {
-		if(v3d->bgpic==NULL) {
-			v3d->bgpic= MEM_callocN(sizeof(BGpic), "bgpic");
-			v3d->bgpic->size= 5.0;
-			v3d->bgpic->blend= 0.5;
-			v3d->bgpic->iuser.fie_ima= 2;
-			v3d->bgpic->iuser.ok= 1;
-		}
-	}
-	
-	if(!(v3d->flag & V3D_DISPBGPIC)) {
-		uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use Background Image", 10, 180, 150, 20, &v3d->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
-		uiDefBut(block, LABEL, 1, " ",	160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
-	}
-	else {
-		uiBlockBeginAlign(block);
-		uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use", 10, 225, 50, 20, &v3d->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
-		uiDefButF(block, NUMSLI, B_REDR, "Blend:",	60, 225, 150, 20, &v3d->bgpic->blend, 0.0,1.0, 0, 0, "Set the transparency of the background image");
-		uiDefButF(block, NUM, B_REDR, "Size:",		210, 225, 100, 20, &v3d->bgpic->size, 0.1, 250.0*v3d->grid, 100, 0, "Set the size (width) of the background image");
-
-		uiDefButF(block, NUM, B_REDR, "X Offset:",	10, 205, 150, 20, &v3d->bgpic->xof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the horizontal offset of the background image");
-		uiDefButF(block, NUM, B_REDR, "Y Offset:",	160, 205, 150, 20, &v3d->bgpic->yof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the vertical offset of the background image");
-		
-		ED_image_uiblock_panel(C, block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR);
-		uiBlockEndAlign(block);
-	}
-}
-
-
-static void view3d_panel_properties(const bContext *C, Panel *pa)
-{
-	ScrArea *sa= CTX_wm_area(C);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list