[Bf-blender-cvs] [cd1319d095a] collada2.8: cleanup: removed outdated/outcommented code

Gaia Clary noreply at git.blender.org
Fri Nov 23 15:52:39 CET 2018


Commit: cd1319d095a57e66a124b69a690661ac8bcc3d23
Author: Gaia Clary
Date:   Fri Nov 23 00:37:56 2018 +0100
Branches: collada2.8
https://developer.blender.org/rBcd1319d095a57e66a124b69a690661ac8bcc3d23

cleanup: removed outdated/outcommented code

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

M	source/blender/collada/AnimationExporter.cpp

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

diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 35da4060b9d..4491b7412a6 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -799,148 +799,3 @@ void AnimationExporter::export_morph_animation(Object *ob, BCAnimationSampler &s
 
 }
 #endif
-
-#if 0
-extern std::map<std::string, BC_animation_transform_type> BC_ANIMATION_TYPE_FROM_NAME;
-
-BC_animation_transform_type AnimationExporter::_get_transform_type(std::string path)
-{
-	BC_animation_transform_type tm_type;
-	// when given rna_path, overwrite tm_type from it
-	std::string name = bc_string_after(path, '.');
-	std::map<std::string, BC_animation_transform_type>::iterator type_it = BC_ANIMATION_TYPE_FROM_NAME.find(name);
-	tm_type = (type_it != BC_ANIMATION_TYPE_FROM_NAME.end()) ? type_it->second : BC_ANIMATION_TYPE_UNKNOWN;
-
-	return tm_type;
-}
-
-/* Euler sources from quternion sources
-* Important: We assume the object has a scene action.
-* If it has not, then Blender will die
-*/
-void AnimationExporter::get_eul_source_for_quat(std::vector<float> &values, Object *ob)
-{
-<<<<<<< HEAD
-	bArmature *arm = (bArmature *)ob_arm->data;
-	int flag = arm->flag;
-	std::vector<float> fra;
-	char prefix[256];
-
-	BLI_snprintf(prefix, sizeof(prefix), "pose.bones[\"%s\"]", bone->name);
-
-	bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
-	if (!pchan)
-		return;
-	//Fill frame array with key frame values framed at \param:transform_type
-	switch (transform_type) {
-		case 0:
-			find_rotation_frames(ob_arm, fra, prefix, pchan->rotmode);
-			break;
-		case 1:
-			find_keyframes(ob_arm, fra, prefix, "scale");
-			break;
-		case 2:
-			find_keyframes(ob_arm, fra, prefix, "location");
-			break;
-		default:
-			return;
-	}
-
-	// exit rest position
-	if (flag & ARM_RESTPOS) {
-		arm->flag &= ~ARM_RESTPOS;
-		BKE_pose_where_is(depsgraph, scene, ob_arm);
-	}
-	//v array will hold all values which will be exported.
-	if (fra.size()) {
-		float *values = (float *)MEM_callocN(sizeof(float) * 3 * fra.size(), "temp. anim frames");
-		sample_animation(values, fra, transform_type, bone, ob_arm, pchan);
-=======
-	bAction *action = bc_getSceneObjectAction(ob);
->>>>>>> collada
-
-	FCurve *fcu = (FCurve *)action->curves.first;
-	const int keys = fcu->totvert;
-	std::vector<std::vector<float>> quats;
-	quats.resize(keys);
-	for (int i = 0; i < keys; i++)
-		quats[i].resize(4);
-
-	int curve_count = 0;
-	while (fcu) {
-		std::string transformName = bc_string_after(fcu->rna_path, '.');
-
-		if (transformName == "rotation_quaternion") {
-			curve_count += 1;
-			for (int i = 0; i < fcu->totvert; i++) {
-				std::vector<float> &quat = quats[i];
-				quat[fcu->array_index] = fcu->bezt[i].vec[1][1];
-			}
-			if (curve_count == 4)
-				break; /* Quaternion curves can not use more the 4 FCurves!*/
-		}
-		fcu = fcu->next;
-	}
-
-<<<<<<< HEAD
-	// restore restpos
-	if (flag & ARM_RESTPOS)
-		arm->flag = flag;
-	BKE_pose_where_is(depsgraph, scene, ob_arm);
-}
-
-void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, int type, Bone *bone, Object *ob_arm, bPoseChannel *pchan)
-{
-	bPoseChannel *parchan = NULL;
-	bPose *pose = ob_arm->pose;
-
-	pchan = BKE_pose_channel_find_name(pose, bone->name);
-
-	if (!pchan)
-		return;
-
-	parchan = pchan->parent;
-
-	enable_fcurves(ob_arm->adt->action, bone->name);
-
-	std::vector<float>::iterator it;
-	for (it = frames.begin(); it != frames.end(); it++) {
-		float mat[4][4], ipar[4][4];
-
-		float ctime = BKE_scene_frame_get_from_ctime(scene, *it);
-
-
-		BKE_animsys_evaluate_animdata(depsgraph, scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
-		BKE_pose_where_is_bone(depsgraph, scene, ob_arm, pchan, ctime, 1);
-
-		// compute bone local mat
-		if (bone->parent) {
-			invert_m4_m4(ipar, parchan->pose_mat);
-			mul_m4_m4m4(mat, ipar, pchan->pose_mat);
-		}
-		else
-			copy_m4_m4(mat, pchan->pose_mat);
-
-		switch (type) {
-			case 0:
-				mat4_to_eul(v, mat);
-				break;
-			case 1:
-				mat4_to_size(v, mat);
-				break;
-			case 2:
-				copy_v3_v3(v, mat[3]);
-				break;
-		}
-=======
-	float feul[3];
-	for (int i = 0; i < keys; i++) {
-		std::vector<float> &quat = quats[i];
-		quat_to_eul(feul, &quat[0]);
->>>>>>> collada
-
-		for (int k = 0; k < 3; k++)
-			values.push_back(feul[k]);
-	}
-}
-#endif
\ No newline at end of file



More information about the Bf-blender-cvs mailing list