From bd863ce58d86e30439018a5c376f6b1a1d5ecaa0 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Mon, 15 Jul 2013 10:50:04 +0000 Subject: Collada miport: Report 'unknown animation class' only when relevant --- source/blender/collada/AnimationImporter.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source/blender/collada/AnimationImporter.cpp') diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 643b2cdc2b0..445199dbdef 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -1687,6 +1687,18 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW:: } } +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 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float 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 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float // 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 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float 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; } } -- cgit v1.2.3