[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41177] branches/soc-2011-tomato/source/ blender/modifiers/intern/MOD_uvproject.c: Camera tracking integration

Sergey Sharybin g.ulairi at gmail.com
Fri Oct 21 11:18:07 CEST 2011


Revision: 41177
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41177
Author:   nazgul
Date:     2011-10-21 09:18:07 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
Camera tracking integration
===========================

Fix for UV Project modifier: use sensor size from projector's camera
rather than from scene's camera.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_uvproject.c

Modified: branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_uvproject.c
===================================================================
--- branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_uvproject.c	2011-10-21 09:15:22 UTC (rev 41176)
+++ branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_uvproject.c	2011-10-21 09:18:07 UTC (rev 41177)
@@ -162,15 +162,7 @@
 	float scax= umd->scalex ? umd->scalex : 1.0f;
 	float scay= umd->scaley ? umd->scaley : 1.0f;
 	int free_uci= 0;
-	float sensor_x= 32.0f;
-	Scene *scene= umd->modifier.scene;
-	
-	if(scene && scene->camera && scene->camera->type == OB_CAMERA) {
-		Camera *camera= (Camera*)scene->camera->data;
 
-		sensor_x= camera->sensor_x;
-	}
-	
 	aspect = aspx / aspy;
 
 	for(i = 0; i < umd->num_projectors; ++i)
@@ -205,7 +197,7 @@
 				free_uci= 1;
 			}
 			else {
-				float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor_x / cam->lens : cam->ortho_scale;
+				float scale= (cam->type == CAM_PERSP) ? cam->clipsta * cam->sensor_x / cam->lens : cam->ortho_scale;
 				float xmax, xmin, ymax, ymin;
 
 				if(aspect > 1.0f) {




More information about the Bf-blender-cvs mailing list