[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18204] branches/blender2.5/blender/source /blender/editors: 2.5

Martin Poirier theeth at yahoo.com
Wed Dec 31 23:43:30 CET 2008


Revision: 18204
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18204
Author:   theeth
Date:     2008-12-31 23:43:29 +0100 (Wed, 31 Dec 2008)

Log Message:
-----------
2.5

- Transform for editmesh (including PET and editmesh snap) X-Mirror doesn't seem to work, but the option isn't accessible in the UI, so...

- Replacing G.obedit with obedit from context in view3d_header (other files will have to be done too, I just happened to stumble on that one while fixing other things).

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
    branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh.h
    branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
    branches/blender2.5/blender/source/blender/editors/transform/transform.h
    branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c

Modified: branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h	2008-12-31 20:35:20 UTC (rev 18203)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h	2008-12-31 22:43:29 UTC (rev 18204)
@@ -36,6 +36,7 @@
 struct ListBase;
 struct wmEvent;
 struct bContext;
+struct Object;
 
 void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid);
 void transform_operatortypes(void);
@@ -99,7 +100,7 @@
 void BIF_setLocalAxisConstraint(char axis, char *text);
 void BIF_setLocalLockConstraint(char axis, char *text);
 
-int BIF_snappingSupported(void);
+int BIF_snappingSupported(struct Object *obedit);
 
 struct TransformOrientation;
 

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h	2008-12-31 20:35:20 UTC (rev 18203)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h	2008-12-31 22:43:29 UTC (rev 18204)
@@ -68,6 +68,7 @@
 /* meshtools.c */
 
 intptr_t	mesh_octree_table(Object *ob, EditMesh *em, float *co, char mode);
+EditVert   *editmesh_get_x_mirror_vert(Object *ob, EditMesh *em, float *co);
 
 /* editmesh.c */
 void		make_editMesh(Scene *scene, Object *ob);

Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c	2008-12-31 20:35:20 UTC (rev 18203)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh.c	2008-12-31 22:43:29 UTC (rev 18204)
@@ -1855,6 +1855,9 @@
 {
 	UndoMesh *um= umv;
 	
+	if (um == NULL)
+		return; /* XXX FIX ME, THIS SHOULD NEVER BE TRUE YET IT HAPPENS DURING TRANSFORM */
+	
 	if(um->verts) MEM_freeN(um->verts);
 	if(um->edges) MEM_freeN(um->edges);
 	if(um->faces) MEM_freeN(um->faces);

Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh.h	2008-12-31 20:35:20 UTC (rev 18203)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh.h	2008-12-31 22:43:29 UTC (rev 18204)
@@ -46,7 +46,6 @@
 
 /* ******************* meshtools.c */
 
-EditVert *editmesh_get_x_mirror_vert(Object *ob, EditMesh *em, float *co);
 int mesh_get_x_mirror_vert(Object *ob, int index);
 
 /* XXX move to uv editor? */

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	2008-12-31 20:35:20 UTC (rev 18203)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c	2008-12-31 22:43:29 UTC (rev 18204)
@@ -106,8 +106,8 @@
 #define V3D_POSEMODE_SEL			ICON_POSE_HLT
 #define V3D_PARTICLEEDITMODE_SEL	ICON_ANIM
 
-#define TEST_EDITMESH	if(G.obedit==0) return; \
-						if( (v3d->lay & G.obedit->lay)==0 ) return;
+#define TEST_EDITMESH	if(obedit==0) return; \
+						if( (v3d->lay & obedit->lay)==0 ) return;
 
 /* XXX port over */
 static void handle_view3d_lock(void) {}
@@ -120,7 +120,6 @@
 static void toggle_blockhandler(void *x, int y, int z) {}
 static void countall(void) {}
 extern void borderselect();
-static int BIF_snappingSupported() {return 1;}
 static int retopo_mesh_paint_check() {return 0;}
 
 /* view3d handler codes */
@@ -401,6 +400,7 @@
 	Scene *scene= CTX_data_scene(C);
 	ScrArea *sa= CTX_wm_area(C);
 	View3D *v3d= sa->spacedata.first;
+	Object *obedit = CTX_data_edit_object(C);
 	float *curs;
 	
 	switch(event) {
@@ -408,7 +408,7 @@
 	case 0: /* Align View to Selected (edit/faceselect mode) */
 	case 1:
 	case 2:
-		if ((G.obedit) && (G.obedit->type == OB_MESH)) {
+		if ((obedit) && (obedit->type == OB_MESH)) {
 			editmesh_align_view_to_selected(v3d, event + 1);
 		} 
 		else if (FACESEL_PAINT_TEST) {
@@ -454,6 +454,7 @@
 {
 /*		static short tog=0; */
 	uiBlock *block;
+	Object *obedit = CTX_data_edit_object(C);
 	short yco= 0, menuwidth=120;
 	
 	block= uiBeginBlock(C, handle->region, "view3d_view_alignviewmenu", UI_EMBOSSP, UI_HELV);
@@ -463,7 +464,7 @@
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");	
 
-	if (((G.obedit) && (G.obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) {
+	if (((obedit) && (obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) {
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
@@ -1797,8 +1798,8 @@
 		Transform();
 		break;
 	case 9:
-		if (G.obedit) {
-			if (G.obedit->type == OB_MESH)
+		if (obedit) {
+			if (obedit->type == OB_MESH)
 				initTransform(TFM_SHRINKFATTEN, CTX_NONE);
 				Transform();
 		} else error("Only meshes can be shrinked/fattened");
@@ -1849,6 +1850,7 @@
 static uiBlock *view3d_transformmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
 {
 	Scene *scene= CTX_data_scene(C);
+	Object *obedit = CTX_data_edit_object(C);
 	uiBlock *block;
 	short yco = 20, menuwidth = 120;
 
@@ -1866,21 +1868,21 @@
 
 	uiDefBut(block, SEPR, 0, "",			0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 	
-	if (G.obedit) {
- 		if (G.obedit->type == OB_MESH)
+	if (obedit) {
+ 		if (obedit->type == OB_MESH)
  			uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-		else if (G.obedit->type == OB_CURVE) {
+		else if (obedit->type == OB_CURVE) {
 			uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
 			uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Radius|Alt S",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
 		}
  	}
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Sphere|Ctrl Shift S",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-	if (G.obedit) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+	if (obedit) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
 	else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl Shift Alt S",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Shift W",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Push/Pull|Shift P",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
 	
-	if (!G.obedit) {
+	if (!obedit) {
 		uiDefBut(block, SEPR, 0, "",			0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 		
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale to Image Aspect Ratio|Alt V",		0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
@@ -1889,13 +1891,13 @@
 	uiDefBut(block, SEPR, 0, "",                    0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData to Center",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-	if (!G.obedit) {
+	if (!obedit) {
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center New",             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor",          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
 		uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align to Transform Orientation|Ctrl Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
 	}
 	
-	if (BIF_snappingSupported())
+	if (BIF_snappingSupported(obedit))
 	{
 		uiDefBut(block, SEPR, 0, "",                    0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 	
@@ -2665,7 +2667,7 @@
 		count= removedoublesflag(1, 0, scene->toolsettings->doublimit);
 		notice("Removed: %d", count);
 		if (count) { /* only undo and redraw if an action is taken */
-			DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+			DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 			ED_undo_push(C, "Rem Doubles");
 		}
 		break;
@@ -2680,7 +2682,7 @@
 		break;
 	case 5: /*merge */
 		mergemenu();
-		DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+		DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 		break;
 	case 6: /* add hook */
 		add_hook_menu();
@@ -2784,7 +2786,7 @@
 		if(EdgeLoopDelete()) {
 			countall();
 			ED_undo_push(C, "Erase Edge Loop");
-			DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+			DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 		}
 		break;
 	case 14: /*Collapse Edges*/
@@ -2794,12 +2796,12 @@
 	case 15:
 		editmesh_mark_sharp(1);
 		ED_undo_push(C, "Mark Sharp");
-		DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+		DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 		break;
 	case 16:
 		editmesh_mark_sharp(0);
 		ED_undo_push(C, "Clear Sharp");
-		DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+		DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 		break;
 	case 17: /* Adjust Bevel Weight */
 		if(!multires_level1_test()) {
@@ -2880,7 +2882,7 @@
 		convert_to_triface(0);
 		allqueue(REDRAWVIEW3D, 0);
 		countall();
-		DAG_object_flush_update(scene, G.obedit, OB_RECALC_DATA);
+		DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 		break;
 	case 3: /* Tris to Quads */
 		join_triangles();
@@ -3178,6 +3180,7 @@
 static uiBlock *view3d_edit_meshmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
 {
 	Scene *scene= CTX_data_scene(C);
+	Object *obedit = CTX_data_edit_object(C);
 	uiBlock *block;
 	short yco= 0, menuwidth=120;
 		
@@ -3234,7 +3237,7 @@

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list