[Bf-blender-cvs] [88e9eba0654] collada: Cleanup: Collada removed special handling of Object->Data animations

Gaia Clary noreply at git.blender.org
Wed Mar 28 21:31:11 CEST 2018


Commit: 88e9eba065463f7fedadf18abd999c871a0fec96
Author: Gaia Clary
Date:   Sat Mar 24 17:23:05 2018 +0100
Branches: collada
https://developer.blender.org/rB88e9eba065463f7fedadf18abd999c871a0fec96

Cleanup: Collada removed special handling of Object->Data animations

The export of Object->Data curves is no longer a
Special case but now included in the normal
operation of the Animation exporter.

===================================================================

M	source/blender/collada/AnimationExporter.cpp
M	source/blender/collada/AnimationExporter.h

===================================================================

diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index c3559e2b4b9..605ce3c5c76 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -152,97 +152,9 @@ void AnimationExporter::exportObjectAnimation(Object *ob, BCAnimationSampler &sa
 		export_curve_animation_set(ob, sampler); // each curve might have different frames
 	}
 
-	/* Do no longer need this. The curves are now all exported in the same way */
-	// container_is_open = exportObjectDataAnimation(ob, sampler, container_is_open);
-
 	close_animation_container(container_is_open);
 }
 
-bool AnimationExporter::exportObjectDataAnimation(Object *ob, BCAnimationSampler &sampler, bool has_container)
-{
-	/* TODO: This needs to be handled by extra profiles, postponed for now
-	* export_morph_animation(ob);
-	*/
-
-	if (ob->type == OB_ARMATURE) {
-		/* Export skeletal animation (if any) */
-		bArmature *arm = (bArmature *)ob->data;
-		for (Bone *root_bone = (Bone *)arm->bonebase.first; root_bone; root_bone = root_bone->next)
-			export_bone_animation_recursive(ob, root_bone, sampler);
-	}
-
-	else if (ob->type == OB_LAMP) {
-		/* Export Lamp parameter animations */
-		bAction *action = bc_getSceneLampAction(ob);
-		if (action) {
-			has_container = open_animation_container(has_container, ob);
-
-			FCurve *fcu = (FCurve *)action->curves.first;
-			while (fcu) {
-				BC_animation_transform_type tm_type = get_transform_type(fcu->rna_path);
-
-				if (tm_type == BC_ANIMATION_TYPE_LIGHT_COLOR ||
-					tm_type == BC_ANIMATION_TYPE_FALL_OFF_ANGLE ||
-					tm_type == BC_ANIMATION_TYPE_FALL_OFF_EXPONENT ||
-					tm_type == BC_ANIMATION_TYPE_BLENDER_DIST)
-				{
-					create_keyframed_animation(ob, fcu, tm_type, true, sampler);
-				}
-				fcu = fcu->next;
-			}
-		}
-	}
-
-	else if (ob->type == OB_CAMERA) {
-		/* Export Camera parameter animations */
-		bAction *action = bc_getSceneCameraAction(ob);
-		if (action) {
-			has_container = open_animation_container(has_container, ob);
-			FCurve *fcu = (FCurve *)action->curves.first;
-			while (fcu) {
-				BC_animation_transform_type tm_type = get_transform_type(fcu->rna_path);
-
-				if (tm_type == BC_ANIMATION_TYPE_XFOV ||
-					tm_type == BC_ANIMATION_TYPE_XMAG ||
-					tm_type == BC_ANIMATION_TYPE_ZFAR ||
-					tm_type == BC_ANIMATION_TYPE_ZNEAR)
-				{
-					create_keyframed_animation(ob, fcu, tm_type, true, sampler);
-				}
-				fcu = fcu->next;
-			}
-		}
-	}
-
-	else if (ob->type == OB_MESH) {
-		for (int a = 0; a < ob->totcol; a++) {
-			/* Export Material parameter animations. */
-			Material *ma = give_current_material(ob, a + 1);
-			bAction *action = bc_getSceneMaterialAction(ma);
-			if (action) {
-				has_container = open_animation_container(has_container, ob);
-				/* isMatAnim = true; */
-				FCurve *fcu = (FCurve *)action->curves.first;
-				while (fcu) {
-					BC_animation_transform_type tm_type = get_transform_type(fcu->rna_path);
-
-					if (tm_type == BC_ANIMATION_TYPE_SPECULAR_HARDNESS ||
-						tm_type == BC_ANIMATION_TYPE_SPECULAR_COLOR ||
-						tm_type == BC_ANIMATION_TYPE_DIFFUSE_COLOR ||
-						tm_type == BC_ANIMATION_TYPE_ALPHA ||
-						tm_type == BC_ANIMATION_TYPE_IOR)
-					{
-						create_keyframed_animation(ob, fcu, tm_type, true, sampler);
-					}
-					fcu = fcu->next;
-				}
-			}
-		}
-	}
-
-	return has_container;
-}
-
 /*
  * Export all animation FCurves of an Object.
  *
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index 724934189c4..39938f3a371 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -108,7 +108,6 @@ public:
 
 	// Main entry point into Animation export (called for each exported object)
 	void exportObjectAnimation(Object *ob, BCAnimationSampler &sampler);
-	bool exportObjectDataAnimation(Object *ob, BCAnimationSampler &sampler, bool has_container);
 
 protected:



More information about the Bf-blender-cvs mailing list