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/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 2b486f64b61..694474d5656 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -665,11 +665,11 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
-#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, nocopy) \
+#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy) \
{ \
if (ct) { \
bConstraintTarget *ctn = ct->next; \
- if (nocopy == 0) { \
+ if (no_copy == 0) { \
datatar = ct->tar; \
BLI_strncpy(datasubtarget, ct->subtarget, sizeof(datasubtarget)); \
con->tarspace = (char)ct->space; \
@@ -686,11 +686,11 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
-#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, nocopy) \
+#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy) \
{ \
if (ct) { \
bConstraintTarget *ctn = ct->next; \
- if (nocopy == 0) { \
+ if (no_copy == 0) { \
datatar = ct->tar; \
con->tarspace = (char)ct->space; \
} \
@@ -735,14 +735,14 @@ static int childof_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void childof_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void childof_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bChildOfConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -870,14 +870,14 @@ static int trackto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void trackto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void trackto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTrackToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1052,15 +1052,15 @@ static int kinematic_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void kinematic_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void kinematic_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bKinematicConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
- SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
+ SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, no_copy);
}
}
@@ -1140,14 +1140,14 @@ static int followpath_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void followpath_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void followpath_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bFollowPathConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -1488,14 +1488,14 @@ static int loclike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void loclike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void loclike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bLocateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1578,14 +1578,14 @@ static int rotlike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void rotlike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void rotlike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bRotateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1690,14 +1690,14 @@ static int sizelike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void sizelike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void sizelike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bSizeLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1779,14 +1779,14 @@ static int translike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void translike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void translike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTransLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2038,14 +2038,14 @@ static int actcon_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void actcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void actcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bActionConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2202,14 +2202,14 @@ static int locktrack_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void locktrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void locktrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bLockTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2509,14 +2509,14 @@ static int distlimit_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void distlimit_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void distlimit_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bDistLimitConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2636,14 +2636,14 @@ static int stretchto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void stretchto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void stretchto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bStretchToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2808,14 +2808,14 @@ static int minmax_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void minmax_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void minmax_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bMinMaxConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2951,14 +2951,14 @@ static int rbj_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void rbj_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void rbj_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bRigidBodyJointConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3002,14 +3002,14 @@ static int clampto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void clampto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void clampto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bClampToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3182,14 +3182,14 @@ static int transform_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void transform_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void transform_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTransformConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -3329,13 +3329,13 @@ static int shrinkwrap_get_tars(bConstraint *con, ListBase *list)
}
-static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bShrinkwrapConstraint *data = con->data;
bConstraintTarget *ct = list->first;
- SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, no_copy);
}
}
@@ -3512,14 +3512,14 @@ static int damptrack_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void damptrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void damptrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bDampTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -3657,14 +3657,14 @@ static int splineik_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void splineik_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void splineik_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bSplineIKConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3725,14 +3725,14 @@ static int pivotcon_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void pivotcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void pivotcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bPivotConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -4277,9 +4277,9 @@ bConstraintTypeInfo *BKE_constraint_get_typeinfo(bConstraint *con)
/* ---------- Data Management ------- */
/* helper function for BKE_free_constraint_data() - unlinks references */
-static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
+static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_reference, void *UNUSED(userData))
{
- if (*idpoin && isReference)
+ if (*idpoin && is_reference)
id_us_min(*idpoin);
}
@@ -4322,7 +4322,7 @@ void BKE_free_constraints(ListBase *list)
/* Remove the specified constraint from the given constraint stack */
-int BKE_remove_constraint(ListBase *list, bConstraint *con)
+bool BKE_remove_constraint(ListBase *list, bConstraint *con)
{
if (con) {
BKE_free_constraint_data(con);
@@ -4334,7 +4334,7 @@ int BKE_remove_constraint(ListBase *list, bConstraint *con)
}
/* Remove all the constraints of the specified type from the given constraint stack */
-void BKE_remove_constraints_type(ListBase *list, short type, short last_only)
+void BKE_remove_constraints_type(ListBase *list, short type, bool last_only)
{
bConstraint *con, *conp;
@@ -4460,7 +4460,7 @@ bConstraint *BKE_add_ob_constraint(Object *ob, const char *name, short type)
/* ......... */
/* helper for BKE_relink_constraints() - call ID_NEW() on every ID reference the constraint has */
-static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userdata))
+static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, bool UNUSED(is_reference), void *UNUSED(userdata))
{
/* ID_NEW() expects a struct with inline "id" member as first
* since we've got the actual ID block, let's just inline this
@@ -4498,17 +4498,17 @@ void BKE_id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *use
/* ......... */
/* helper for BKE_copy_constraints(), to be used for making sure that ID's are valid */
-static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userData))
+static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, bool UNUSED(is_reference), void *UNUSED(userData))
{
if (*idpoin && (*idpoin)->lib)
id_lib_extern(*idpoin);
}
/* helper for BKE_copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */
-static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
+static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_reference, void *UNUSED(userData))
{
/* increment usercount if this is a reference type */
- if ((*idpoin) && (isReference))
+ if ((*idpoin) && (is_reference))
id_us_plus(*idpoin);
}
@@ -4605,7 +4605,7 @@ void BKE_extract_proxylocal_constraints(ListBase *dst, ListBase *src)
}
/* Returns if the owner of the constraint is proxy-protected */
-short BKE_proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan)
+bool BKE_proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan)
{
/* Currently, constraints can only be on object or bone level */
if (ob && ob->proxy) {