diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-10 18:27:01 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-10 18:32:46 +0300 |
commit | bdb83cc32cbd0997752420ef95c791f66dca54c8 (patch) | |
tree | faf31e7434a245d75e0435f98fe5079d1ff97cf0 /source/blender/editors/transform/transform_convert.c | |
parent | d9eeb7840f52d9fdbb6c4a5d3f1f2b2944fbcc6e (diff) |
Fix T85471: Wrong orientation in transforming objects in weight paint mode
The local orientation chosen was that of the active object, but as
confirmed in other parts of the code, the orientation of the selected
Bone has priority.
Diffstat (limited to 'source/blender/editors/transform/transform_convert.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 4f581ad962d..848aa06238e 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -1103,21 +1103,13 @@ void createTransData(bContext *C, TransInfo *t) convert_type = TC_POSE; } else if (ob && (ob->mode & OB_MODE_ALL_WEIGHT_PAINT) && !(t->options & CTX_PAINT_CURVE)) { - /* Important that ob_armature can be set even when its not selected T23412. - * Lines below just check is also visible. */ - Object *ob_armature = BKE_modifiers_is_deformed_by_armature(ob); - if (ob_armature && ob_armature->mode & OB_MODE_POSE) { - Base *base_arm = BKE_view_layer_base_find(t->view_layer, ob_armature); - if (base_arm) { - View3D *v3d = t->view; - if (BASE_VISIBLE(v3d, base_arm)) { - Object *objects[1]; - objects[0] = ob_armature; - uint objects_len = 1; - initTransDataContainers_FromObjectData(t, ob_armature, objects, objects_len); - convert_type = TC_POSE; - } - } + Object *ob_armature = transform_object_deform_pose_armature_get(t, ob); + if (ob_armature) { + Object *objects[1]; + objects[0] = ob_armature; + uint objects_len = 1; + initTransDataContainers_FromObjectData(t, ob_armature, objects, objects_len); + convert_type = TC_POSE; } } else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT) && |