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.
This commit is contained in:
Germano Cavalcante 2021-08-03 11:29:28 -03:00
parent 391af6bea2
commit 4e1a1821e0
Notes: blender-bot 2023-02-13 18:01:30 +01:00
Referenced by issue #90313, Align to Transform Orientation Axis Property Doesn't Work
1 changed files with 22 additions and 13 deletions

View File

@ -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");