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:
authorCampbell Barton <ideasman42@gmail.com>2021-10-29 06:58:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-29 07:00:25 +0300
commitb546202a9afa5ee358893d82e6a1ba0f69cca254 (patch)
tree9505579a4808d4f579a52b28ffd956f10384b6fd
parentc8aaa00e0070e23ec5c4e949595a1af554639b99 (diff)
Gizmo: support showing transform gizmos in pose + weight-paint mode
These can be enabled in the gizmos popover.
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index e4c20fa0be1..466c4202dbd 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -646,10 +646,8 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
View3D *v3d = area->spacedata.first;
- Object *obedit = CTX_data_edit_object(C);
RegionView3D *rv3d = region->regiondata;
Base *base;
- Object *ob = OBACT(view_layer);
bGPdata *gpd = CTX_data_gpencil_data(C);
const bool is_gp_edit = GPENCIL_ANY_MODE(gpd);
const bool is_curve_edit = GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd);
@@ -660,6 +658,15 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
(params->orientation_index - 1) :
BKE_scene_orientation_get_index(scene, SCE_ORIENT_DEFAULT);
+ Object *ob = OBACT(view_layer);
+ Object *obedit = OBEDIT_FROM_OBACT(ob);
+ if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
+ Object *obpose = BKE_object_pose_armature_get(ob);
+ if (obpose != NULL) {
+ ob = obpose;
+ }
+ }
+
/* transform widget matrix */
unit_m4(rv3d->twmat);