diff options
author | Pratik Borhade <PratikPB2123> | 2022-06-27 16:37:09 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-06-27 16:38:34 +0300 |
commit | 279e7dac7dcfc0a7d4126c55a23a745362c293dc (patch) | |
tree | 777621bcccc458eec2cd452b3ade560e503b94ff /source | |
parent | 83c2cbb880c0292e3bf01a34eb92a953d1359955 (diff) |
Fix T99070: Apply transform fails to clear delta transform values
Clear delta transform value after applying transform.
Include delta location while applying transform.
Use `copy_v3_fl` for resetting object scale
Reviewed By: mano-wii
Maniphest Tasks: T99070
Differential Revision: https://developer.blender.org/D15270
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_transform.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index 82e67231ec1..70c3eed3768 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -855,7 +855,7 @@ static int apply_objects_internal(bContext *C, /* calculate translation */ if (apply_loc) { - copy_v3_v3(mat[3], ob->loc); + add_v3_v3v3(mat[3], ob->loc, ob->dloc); if (!(apply_scale && apply_rot)) { float tmat[3][3]; @@ -1023,12 +1023,15 @@ static int apply_objects_internal(bContext *C, else { if (apply_loc) { zero_v3(ob->loc); + zero_v3(ob->dloc); } if (apply_scale) { - ob->scale[0] = ob->scale[1] = ob->scale[2] = 1.0f; + copy_v3_fl(ob->scale, 1.0f); + copy_v3_fl(ob->dscale, 1.0f); } if (apply_rot) { zero_v3(ob->rot); + zero_v3(ob->drot); unit_qt(ob->quat); unit_axis_angle(ob->rotAxis, &ob->rotAngle); } |