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:
authorCampbell Barton <ideasman42@gmail.com>2021-06-30 11:39:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-30 11:40:16 +0300
commit918d9291d611a10d4a9ceff13edc3ef2ac486207 (patch)
tree27167c2ad430249cf9251b96fc650cbf1f6b08fe /source/blender/editors/transform
parentc57b0cae2811f33b0bf3edd9bc76ab01671289e6 (diff)
Cleanup: store the result of isLockConstraint for reuse
This was being called for every element in some situations.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_mode_push_pull.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_mode_push_pull.c b/source/blender/editors/transform/transform_mode_push_pull.c
index 098698b0e79..0492ec8df8c 100644
--- a/source/blender/editors/transform/transform_mode_push_pull.c
+++ b/source/blender/editors/transform/transform_mode_push_pull.c
@@ -54,6 +54,7 @@ struct TransDataArgs_PushPull {
float distance;
const float axis_global[3];
+ bool is_lock_constraint;
bool is_data_space;
};
@@ -62,6 +63,7 @@ static void transdata_elem_push_pull(const TransInfo *t,
TransData *td,
const float distance,
const float axis_global[3],
+ const bool is_lock_constraint,
const bool is_data_space)
{
float vec[3];
@@ -72,7 +74,7 @@ static void transdata_elem_push_pull(const TransInfo *t,
t->con.applyRot(t, tc, td, axis, NULL);
mul_m3_v3(td->smtx, axis);
- if (isLockConstraint(t)) {
+ if (is_lock_constraint) {
float dvec[3];
project_v3_v3v3(dvec, vec, axis);
sub_v3_v3(vec, dvec);
@@ -98,8 +100,13 @@ static void transdata_elem_push_pull_fn(void *__restrict iter_data_v,
if (td->flag & TD_SKIP) {
return;
}
- transdata_elem_push_pull(
- data->t, data->tc, td, data->distance, data->axis_global, data->is_data_space);
+ transdata_elem_push_pull(data->t,
+ data->tc,
+ td,
+ data->distance,
+ data->axis_global,
+ data->is_lock_constraint,
+ data->is_data_space);
}
/** \} */
@@ -141,6 +148,7 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2]))
t->con.applyRot(t, NULL, NULL, axis_global, NULL);
}
+ const bool is_lock_constraint = isLockConstraint(t);
const bool is_data_space = (t->options & CTX_POSE_BONE) != 0;
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
@@ -150,8 +158,8 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2]))
if (td->flag & TD_SKIP) {
continue;
}
-
- transdata_elem_push_pull(t, tc, td, distance, axis_global, is_data_space);
+ transdata_elem_push_pull(
+ t, tc, td, distance, axis_global, is_lock_constraint, is_data_space);
}
}
else {
@@ -159,6 +167,7 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2]))
.t = t,
.tc = tc,
.axis_global = {UNPACK3(axis_global)},
+ .is_lock_constraint = is_lock_constraint,
.is_data_space = is_data_space,
};
TaskParallelSettings settings;