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:
Diffstat (limited to 'source/blender/io/collada/ArmatureImporter.cpp')
-rw-r--r--source/blender/io/collada/ArmatureImporter.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/io/collada/ArmatureImporter.cpp b/source/blender/io/collada/ArmatureImporter.cpp
index af6558da3b4..aa3b6615444 100644
--- a/source/blender/io/collada/ArmatureImporter.cpp
+++ b/source/blender/io/collada/ArmatureImporter.cpp
@@ -56,7 +56,7 @@ ArmatureImporter::ArmatureImporter(UnitConverter *conv,
view_layer(view_layer),
unit_converter(conv),
import_settings(import_settings),
- empty(NULL),
+ empty(nullptr),
mesh_importer(mesh)
{
}
@@ -139,7 +139,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin,
/* create a bone even if there's no joint data for it (i.e. it has no influence) */
if (!bone_is_skinned) {
- get_node_mat(mat, node, NULL, NULL, parent_mat);
+ get_node_mat(mat, node, nullptr, nullptr, parent_mat);
}
if (parent) {
@@ -174,14 +174,14 @@ int ArmatureImporter::create_bone(SkinInfo *skin,
else {
float angle;
mat4_to_loc_rot_size(loc, rot, size, mat);
- mat3_to_vec_roll(rot, NULL, &angle);
+ mat3_to_vec_roll(rot, nullptr, &angle);
bone->roll = angle;
}
copy_v3_v3(bone->head, mat[3]);
if (bone_is_skinned && this->import_settings->keep_bind_info) {
float rest_mat[4][4];
- get_node_mat(rest_mat, node, NULL, NULL, NULL);
+ get_node_mat(rest_mat, node, nullptr, nullptr, nullptr);
bc_set_IDPropertyMatrix(bone, "bind_mat", joint_bind_mat);
bc_set_IDPropertyMatrix(bone, "rest_mat", rest_mat);
}
@@ -230,7 +230,7 @@ void ArmatureImporter::fix_leaf_bone_hierarchy(bArmature *armature,
Bone *bone,
bool fix_orientation)
{
- if (bone == NULL) {
+ if (bone == nullptr) {
return;
}
@@ -251,14 +251,14 @@ void ArmatureImporter::fix_leaf_bone(bArmature *armature,
BoneExtended *be,
bool fix_orientation)
{
- if (be == NULL || !be->has_tail()) {
+ if (be == nullptr || !be->has_tail()) {
/* Collada only knows Joints, Here we guess a reasonable leaf bone length */
float leaf_length = (leaf_bone_length == FLT_MAX) ? 1.0 : leaf_bone_length;
float vec[3];
- if (fix_orientation && ebone->parent != NULL) {
+ if (fix_orientation && ebone->parent != nullptr) {
EditBone *parent = ebone->parent;
sub_v3_v3v3(vec, ebone->head, parent->head);
if (len_squared_v3(vec) < MINIMUM_BONE_LENGTH) {
@@ -279,7 +279,7 @@ void ArmatureImporter::fix_leaf_bone(bArmature *armature,
void ArmatureImporter::fix_parent_connect(bArmature *armature, Bone *bone)
{
/* armature has no bones */
- if (bone == NULL) {
+ if (bone == nullptr) {
return;
}
@@ -297,18 +297,18 @@ void ArmatureImporter::connect_bone_chains(bArmature *armature,
int max_chain_length)
{
BoneExtensionMap &extended_bones = bone_extension_manager.getExtensionMap(armature);
- BoneExtended *dominant_child = NULL;
+ BoneExtended *dominant_child = nullptr;
int maxlen = 0;
- if (parentbone == NULL) {
+ if (parentbone == nullptr) {
return;
}
Bone *child = (Bone *)parentbone->childbase.first;
- if (child && (import_settings->find_chains || child->next == NULL)) {
+ if (child && (import_settings->find_chains || child->next == nullptr)) {
for (; child; child = child->next) {
BoneExtended *be = extended_bones[child->name];
- if (be != NULL) {
+ if (be != nullptr) {
int chain_len = be->get_chain_length();
if (chain_len <= max_chain_length) {
if (chain_len > maxlen) {
@@ -316,7 +316,7 @@ void ArmatureImporter::connect_bone_chains(bArmature *armature,
maxlen = chain_len;
}
else if (chain_len == maxlen) {
- dominant_child = NULL;
+ dominant_child = nullptr;
}
}
}
@@ -324,7 +324,7 @@ void ArmatureImporter::connect_bone_chains(bArmature *armature,
}
BoneExtended *pbe = extended_bones[parentbone->name];
- if (dominant_child != NULL) {
+ if (dominant_child != nullptr) {
/* Found a valid chain. Now connect current bone with that chain.*/
EditBone *pebone = bc_get_edit_bone(armature, parentbone->name);
EditBone *cebone = bc_get_edit_bone(armature, dominant_child->get_name());
@@ -429,7 +429,7 @@ Object *ArmatureImporter::get_empty_for_leaves()
return empty;
}
- empty = bc_add_object(m_bmain, scene, view_layer, OB_EMPTY, NULL);
+ empty = bc_add_object(m_bmain, scene, view_layer, OB_EMPTY, nullptr);
empty->empty_drawtype = OB_EMPTY_SPHERE;
return empty;
@@ -480,7 +480,7 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
/* if there is an armature created for root_joint next root_joint */
for (ri = root_joints.begin(); ri != root_joints.end(); ri++) {
COLLADAFW::Node *node = *ri;
- if (get_armature_for_joint(node) != NULL) {
+ if (get_armature_for_joint(node) != nullptr) {
continue;
}
@@ -506,7 +506,7 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
ED_armature_to_edit(armature);
armature->layer = 0; /* layer is set according to imported bone set in create_bone() */
- create_bone(NULL, node, NULL, node->getChildNodes().getCount(), NULL, armature, layer_labels);
+ create_bone(nullptr, node, nullptr, node->getChildNodes().getCount(), nullptr, armature, layer_labels);
if (this->import_settings->find_chains) {
connect_bone_chains(armature, (Bone *)armature->bonebase.first, UNLIMITED_CHAIN_MAX);
}
@@ -543,7 +543,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
* - exit edit mode
* - set a sphere shape to leaf bones */
- Object *ob_arm = NULL;
+ Object *ob_arm = nullptr;
/*
* find if there's another skin sharing at least one bone with this skin
@@ -579,14 +579,14 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
*/
SkinInfo *a = &skin;
- Object *shared = NULL;
+ Object *shared = nullptr;
std::vector<COLLADAFW::Node *> skin_root_joints;
std::vector<std::string> layer_labels;
std::map<COLLADAFW::UniqueId, SkinInfo>::iterator it;
for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) {
SkinInfo *b = &it->second;
- if (b == a || b->BKE_armature_from_object() == NULL) {
+ if (b == a || b->BKE_armature_from_object() == nullptr) {
continue;
}
@@ -603,7 +603,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
}
}
- if (shared != NULL) {
+ if (shared != nullptr) {
break;
}
}
@@ -651,7 +651,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
if (skin.uses_joint_or_descendant(node)) {
create_bone(
- &skin, node, NULL, node->getChildNodes().getCount(), NULL, armature, layer_labels);
+ &skin, node, nullptr, node->getChildNodes().getCount(), nullptr, armature, layer_labels);
if (joint_parent_map.find(node->getUniqueId()) != joint_parent_map.end() &&
!skin.get_parent()) {
@@ -707,7 +707,7 @@ void ArmatureImporter::set_pose(Object *ob_arm,
float obmat[4][4];
/* object-space */
- get_node_mat(obmat, root_node, NULL, NULL);
+ get_node_mat(obmat, root_node, nullptr, nullptr);
bool is_decomposed = node_is_decomposed(root_node);
// if (*edbone)
@@ -804,7 +804,7 @@ void ArmatureImporter::make_armatures(bContext *C, std::vector<Object *> &object
/* link armature with a mesh object */
const COLLADAFW::UniqueId &uid = skin.get_controller_uid();
const COLLADAFW::UniqueId *guid = get_geometry_uid(uid);
- if (guid != NULL) {
+ if (guid != nullptr) {
Object *ob = mesh_importer->get_object_by_geom_uid(*guid);
if (ob) {
skin.link_armature(C, ob, joint_by_uid, this);
@@ -1001,7 +1001,7 @@ void ArmatureImporter::make_shape_keys(bContext *C)
COLLADAFW::UniqueId *ArmatureImporter::get_geometry_uid(const COLLADAFW::UniqueId &controller_uid)
{
if (geom_uid_by_controller_uid.find(controller_uid) == geom_uid_by_controller_uid.end()) {
- return NULL;
+ return nullptr;
}
return &geom_uid_by_controller_uid[controller_uid];
@@ -1024,7 +1024,7 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node)
return arm->second;
}
}
- return NULL;
+ return nullptr;
}
void ArmatureImporter::set_tags_map(TagsMap &tags_map)
@@ -1065,7 +1065,7 @@ BoneExtended &ArmatureImporter::add_bone_extended(EditBone *bone,
extended_bones[bone->name] = be;
TagsMap::iterator etit;
- ExtraTags *et = 0;
+ ExtraTags *et = nullptr;
etit = uid_tags_map.find(node->getUniqueId().toAscii());
bool has_connect = false;