[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24161] trunk/blender/source/blender: various small fixes

Campbell Barton ideasman42 at gmail.com
Thu Oct 29 19:49:36 CET 2009


Revision: 24161
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24161
Author:   campbellbarton
Date:     2009-10-29 19:49:36 +0100 (Thu, 29 Oct 2009)

Log Message:
-----------
various small fixes
- undo stops all running jobs (operator redo was crashing with threaded render)
- adding new armatures was crashing if there was no valid view3d
- transform with an active hidden object would crash

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/blender.c
    trunk/blender/source/blender/editors/armature/editarmature.c
    trunk/blender/source/blender/editors/curve/editcurve.c
    trunk/blender/source/blender/editors/metaball/mball_edit.c
    trunk/blender/source/blender/editors/transform/transform_orientations.c

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/blender.c	2009-10-29 18:37:34 UTC (rev 24160)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c	2009-10-29 18:49:36 UTC (rev 24161)
@@ -536,6 +536,9 @@
 	char scestr[FILE_MAXDIR+FILE_MAXFILE];
 	int success=0, fileflags;
 	
+	/* This is needed so undoing/redoing doesnt crash with threaded previews going */
+	WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C));
+	
 	strcpy(scestr, G.sce);	/* temporal store */
 	fileflags= G.fileflags;
 	G.fileflags |= G_FILE_NO_UI;

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c	2009-10-29 18:37:34 UTC (rev 24160)
+++ trunk/blender/source/blender/editors/armature/editarmature.c	2009-10-29 18:49:36 UTC (rev 24161)
@@ -2242,7 +2242,7 @@
 
 	VECCOPY(bone->head, curs);
 	
-	if ( (U.flag & USER_ADD_VIEWALIGNED) )
+	if (rv3d && (U.flag & USER_ADD_VIEWALIGNED))
 		VecAddf(bone->tail, bone->head, imat[1]);	// bone with unit length 1
 	else
 		VecAddf(bone->tail, bone->head, imat[2]);	// bone with unit length 1, pointing up Z
@@ -3423,7 +3423,7 @@
 	Mat4Invert(obedit->imat, obedit->obmat);
 	Mat4MulVecfl(obedit->imat, curs);
 
-	if (U.flag & USER_ADD_VIEWALIGNED)
+	if (rv3d && (U.flag & USER_ADD_VIEWALIGNED))
 		Mat3CpyMat4(obmat, rv3d->viewmat);
 	else Mat3One(obmat);
 	
@@ -3438,7 +3438,7 @@
 
 	VECCOPY(bone->head, curs);
 	
-	if(U.flag & USER_ADD_VIEWALIGNED)
+	if(rv3d && (U.flag & USER_ADD_VIEWALIGNED))
 		VecAddf(bone->tail, bone->head, imat[1]);	// bone with unit length 1
 	else
 		VecAddf(bone->tail, bone->head, imat[2]);	// bone with unit length 1, pointing up Z

Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c	2009-10-29 18:37:34 UTC (rev 24160)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2009-10-29 18:49:36 UTC (rev 24161)
@@ -4729,7 +4729,7 @@
 		cent[2]-= obedit->obmat[3][2];
 		
 		if(rv3d) {
-			if (!newname && U.flag & USER_ADD_VIEWALIGNED)
+			if (!newname && (U.flag & USER_ADD_VIEWALIGNED))
 				Mat3CpyMat4(imat, rv3d->viewmat);
 			else
 				Mat3One(imat);

Modified: trunk/blender/source/blender/editors/metaball/mball_edit.c
===================================================================
--- trunk/blender/source/blender/editors/metaball/mball_edit.c	2009-10-29 18:37:34 UTC (rev 24160)
+++ trunk/blender/source/blender/editors/metaball/mball_edit.c	2009-10-29 18:49:36 UTC (rev 24161)
@@ -129,7 +129,7 @@
 	cent[2]-= obedit->obmat[3][2];
 
 	if (rv3d) {
-		if (!(newname) || U.flag & USER_ADD_VIEWALIGNED || !rv3d)
+		if (!(newname) || U.flag & USER_ADD_VIEWALIGNED)
 			Mat3CpyMat4(imat, rv3d->viewmat);
 		else
 			Mat3One(imat);

Modified: trunk/blender/source/blender/editors/transform/transform_orientations.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_orientations.c	2009-10-29 18:37:34 UTC (rev 24160)
+++ trunk/blender/source/blender/editors/transform/transform_orientations.c	2009-10-29 18:49:36 UTC (rev 24161)
@@ -518,6 +518,7 @@
 	Object *obedit = CTX_data_active_object(C);
 	float normal[3]={0.0, 0.0, 0.0};
 	float plane[3]={0.0, 0.0, 0.0};
+	
 
 	switch(t->current_orientation) {
 	case V3D_MANIP_GLOBAL:
@@ -530,7 +531,7 @@
 			gimbalAxis(ob, t->spacemtx);
 		break;
 	case V3D_MANIP_NORMAL:
-		if(obedit || ob->mode & OB_MODE_POSE) {
+		if(obedit || (ob && ob->mode & OB_MODE_POSE)) {
 			float mat[3][3];
 			int type;
 			
@@ -579,7 +580,12 @@
 		/* no break we define 'normal' as 'local' in Object mode */
 	case V3D_MANIP_LOCAL:
 		strcpy(t->spacename, "local");
-		Mat3CpyMat4(t->spacemtx, ob->obmat);
+		
+		if(ob)
+			Mat3CpyMat4(t->spacemtx, ob->obmat);
+		else
+			Mat3One(t->spacemtx);
+		
 		Mat3Ortho(t->spacemtx);
 		break;
 		





More information about the Bf-blender-cvs mailing list