From ffc4c126f5416b04a01653e7a03451797b98aba4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Dec 2021 17:19:15 +1100 Subject: Cleanup: move public doc-strings into headers for 'blenkernel' - Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709 --- source/blender/blenkernel/intern/constraint.c | 55 --------------------------- 1 file changed, 55 deletions(-) (limited to 'source/blender/blenkernel/intern/constraint.c') diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 3455baa9292..d284c32b1df 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -123,7 +123,6 @@ static bConstraint *constraint_find_original_for_update(bConstraintOb *cob, bCon /* -------------- Naming -------------- */ -/* Find the first available, non-duplicate name for a given constraint */ void BKE_constraint_unique_name(bConstraint *con, ListBase *list) { BLI_uniquename(list, con, DATA_("Const"), '.', offsetof(bConstraint, name), sizeof(con->name)); @@ -132,8 +131,6 @@ void BKE_constraint_unique_name(bConstraint *con, ListBase *list) /* ----------------- Evaluation Loop Preparation --------------- */ /* package an object/bone for use in constraint evaluation */ -/* This function MEM_calloc's a bConstraintOb struct, - * that will need to be freed after evaluation */ bConstraintOb *BKE_constraints_make_evalob( Depsgraph *depsgraph, Scene *scene, Object *ob, void *subdata, short datatype) { @@ -211,7 +208,6 @@ bConstraintOb *BKE_constraints_make_evalob( return cob; } -/* cleanup after constraint evaluation */ void BKE_constraints_clear_evalob(bConstraintOb *cob) { float delta[4][4], imat[4][4]; @@ -261,10 +257,6 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob) /* -------------- Space-Conversion API -------------- */ -/* This function is responsible for the correct transformations/conversions - * of a matrix from one space to another for constraint evaluation. - * For now, this is only implemented for Objects and PoseChannels. - */ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, bConstraintOb *cob, @@ -5556,9 +5548,6 @@ static void constraints_init_typeinfo(void) constraintsTypeInfo[30] = &CTI_ARMATURE; /* Armature Constraint */ } -/* This function should be used for getting the appropriate type-info when only - * a constraint type is known - */ const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type) { /* initialize the type-info list? */ @@ -5578,9 +5567,6 @@ const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type) return NULL; } -/* This function should always be used to get the appropriate type-info, as it - * has checks which prevent segfaults in some weird cases. - */ const bConstraintTypeInfo *BKE_constraint_typeinfo_get(bConstraint *con) { /* only return typeinfo for valid constraints */ @@ -5611,11 +5597,6 @@ static void con_unlink_refs_cb(bConstraint *UNUSED(con), } } -/** - * Free data of a specific constraint if it has any info. - * be sure to run #BIK_clear_data() when freeing an IK constraint, - * unless DAG_relations_tag_update is called. - */ void BKE_constraint_free_data_ex(bConstraint *con, bool do_id_user) { if (con->data) { @@ -5643,7 +5624,6 @@ void BKE_constraint_free_data(bConstraint *con) BKE_constraint_free_data_ex(con, true); } -/* Free all constraints from a constraint-stack */ void BKE_constraints_free_ex(ListBase *list, bool do_id_user) { /* Free constraint data and also any extra data */ @@ -5660,7 +5640,6 @@ void BKE_constraints_free(ListBase *list) BKE_constraints_free_ex(list, true); } -/* Remove the specified constraint from the given constraint stack */ bool BKE_constraint_remove(ListBase *list, bConstraint *con) { if (con) { @@ -5686,7 +5665,6 @@ bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con, bool return false; } -/* Apply the specified constraint in the given constraint stack */ bool BKE_constraint_apply_for_object(Depsgraph *depsgraph, Scene *scene, Object *ob, @@ -5920,7 +5898,6 @@ bool BKE_constraint_target_uses_bbone(struct bConstraint *con, /* ......... */ -/* Add new constraint for the given bone */ bConstraint *BKE_constraint_add_for_pose(Object *ob, bPoseChannel *pchan, const char *name, @@ -5933,7 +5910,6 @@ bConstraint *BKE_constraint_add_for_pose(Object *ob, return add_new_constraint(ob, pchan, name, type); } -/* Add new constraint for the given object */ bConstraint *BKE_constraint_add_for_object(Object *ob, const char *name, short type) { return add_new_constraint(ob, NULL, name, type); @@ -5941,7 +5917,6 @@ bConstraint *BKE_constraint_add_for_object(Object *ob, const char *name, short t /* ......... */ -/* Run the given callback on all ID-blocks in list of constraints */ void BKE_constraints_id_loop(ListBase *conlist, ConstraintIDFunc func, void *userdata) { LISTBASE_FOREACH (bConstraint *, con, conlist) { @@ -6016,7 +5991,6 @@ static void constraint_copy_data_ex(bConstraint *dst, } } -/** Allocate and duplicate a single constraint, outside of any object/pose context. */ bConstraint *BKE_constraint_duplicate_ex(bConstraint *src, const int flag, const bool do_extern) { bConstraint *dst = MEM_dupallocN(src); @@ -6025,7 +5999,6 @@ bConstraint *BKE_constraint_duplicate_ex(bConstraint *src, const int flag, const return dst; } -/* Add a copy of the given constraint for the given bone */ bConstraint *BKE_constraint_copy_for_pose(Object *ob, bPoseChannel *pchan, bConstraint *src) { if (pchan == NULL) { @@ -6037,7 +6010,6 @@ bConstraint *BKE_constraint_copy_for_pose(Object *ob, bPoseChannel *pchan, bCons return new_con; } -/* Add a copy of the given constraint for the given object */ bConstraint *BKE_constraint_copy_for_object(Object *ob, bConstraint *src) { bConstraint *new_con = BKE_constraint_duplicate_ex(src, 0, !ID_IS_LINKED(ob)); @@ -6045,7 +6017,6 @@ bConstraint *BKE_constraint_copy_for_object(Object *ob, bConstraint *src) return new_con; } -/* duplicate all of the constraints in a constraint stack */ void BKE_constraints_copy_ex(ListBase *dst, const ListBase *src, const int flag, bool do_extern) { bConstraint *con, *srccon; @@ -6074,7 +6045,6 @@ bConstraint *BKE_constraints_find_name(ListBase *list, const char *name) return BLI_findstring(list, name, offsetof(bConstraint, name)); } -/* finds the 'active' constraint in a constraint stack */ bConstraint *BKE_constraints_active_get(ListBase *list) { @@ -6091,7 +6061,6 @@ bConstraint *BKE_constraints_active_get(ListBase *list) return NULL; } -/* Set the given constraint as the active one (clearing all the others) */ void BKE_constraints_active_set(ListBase *list, bConstraint *con) { @@ -6127,7 +6096,6 @@ static bConstraint *constraint_list_find_from_target(ListBase *constraints, bCon return NULL; } -/* Finds the constraint that owns the given target within the object. */ bConstraint *BKE_constraint_find_from_target(Object *ob, bConstraintTarget *tgt, bPoseChannel **r_pchan) @@ -6225,12 +6193,6 @@ static bConstraint *constraint_find_original_for_update(bConstraintOb *cob, bCon return orig_con; } -/** - * Check whether given constraint is not local (i.e. from linked data) when the object is a library - * override. - * - * \param con: May be NULL, in which case we consider it as a non-local constraint case. - */ bool BKE_constraint_is_nonlocal_in_liboverride(const Object *ob, const bConstraint *con) { return (ID_IS_OVERRIDE_LIBRARY(ob) && @@ -6239,8 +6201,6 @@ bool BKE_constraint_is_nonlocal_in_liboverride(const Object *ob, const bConstrai /* -------- Constraints and Proxies ------- */ -/* Rescue all constraints tagged as being CONSTRAINT_PROXY_LOCAL - * (i.e. added to bone that's proxy-synced in this file) */ void BKE_constraints_proxylocal_extract(ListBase *dst, ListBase *src) { bConstraint *con, *next; @@ -6257,7 +6217,6 @@ void BKE_constraints_proxylocal_extract(ListBase *dst, ListBase *src) } } -/* Returns if the owner of the constraint is proxy-protected */ bool BKE_constraints_proxylocked_owner(Object *ob, bPoseChannel *pchan) { /* Currently, constraints can only be on object or bone level */ @@ -6281,13 +6240,6 @@ bool BKE_constraints_proxylocked_owner(Object *ob, bPoseChannel *pchan) /* -------- Target-Matrix Stuff ------- */ -/* This function is a relic from the prior implementations of the constraints system, when all - * constraints either had one or no targets. It used to be called during the main constraint - * solving loop, but is now only used for the remaining cases for a few constraints. - * - * None of the actual calculations of the matrices should be done here! Also, this function is - * not to be used by any new constraints, particularly any that have multiple targets. - */ void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, Scene *scene, bConstraint *con, @@ -6364,7 +6316,6 @@ void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, } } -/* Get the list of targets required for solving a constraint */ void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, @@ -6434,12 +6385,6 @@ void BKE_constraint_custom_object_space_get(float r_mat[4][4], bConstraint *con) /* ---------- Evaluation ----------- */ -/* This function is called whenever constraints need to be evaluated. Currently, all - * constraints that can be evaluated are every time this gets run. - * - * BKE_constraints_make_evalob and BKE_constraints_clear_evalob should be called before and - * after running this function, to sort out cob - */ void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBase *conlist, bConstraintOb *cob, -- cgit v1.2.3