[Bf-blender-cvs] [58dc059ad32] master: Fix T81096, T81127: Errors with the typed value for x-axis constrain
Germano Cavalcante
noreply at git.blender.org
Thu Sep 24 15:46:10 CEST 2020
Commit: 58dc059ad32db15b43f24d235b6f3a5785a6433a
Author: Germano Cavalcante
Date: Thu Sep 24 10:35:49 2020 -0300
Branches: master
https://developer.blender.org/rB58dc059ad32db15b43f24d235b6f3a5785a6433a
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.
===================================================================
M source/blender/editors/transform/transform_mode_edge_seq_slide.c
M source/blender/editors/transform/transform_mode_translate.c
===================================================================
diff --git a/source/blender/editors/transform/transform_mode_edge_seq_slide.c b/source/blender/editors/transform/transform_mode_edge_seq_slide.c
index d2474d78387..befd54c3636 100644
--- a/source/blender/editors/transform/transform_mode_edge_seq_slide.c
+++ b/source/blender/editors/transform/transform_mode_edge_seq_slide.c
@@ -93,13 +93,13 @@ static void applySeqSlideValue(TransInfo *t, const float val[2])
static void applySeqSlide(TransInfo *t, const int mval[2])
{
char str[UI_MAX_DRAW_STR];
- float values_final[3];
+ float values_final[2] = {0.0f};
snapSequenceBounds(t, mval);
if (applyNumInput(&t->num, values_final)) {
if (t->con.mode & CON_APPLY) {
if (t->con.mode & CON_AXIS0) {
- /* Do nothing. */
+ mul_v2_v2fl(values_final, t->spacemtx[0], values_final[0]);
}
else {
mul_v2_v2fl(values_final, t->spacemtx[1], values_final[0]);
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);
More information about the Bf-blender-cvs
mailing list