Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2011-06-21 02:55:18 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-06-21 02:55:18 +0400
commit207911bdb3e5ba3e110cc7107186af988d2d10e8 (patch)
tree88684071e2813d52f8dc700b593d7644b2be88c8 /source/blender/collada/AnimationImporter.cpp
parentadb81a0351c0854ee8529ae7a66ef9c907790ee5 (diff)
parent768184753abb5a69e278bfe6207fe070b2e0ffc7 (diff)
Merge with trunk r37677
Diffstat (limited to 'source/blender/collada/AnimationImporter.cpp')
-rw-r--r--source/blender/collada/AnimationImporter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 42dbc086146..69beac653d2 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -53,12 +53,12 @@
#include <algorithm>
-// use this for retrieving bone names, since these must be unique
+// first try node name, if not available (since is optional), fall back to original id
template<class T>
static const char *bc_get_joint_name(T *node)
{
- const std::string& id = node->getOriginalId();
- return id.size() ? id.c_str() : node->getName().c_str();
+ const std::string& id = node->getName();
+ return id.size() ? id.c_str() : node->getOriginalId().c_str();
}
FCurve *AnimationImporter::create_fcurve(int array_index, const char *rna_path)
@@ -1134,7 +1134,8 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW::
unit_m4(m);
- if (!evaluate_animation(tm, m, fra, node->getOriginalId().c_str())) {
+ std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
+ if (!evaluate_animation(tm, m, fra, nodename.c_str())) {
switch (type) {
case COLLADAFW::Transformation::ROTATE:
dae_rotate_to_mat4(tm, m);