diff options
Diffstat (limited to 'source/blender/io/collada/AnimationImporter.cpp')
-rw-r--r-- | source/blender/io/collada/AnimationImporter.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/io/collada/AnimationImporter.cpp b/source/blender/io/collada/AnimationImporter.cpp index edac84e2aaa..b53aa95a11f 100644 --- a/source/blender/io/collada/AnimationImporter.cpp +++ b/source/blender/io/collada/AnimationImporter.cpp @@ -52,7 +52,7 @@ template<class T> static const char *bc_get_joint_name(T *node) { const std::string &id = node->getName(); - return id.size() ? id.c_str() : node->getOriginalId().c_str(); + return id.empty() ? node->getOriginalId().c_str() : id.c_str(); } FCurve *AnimationImporter::create_fcurve(int array_index, const char *rna_path) @@ -277,7 +277,7 @@ AnimationImporter::~AnimationImporter() BKE_fcurve_free(*it); } - if (unused_curves.size()) { + if (!unused_curves.empty()) { fprintf(stderr, "removed %d unused curves\n", (int)unused_curves.size()); } } @@ -306,7 +306,7 @@ bool AnimationImporter::write_animation(const COLLADAFW::Animation *anim) animation_to_fcurves(curve); break; default: - /* TODO there're also CARDINAL, HERMITE, BSPLINE and STEP types */ + /* TODO there are also CARDINAL, HERMITE, BSPLINE and STEP types. */ fprintf(stderr, "CARDINAL, HERMITE and BSPLINE anim interpolation types not supported yet.\n"); break; @@ -344,9 +344,11 @@ bool AnimationImporter::write_animation_list(const COLLADAFW::AnimationList *ani return true; } -/* \todo refactor read_node_transform to not automatically apply anything, +/** + * \todo refactor read_node_transform to not automatically apply anything, * but rather return the transform matrix, so caller can do with it what is - * necessary. Same for \ref get_node_mat */ + * necessary. Same for \ref get_node_mat + */ void AnimationImporter::read_node_transform(COLLADAFW::Node *node, Object *ob) { float mat[4][4]; @@ -736,7 +738,7 @@ void AnimationImporter::Assign_float_animations(const COLLADAFW::UniqueId &listi /* NOTE: Do NOT convert if imported file was made by blender <= 2.69.10 * Reason: old blender versions stored spot_size in radians (was a bug) */ - if (this->import_from_version == "" || + if (this->import_from_version.empty() || BLI_strcasecmp_natural(this->import_from_version.c_str(), "2.69.10") != -1) { fcurve_deg_to_rad(fcu); } @@ -876,7 +878,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, newcu[i]->totvert = frames.size(); } - if (frames.size() == 0) { + if (frames.empty()) { return; } @@ -965,8 +967,6 @@ void AnimationImporter::apply_matrix_curves(Object *ob, else { ob->rotmode = ROT_MODE_QUAT; } - - return; } /* @@ -1331,7 +1331,7 @@ void AnimationImporter::add_bone_animation_sampled(Object *ob, newcu[i]->totvert = frames.size(); } - if (frames.size() == 0) { + if (frames.empty()) { return; } @@ -1639,7 +1639,7 @@ Object *AnimationImporter::translate_animation_OLD( job = get_joint_object(root, node, par_job); #endif - if (frames.size() == 0) { + if (frames.empty()) { return job; } @@ -1874,7 +1874,7 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], unit_m4(m); - std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId(); + std::string nodename = node->getName().empty() ? node->getOriginalId() : node->getName(); if (!evaluate_animation(tm, m, fra, nodename.c_str())) { switch (type) { case COLLADAFW::Transformation::ROTATE: |