[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38196] branches/soc-2011-pepper/source/ blender/collada: Fixed Camera Ortho scale animation import

Sukhitha Jayathilake pr.jayathilake at gmail.com
Thu Jul 7 18:56:57 CEST 2011


Revision: 38196
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38196
Author:   phabtar
Date:     2011-07-07 16:56:56 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Fixed Camera Ortho scale animation import

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
    branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-07 16:34:23 UTC (rev 38195)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-07 16:56:56 UTC (rev 38196)
@@ -856,7 +856,7 @@
 		}
 	}
 
-	if ( ((animType & CAMERA_XFOV) != 0) )
+	if ( ((animType & CAMERA_XFOV) != 0) || (animType & CAMERA_XMAG) != 0 )
 	{
 		Camera * camera  = (Camera*) ob->data;
 
@@ -875,6 +875,13 @@
 				const COLLADAFW::UniqueId& listid = xfov->getAnimationList();
 				Assign_float_animations( listid ,AnimCurves, "lens"); 
 			}
+
+			else if ((animType & CAMERA_XMAG) != 0 )
+			{
+				const COLLADAFW::AnimatableFloat *xmag =  &(camera->getXMag());
+				const COLLADAFW::UniqueId& listid = xmag->getAnimationList();
+				Assign_float_animations( listid ,AnimCurves, "ortho_scale"); 
+			}
 		}
 	}
 }
@@ -932,17 +939,23 @@
 	for (unsigned int i = 0; i < nodeCameras.getCount(); i++) {
 		const COLLADAFW::Camera *camera = (COLLADAFW::Camera *) FW_object_map[nodeCameras[i]->getInstanciatedObjectId()];
 		
-		const COLLADAFW::AnimatableFloat *xfov =  &(camera->getXFov());
-	    const COLLADAFW::UniqueId& xfov_listid = xfov ->getAnimationList();
-
-		if (animlist_map.find(xfov_listid) != animlist_map.end()) 
+		if ( camera->getCameraType() == COLLADAFW::Camera::PERSPECTIVE )
+		{
+			const COLLADAFW::AnimatableFloat *xfov =  &(camera->getXFov());
+			const COLLADAFW::UniqueId& xfov_listid = xfov ->getAnimationList();
+			if (animlist_map.find(xfov_listid) != animlist_map.end()) 
 				type = type|CAMERA_XFOV;
-		
-			
+		}
+		else 
+		{
+			const COLLADAFW::AnimatableFloat *xmag =  &(camera->getXMag());
+			const COLLADAFW::UniqueId& xmag_listid = xmag ->getAnimationList();
+			if (animlist_map.find(xmag_listid) != animlist_map.end()) 
+					type = type|CAMERA_XMAG;
+		}	
 		if ( type != 0) break;
 
 	}
-
 	return type;
 }
 

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h	2011-07-07 16:34:23 UTC (rev 38195)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h	2011-07-07 16:56:56 UTC (rev 38196)
@@ -93,7 +93,8 @@
 			LIGHT_COLOR	= 2,
 			LIGHT_FOA = 4,
 			LIGHT_FOE = 8,
-			CAMERA_XFOV = 16
+			CAMERA_XFOV = 16,
+			CAMERA_XMAG = 32
 		};
 public:
 




More information about the Bf-blender-cvs mailing list