[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27417] trunk/blender/source/blender/ editors/sculpt_paint/paint_image.c: re-project paint failed on no-camera when a camera wasnt needed.

Brecht Van Lommel brecht at blender.org
Thu Mar 11 18:16:04 CET 2010


Revision: 27417
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27417
Author:   blendix
Date:     2010-03-11 18:16:03 +0100 (Thu, 11 Mar 2010)

Log Message:
-----------
re-project paint failed on no-camera when a camera wasnt needed.
(revision 27388 from render25 branch)

Revision Links:
--------------
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27388

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2010-03-11 16:40:30 UTC (rev 27416)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2010-03-11 17:16:03 UTC (rev 27417)
@@ -5374,11 +5374,6 @@
 		return OPERATOR_CANCELLED;
 	}
 
-	if(scene->camera==NULL) {
-		BKE_report(op->reports, RPT_ERROR, "No active camera set.");
-		return OPERATOR_CANCELLED;
-	}
-
 	if(image==NULL) {
 		BKE_report(op->reports, RPT_ERROR, "Image could not be found.");
 		return OPERATOR_CANCELLED;
@@ -5392,15 +5387,8 @@
 		return OPERATOR_CANCELLED;
 	}
 
-	/* override */
-	ps.is_texbrush= 0;
-	ps.is_airbrush= 1;
-	orig_brush_size= ps.brush->size;
-	ps.brush->size= 32; /* cover the whole image */
+	idgroup= IDP_GetProperties(&image->id, 0);
 
-	ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */
-
-	idgroup= IDP_GetProperties(&image->id, 0);
 	if(idgroup) {
 		view_data= IDP_GetPropertyFromGroup(idgroup, PROJ_VIEW_DATA_ID);
 
@@ -5411,15 +5399,27 @@
 		}
 	}
 
-
 	if(view_data) {
 		/* image has stored view projection info */
 		ps.source= PROJ_SRC_IMAGE_VIEW;
 	}
 	else {
 		ps.source= PROJ_SRC_IMAGE_CAM;
+
+		if(scene->camera==NULL) {
+			BKE_report(op->reports, RPT_ERROR, "No active camera set.");
+			return OPERATOR_CANCELLED;
+		}
 	}
 
+	/* override */
+	ps.is_texbrush= 0;
+	ps.is_airbrush= 1;
+	orig_brush_size= ps.brush->size;
+	ps.brush->size= 32; /* cover the whole image */
+
+	ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */
+
 	scene->toolsettings->imapaint.flag |= IMAGEPAINT_DRAWING;
 
 	undo_paint_push_begin(UNDO_PAINT_IMAGE, "Image Paint",





More information about the Bf-blender-cvs mailing list