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-09-24 16:35:49 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-09-24 16:36:01 +0300
commit58dc059ad32db15b43f24d235b6f3a5785a6433a (patch)
treef07fdb5e137ab588350da8e188f0dd5006b9e137 /source/blender/editors/transform/transform_mode_translate.c
parentf3ac39b857394d804df04d893517ebd1a403de19 (diff)
Fix T81096, T81127: Errors with the typed value for x-axis constrain
`applyNumInput` does not write all axis values and does not consider the orientation.
Diffstat (limited to 'source/blender/editors/transform/transform_mode_translate.c')
-rw-r--r--source/blender/editors/transform/transform_mode_translate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c
index 758a6d04f11..c17e6e596e0 100644
--- a/source/blender/editors/transform/transform_mode_translate.c
+++ b/source/blender/editors/transform/transform_mode_translate.c
@@ -355,7 +355,7 @@ static void applyTranslationValue(TransInfo *t, const float vec[3])
static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
{
char str[UI_MAX_DRAW_STR];
- float global_dir[3];
+ float global_dir[3] = {0.0f};
if (t->flag & T_INPUT_IS_VALUES_FINAL) {
mul_v3_m3v3(global_dir, t->spacemtx, t->values);
@@ -363,7 +363,7 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
else if (applyNumInput(&t->num, global_dir)) {
if (t->con.mode & CON_APPLY) {
if (t->con.mode & CON_AXIS0) {
- /* Do nothing. */
+ mul_v3_v3fl(global_dir, t->spacemtx[0], global_dir[0]);
}
else if (t->con.mode & CON_AXIS1) {
mul_v3_v3fl(global_dir, t->spacemtx[1], global_dir[0]);
@@ -372,6 +372,9 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
mul_v3_v3fl(global_dir, t->spacemtx[2], global_dir[0]);
}
}
+ else {
+ mul_v3_m3v3(global_dir, t->spacemtx, global_dir);
+ }
}
else {
copy_v3_v3(global_dir, t->values);