[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58263] trunk/blender/source/blender/ collada/AnimationImporter.cpp: Collada miport: Report ' unknown animation class' only when relevant

Gaia Clary gaia.clary at machinimatrix.org
Mon Jul 15 12:50:05 CEST 2013


Revision: 58263
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58263
Author:   gaiaclary
Date:     2013-07-15 10:50:04 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
Collada miport: Report 'unknown animation class' only when relevant

Modified Paths:
--------------
    trunk/blender/source/blender/collada/AnimationImporter.cpp

Modified: trunk/blender/source/blender/collada/AnimationImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/AnimationImporter.cpp	2013-07-15 10:44:17 UTC (rev 58262)
+++ trunk/blender/source/blender/collada/AnimationImporter.cpp	2013-07-15 10:50:04 UTC (rev 58263)
@@ -1687,6 +1687,18 @@
 	}
 }
 
+static void report_class_type_unsupported(const char *path, 
+                                         const COLLADAFW::AnimationList::AnimationClass animclass,
+                                         const COLLADAFW::Transformation::TransformationType type) 
+{
+	if (animclass == COLLADAFW::AnimationList::UNKNOWN_CLASS) {
+		fprintf(stderr, "%s: UNKNOWN animation class\n", path);
+	}
+	else {
+		fprintf(stderr, "%s: animation class %d is not supported yet for transformation type %d\n", path, animclass, type);
+	}
+}
+
 // return true to indicate that mat contains a sane value
 bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float mat[4][4], float fra, const char *node_id)
 {
@@ -1741,11 +1753,6 @@
 					break;
 			}
 
-			if (animclass == COLLADAFW::AnimationList::UNKNOWN_CLASS) {
-				fprintf(stderr, "%s: UNKNOWN animation class\n", path);
-				//continue;
-			}
-
 			if (type == COLLADAFW::Transformation::ROTATE) {
 				if (curves.size() != 1) {
 					fprintf(stderr, "expected 1 curve, got %d\n", (int)curves.size());
@@ -1754,7 +1761,7 @@
 
 				// TODO support other animclasses
 				if (animclass != COLLADAFW::AnimationList::ANGLE) {
-					fprintf(stderr, "%s: animation class %d is not supported yet\n", path, animclass);
+					report_class_type_unsupported(path, animclass, type);
 					return false;
 				}
 
@@ -1793,7 +1800,7 @@
 						vec[2] = evaluate_fcurve(curves[2], fra);
 						break;
 					default:
-						fprintf(stderr, "%s: animation class %d is not supported yet\n", path, animclass);
+						report_class_type_unsupported(path, animclass, type);
 						break;
 				}
 			}




More information about the Bf-blender-cvs mailing list