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:
authorCampbell Barton <ideasman42@gmail.com>2019-05-31 15:51:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-31 15:55:15 +0300
commitd8dbd49a2f23b7637f05fc058f39bdf6ab706624 (patch)
tree0805b9372c82ae6505d87e879824efe1d3e32f8e /source/blender/collada/SkinInfo.cpp
parent8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff)
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/collada/SkinInfo.cpp')
-rw-r--r--source/blender/collada/SkinInfo.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/collada/SkinInfo.cpp b/source/blender/collada/SkinInfo.cpp
index 3b5ea90d459..d8804a1e831 100644
--- a/source/blender/collada/SkinInfo.cpp
+++ b/source/blender/collada/SkinInfo.cpp
@@ -111,8 +111,9 @@ void SkinInfo::borrow_skin_controller_data(const COLLADAFW::SkinControllerData *
/* cannot transfer data for FloatOrDoubleArray, copy values manually */
const COLLADAFW::FloatOrDoubleArray &weight = skin->getWeights();
- for (unsigned int i = 0; i < weight.getValuesCount(); i++)
+ for (unsigned int i = 0; i < weight.getValuesCount(); i++) {
weights.push_back(bc_get_float_value(weight, i));
+ }
unit_converter->dae_matrix_to_mat4_(bind_shape_matrix, skin->getBindShapeMatrix());
}
@@ -162,8 +163,9 @@ Object *SkinInfo::create_armature(Main *bmain, Scene *scene, ViewLayer *view_lay
Object *SkinInfo::set_armature(Object *ob_arm)
{
- if (this->ob_arm)
+ if (this->ob_arm) {
return this->ob_arm;
+ }
this->ob_arm = ob_arm;
return ob_arm;
@@ -203,14 +205,16 @@ bool SkinInfo::uses_joint_or_descendant(COLLADAFW::Node *node)
const COLLADAFW::UniqueId &uid = node->getUniqueId();
std::vector<JointData>::iterator it;
for (it = joint_data.begin(); it != joint_data.end(); it++) {
- if ((*it).joint_uid == uid)
+ if ((*it).joint_uid == uid) {
return true;
+ }
}
COLLADAFW::NodePointerArray &children = node->getChildNodes();
for (unsigned int i = 0; i < children.getCount(); i++) {
- if (uses_joint_or_descendant(children[i]))
+ if (uses_joint_or_descendant(children[i])) {
return true;
+ }
}
return false;
@@ -255,8 +259,9 @@ void SkinInfo::link_armature(bContext *C,
const char *name = "Group";
/* skip joints that have invalid UID */
- if ((*it).joint_uid == COLLADAFW::UniqueId::INVALID)
+ if ((*it).joint_uid == COLLADAFW::UniqueId::INVALID) {
continue;
+ }
/* name group by joint node name */
@@ -326,8 +331,9 @@ void SkinInfo::find_root_joints(const std::vector<COLLADAFW::Node *> &root_joint
/* find if joint node is in the tree belonging to the root_joint */
if (find_node_in_tree(joint, root)) {
- if (std::find(result.begin(), result.end(), root) == result.end())
+ if (std::find(result.begin(), result.end(), root) == result.end()) {
result.push_back(root);
+ }
}
}
}
@@ -336,13 +342,15 @@ void SkinInfo::find_root_joints(const std::vector<COLLADAFW::Node *> &root_joint
bool SkinInfo::find_node_in_tree(COLLADAFW::Node *node, COLLADAFW::Node *tree_root)
{
- if (node == tree_root)
+ if (node == tree_root) {
return true;
+ }
COLLADAFW::NodePointerArray &children = tree_root->getChildNodes();
for (unsigned int i = 0; i < children.getCount(); i++) {
- if (find_node_in_tree(node, children[i]))
+ if (find_node_in_tree(node, children[i])) {
return true;
+ }
}
return false;