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:
authorAntonio Vazquez <blendergit@gmail.com>2021-07-20 19:43:04 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-07-20 19:43:04 +0300
commit4aa147a9668362beb1a87b38c31ea2bc2502db2b (patch)
tree6c3aae8e4e69c40ee84344809e31f29de43ac7a1
parenta41bef88abd3d873a080423481a5557d54a7ce24 (diff)
GPencil: Rotate around transform center instead of cage center
The cage center can change during transformation
-rw-r--r--source/blender/editors/gpencil/gpencil_asset.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_asset.c b/source/blender/editors/gpencil/gpencil_asset.c
index 96fc91f6a0d..8d74f271939 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -655,25 +655,22 @@ static void gpencil_asset_transform_strokes(tGPDasset *tgpa,
/* Determine pivot point. */
float pivot[3];
- copy_v3_v3(pivot, tgpa->asset_center);
+ gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->transform_center, pivot);
if (!shift_key) {
if (tgpa->manipulator_index == CAGE_CORNER_N) {
gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_S], pivot);
- sub_v3_v3v3(pivot, pivot, tgpa->ob->loc);
}
else if (tgpa->manipulator_index == CAGE_CORNER_E) {
gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_W], pivot);
- sub_v3_v3v3(pivot, pivot, tgpa->ob->loc);
}
else if (tgpa->manipulator_index == CAGE_CORNER_S) {
gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_N], pivot);
- sub_v3_v3v3(pivot, pivot, tgpa->ob->loc);
}
else if (tgpa->manipulator_index == CAGE_CORNER_W) {
gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_E], pivot);
- sub_v3_v3v3(pivot, pivot, tgpa->ob->loc);
}
}
+ sub_v3_v3v3(pivot, pivot, tgpa->ob->loc);
/* Create rotation matrix. */
float rot_matrix[4][4];