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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-10-05 16:04:02 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-10-05 16:05:06 +0300
commit54f248fa87afd4836fb7154056cd0e8d920401f1 (patch)
tree7282d8345c80feb3c2cbe105dd917f6083c4db0b
parent3df90de6c2268bef91d3754f71c7404cfbeeac90 (diff)
Transform: Use orientation of active object with Auto Constraint
Fix T81429. This was an intentional change in rBc75a665c442e as it maintains the same behavior as the constraint with or without modifier. But from the user's PoV, it is better to keep the old behavior. This makes drawing and behavior more intuitive.
-rw-r--r--source/blender/editors/transform/transform_constraints.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 27ece728276..9cb8d97393a 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -698,25 +698,34 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[])
const char *spacename = transform_orientations_spacename_get(t, orientation);
BLI_snprintf(text, sizeof(text), ftext, spacename);
- switch (orientation) {
- case V3D_ORIENT_LOCAL:
- setLocalConstraint(t, mode, text);
- break;
- case V3D_ORIENT_NORMAL:
- if (checkUseAxisMatrix(t)) {
- setAxisMatrixConstraint(t, mode, text);
+ if (t->modifiers & (MOD_CONSTRAINT_SELECT | MOD_CONSTRAINT_PLANE)) {
+ /* Force the orientation of the active object.
+ * Although possible, it is not convenient to use the local or axis constraint
+ * with the modifier to select constraint.
+ * This also follows the convention of older versions. */
+ setConstraint(t, mode, text);
+ }
+ else {
+ switch (orientation) {
+ case V3D_ORIENT_LOCAL:
+ setLocalConstraint(t, mode, text);
+ break;
+ case V3D_ORIENT_NORMAL:
+ if (checkUseAxisMatrix(t)) {
+ setAxisMatrixConstraint(t, mode, text);
+ break;
+ }
+ ATTR_FALLTHROUGH;
+ case V3D_ORIENT_GLOBAL:
+ case V3D_ORIENT_VIEW:
+ case V3D_ORIENT_CURSOR:
+ case V3D_ORIENT_GIMBAL:
+ case V3D_ORIENT_CUSTOM_MATRIX:
+ case V3D_ORIENT_CUSTOM:
+ default: {
+ setConstraint(t, mode, text);
break;
}
- ATTR_FALLTHROUGH;
- case V3D_ORIENT_GLOBAL:
- case V3D_ORIENT_VIEW:
- case V3D_ORIENT_CURSOR:
- case V3D_ORIENT_GIMBAL:
- case V3D_ORIENT_CUSTOM_MATRIX:
- case V3D_ORIENT_CUSTOM:
- default: {
- setConstraint(t, mode, text);
- break;
}
}
t->con.mode |= CON_USER;