diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 14:25:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 14:25:45 +0300 |
commit | 50f378e5c8cc6aeda7e3e6d1adee2ba787a438a7 (patch) | |
tree | 56a01d644fe3e25e525673ebc60d4f48a54f4fc8 /source/blender/io/collada/collada_utils.cpp | |
parent | 973dac9b5f7820baa431acd54988a508dd844d67 (diff) |
Cleanup: move public doc-strings into headers for 'io/collada'
Ref T92709
Diffstat (limited to 'source/blender/io/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/io/collada/collada_utils.cpp | 61 |
1 files changed, 4 insertions, 57 deletions
diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp index c1f25ea9a26..f2bc7691448 100644 --- a/source/blender/io/collada/collada_utils.cpp +++ b/source/blender/io/collada/collada_utils.cpp @@ -92,9 +92,10 @@ float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned in return array.getDoubleValues()->getData()[index]; } -/* copied from /editors/object/object_relations.c */ int bc_test_parent_loop(Object *par, Object *ob) { + /* Copied from /editors/object/object_relations.c */ + /* test if 'ob' is a parent somewhere in par's parents */ if (par == nullptr) { @@ -289,9 +290,10 @@ bool bc_has_object_type(LinkNode *export_set, short obtype) return false; } -/* Use bubble sort algorithm for sorting the export set */ void bc_bubble_sort_by_Object_name(LinkNode *export_set) { + /* Use bubble sort algorithm for sorting the export set. */ + bool sorted = false; LinkNode *node; for (node = export_set; node->next && !sorted; node = node->next) { @@ -312,11 +314,6 @@ void bc_bubble_sort_by_Object_name(LinkNode *export_set) } } -/* Check if a bone is the top most exportable bone in the bone hierarchy. - * When deform_bones_only == false, then only bones with NO parent - * can be root bones. Otherwise the top most deform bones in the hierarchy - * are root bones. - */ bool bc_is_root_bone(Bone *aBone, bool deform_bones_only) { if (deform_bones_only) { @@ -386,9 +383,6 @@ void bc_match_scale(std::vector<Object *> *objects_done, } } -/* - * Convenience function to get only the needed components of a matrix - */ void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size) { if (size) { @@ -408,17 +402,6 @@ void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], floa } } -/* - * Create rotation_quaternion from a delta rotation and a reference quat - * - * Input: - * mat_from: The rotation matrix before rotation - * mat_to : The rotation matrix after rotation - * qref : the quat corresponding to mat_from - * - * Output: - * rot : the calculated result (quaternion) - */ void bc_rotate_from_reference_quat(float quat_to[4], float quat_from[4], float mat_to[4][4]) { float qd[4]; @@ -457,9 +440,6 @@ void bc_triangulate_mesh(Mesh *me) BM_mesh_free(bm); } -/* - * A bone is a leaf when it has no children or all children are not connected. - */ bool bc_is_leaf_bone(Bone *bone) { for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) { @@ -501,11 +481,6 @@ int bc_set_layer(int bitfield, int layer, bool enable) return bitfield; } -/** - * This method creates a new extension map when needed. - * \note The ~BoneExtensionManager destructor takes care - * to delete the created maps when the manager is removed. - */ BoneExtensionMap &BoneExtensionManager::getExtensionMap(bArmature *armature) { std::string key = armature->id.name; @@ -697,9 +672,6 @@ int BoneExtended::get_use_connect() return this->use_connect; } -/** - * 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]) { IDProperty *idgroup = (IDProperty *)ebone->prop; @@ -745,19 +717,11 @@ static void bc_set_IDProperty(EditBone *ebone, const char *key, float value) } #endif -/** - * Get a custom property when it exists. - * This function is also used to check if a property exists. - */ IDProperty *bc_get_IDProperty(Bone *bone, std::string key) { return (bone->prop == nullptr) ? nullptr : IDP_GetPropertyFromGroup(bone->prop, key.c_str()); } -/** - * Read a custom bone property and convert to float - * Return def if the property does not exist. - */ float bc_get_property(Bone *bone, std::string key, float def) { float result = def; @@ -780,14 +744,6 @@ float bc_get_property(Bone *bone, std::string key, float def) return result; } -/** - * Read a custom bone property and convert to matrix - * Return true if conversion was successful - * - * Return false if: - * - the property does not exist - * - is not an array of size 16 - */ bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4]) { IDProperty *property = bc_get_IDProperty(bone, key); @@ -803,9 +759,6 @@ bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4]) return false; } -/** - * get a vector that is stored in 3 custom properties (used in Blender <= 2.78) - */ void bc_get_property_vector(Bone *bone, std::string key, float val[3], const float def[3]) { val[0] = bc_get_property(bone, key + "_x", def[0]); @@ -1014,12 +967,6 @@ void bc_apply_global_transform(Vector &to_vec, const BCMatrix &global_transform, mul_v3_m4v3(to_vec, transform, to_vec); } -/** - * Check if custom information about bind matrix exists and modify the from_mat - * accordingly. - * - * NOTE: This is old style for Blender <= 2.78 only kept for compatibility - */ void bc_create_restpose_mat(BCExportSettings &export_settings, Bone *bone, float to_mat[4][4], |