diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-03 17:29:28 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-03 17:29:36 +0300 |
commit | 4e1a1821e04aa54d536f49018156e0f9cf95cf7e (patch) | |
tree | 74988929041c302f84617460a839bd78e0639205 /source | |
parent | 391af6bea256e11cbc599ac8b15278e2f956ea01 (diff) |
Fix T90313: Align to Transform Orientation Axis Property Doesn't Work
`Orientation Axis` is a property incompatible with `Align` mode and
should not be visible.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 2c424d8ace3..45c077b8a07 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -371,25 +371,24 @@ static void transformops_exit(bContext *C, wmOperator *op) G.moving = 0; } +static int transformops_mode(wmOperator *op) +{ + for (TransformModeItem *tmode = transform_modes; tmode->idname; tmode++) { + if (op->type->idname == tmode->idname) { + return tmode->mode; + } + } + + return RNA_enum_get(op->ptr, "mode"); +} + static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) { int retval = 1; if (op->customdata == NULL) { TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data2"); - TransformModeItem *tmode; - int mode = -1; - - for (tmode = transform_modes; tmode->idname; tmode++) { - if (op->type->idname == tmode->idname) { - mode = tmode->mode; - break; - } - } - - if (mode == -1) { - mode = RNA_enum_get(op->ptr, "mode"); - } + int mode = transformops_mode(op); retval = initTransform(C, t, op, event, mode); /* store data */ @@ -556,6 +555,16 @@ static bool transform_poll_property(const bContext *UNUSED(C), } } + /* Orientation Axis. */ + { + if (STREQ(prop_id, "orient_axis")) { + eTfmMode mode = (eTfmMode)transformops_mode(op); + if (mode == TFM_ALIGN) { + return false; + } + } + } + /* Proportional Editing. */ { PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "use_proportional_edit"); |