diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-23 01:06:04 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-23 01:06:24 +0300 |
commit | 51bf04383aa0300b60bca71c5ce388e338751932 (patch) | |
tree | d90a6fa87833aef2f3f8af8147520a7fdc035e98 /source/blender/editors/transform/transform_mode.c | |
parent | 2fdca5bd1981cddad16715598b4892a2c6099e2f (diff) |
Fix T78045: CTL-ALT-S does nothing in pose mode and crashes when called from the menu
Diffstat (limited to 'source/blender/editors/transform/transform_mode.c')
-rw-r--r-- | source/blender/editors/transform/transform_mode.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index f028044809f..baf4bba80df 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -50,6 +50,23 @@ /* Own include. */ #include "transform_mode.h" +int transform_mode_really_used(bContext *C, int mode) +{ + if (mode == TFM_BONESIZE) { + Object *ob = CTX_data_active_object(C); + BLI_assert(ob); + if (ob->type != OB_ARMATURE) { + return TFM_RESIZE; + } + bArmature *arm = ob->data; + if (arm->drawtype == ARM_ENVELOPE) { + return TFM_BONE_ENVELOPE_DIST; + } + } + + return mode; +} + bool transdata_check_local_center(TransInfo *t, short around) { return ((around == V3D_AROUND_LOCAL_ORIGINS) && @@ -1174,25 +1191,12 @@ void transform_mode_init(TransInfo *t, wmOperator *op, const int mode) case TFM_CREASE: initCrease(t); break; - case TFM_BONESIZE: { /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */ - /* Note: we have to pick one, use the active object. */ - TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_OK(t); - bArmature *arm = tc->poseobj->data; - if (arm->drawtype == ARM_ENVELOPE) { - initBoneEnvelope(t); - t->mode = TFM_BONE_ENVELOPE_DIST; - } - else { - initBoneSize(t); - } + case TFM_BONESIZE: + initBoneSize(t); break; - } case TFM_BONE_ENVELOPE: - initBoneEnvelope(t); - break; case TFM_BONE_ENVELOPE_DIST: initBoneEnvelope(t); - t->mode = TFM_BONE_ENVELOPE_DIST; break; case TFM_EDGE_SLIDE: case TFM_VERT_SLIDE: { |