[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38162] branches/soc-2011-pepper/source/ blender/collada: Camera lens animation Identifying

Sukhitha Jayathilake pr.jayathilake at gmail.com
Wed Jul 6 20:09:36 CEST 2011


Revision: 38162
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38162
Author:   phabtar
Date:     2011-07-06 18:09:36 +0000 (Wed, 06 Jul 2011)
Log Message:
-----------
Camera lens animation Identifying

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

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-06 17:41:14 UTC (rev 38161)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-06 18:09:36 UTC (rev 38162)
@@ -905,7 +905,22 @@
 		if ( type != 0) break;
 
 	}
-	
+
+	const COLLADAFW::InstanceCameraPointerArray& nodeCameras = node->getInstanceCameras();
+	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()) 
+				type = type|CAMERA_XFOV;
+		
+			
+		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-06 17:41:14 UTC (rev 38161)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h	2011-07-06 18:09:36 UTC (rev 38162)
@@ -38,11 +38,13 @@
 #include "COLLADAFWNode.h"
 #include "COLLADAFWUniqueId.h"
 #include "COLLADAFWLight.h"
+#include "COLLADAFWCamera.h"
 
 #include "DNA_anim_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_camera_types.h"
 
 //#include "ArmatureImporter.h"
 #include "TransformReader.h"
@@ -90,7 +92,8 @@
 			NODE_TRANSFORM = 1,
 			LIGHT_COLOR	= 2,
 			LIGHT_FOA = 4,
-			LIGHT_FOE = 8
+			LIGHT_FOE = 8,
+			CAMERA_XFOV = 16
 		};
 public:
 

Modified: branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp	2011-07-06 17:41:14 UTC (rev 38161)
+++ branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp	2011-07-06 18:09:36 UTC (rev 38162)
@@ -854,6 +854,7 @@
 	}
 	
 	this->uid_camera_map[camera->getUniqueId()] = cam;
+	this->FW_object_map[camera->getUniqueId()] = camera;
 	// XXX import camera options
 	return true;
 }




More information about the Bf-blender-cvs mailing list