Camera lens animation import.

This commit is contained in:
2011-07-06 18:34:01 +00:00
parent 6c88a16b3a
commit a0d4a95ff7
2 changed files with 23 additions and 1 deletions

View File

@@ -597,7 +597,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
//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);

View File

@@ -855,6 +855,28 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
}
}
}
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