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

Sukhitha Jayathilake pr.jayathilake at gmail.com
Wed Jul 6 20:34:01 CEST 2011


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

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

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp	2011-07-06 18:09:36 UTC (rev 38162)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp	2011-07-06 18:34:01 UTC (rev 38163)
@@ -597,7 +597,7 @@
 		//bool is_rotation = !strcmp(fcu->rna_path, "rotation");
 		bool is_angle = false;
 		
-		if (strstr(fcu->rna_path, "rotation")||strstr(fcu->rna_path, "lens")) is_angle = true;
+		if (strstr(fcu->rna_path, "rotation")) is_angle = true;
 		
 		COLLADASW::FloatSourceF source(mSW);
 		source.setId(source_id);

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-06 18:09:36 UTC (rev 38162)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp	2011-07-06 18:34:01 UTC (rev 38163)
@@ -855,6 +855,28 @@
 			}
 		}
 	}
+
+	if ( ((animType & CAMERA_XFOV) != 0) )
+	{
+		Camera * camera  = (Camera*) ob->data;
+
+		if (!camera->adt || !camera->adt->action) act = verify_adt_action((ID*)&camera->id, 1);
+					else act = camera->adt->action;
+
+		ListBase *AnimCurves = &(act->curves);
+		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()];
+
+			if ((animType & CAMERA_XFOV) != 0 )
+			{
+				const COLLADAFW::AnimatableFloat *xfov =  &(camera->getXFov());
+				const COLLADAFW::UniqueId& listid = xfov->getAnimationList();
+				Assign_float_animations( listid ,AnimCurves, "lens"); 
+			}
+		}
+	}
 }
 
 //Check if object is animated by checking if animlist_map holds the animlist_id of node transforms




More information about the Bf-blender-cvs mailing list