Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/collada/collada_utils.cpp
| Show First 20 Lines • Show All 538 Lines • ▼ Show 20 Lines | |||||
| BoneExtended::BoneExtended(EditBone *aBone) | BoneExtended::BoneExtended(EditBone *aBone) | ||||
| { | { | ||||
| this->set_name(aBone->name); | this->set_name(aBone->name); | ||||
| this->chain_length = 0; | this->chain_length = 0; | ||||
| this->is_leaf = false; | this->is_leaf = false; | ||||
| this->tail[0] = 0.0f; | this->tail[0] = 0.0f; | ||||
| this->tail[1] = 0.5f; | this->tail[1] = 0.5f; | ||||
| this->tail[2] = 0.0f; | this->tail[2] = 0.0f; | ||||
| this->use_connect = -1; | |||||
| this->roll = 0; | this->roll = 0; | ||||
| this->bone_layers = 0; | this->bone_layers = 0; | ||||
| this->use_connect = false; | |||||
| this->use_local_location = false; | |||||
| this->inherit_scale = eBone_InheritScaleMode::BONE_INHERIT_SCALE_FULL; | |||||
| this->has_custom_tail = false; | this->has_custom_tail = false; | ||||
| this->has_custom_roll = false; | this->has_custom_roll = false; | ||||
| } | } | ||||
| char *BoneExtended::get_name() | char *BoneExtended::get_name() | ||||
| { | { | ||||
gaiaclary: Here you see how using an Enumeration could be a better solution. | |||||
| return name; | return name; | ||||
| } | } | ||||
| void BoneExtended::set_name(char *aName) | void BoneExtended::set_name(char *aName) | ||||
| { | { | ||||
| BLI_strncpy(name, aName, MAXBONENAME); | BLI_strncpy(name, aName, MAXBONENAME); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | void BoneExtended::set_use_connect(int use_connect) | ||||
| this->use_connect = use_connect; | this->use_connect = use_connect; | ||||
| } | } | ||||
| int BoneExtended::get_use_connect() | int BoneExtended::get_use_connect() | ||||
| { | { | ||||
| return this->use_connect; | return this->use_connect; | ||||
| } | } | ||||
| void BoneExtended::set_inherit_scale(eBone_InheritScaleMode mode) { | |||||
| this->inherit_scale = mode; | |||||
| } | |||||
| eBone_InheritScaleMode BoneExtended::get_inherit_scale() { | |||||
| return this->inherit_scale; | |||||
| } | |||||
| void BoneExtended::set_use_local_location(bool use_local) { | |||||
| this->use_local_location = use_local; | |||||
| } | |||||
| bool BoneExtended::get_use_local_location() { | |||||
| return this->use_local_location; | |||||
| } | |||||
| /** | /** | ||||
| * Stores a 4*4 matrix as a custom bone property array of size 16 | * Stores a 4*4 matrix as a custom bone property array of size 16 | ||||
| */ | */ | ||||
| void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4]) | void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4]) | ||||
| { | { | ||||
| IDProperty *idgroup = (IDProperty *)ebone->prop; | IDProperty *idgroup = (IDProperty *)ebone->prop; | ||||
| if (idgroup == nullptr) { | if (idgroup == nullptr) { | ||||
| IDPropertyTemplate val = {0}; | IDPropertyTemplate val = {0}; | ||||
| ▲ Show 20 Lines • Show All 749 Lines • Show Last 20 Lines | |||||
Here you see how using an Enumeration could be a better solution.