forked from bartvdbraak/blender
bugfix [#24697]
Proper fix: change the poll function to reflect actual operator requirements.
This commit is contained in:
parent
bc7903c858
commit
7f0877f0dc
@ -171,7 +171,7 @@ void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot)
|
|||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
ot->invoke = select_orientation_invoke;
|
ot->invoke = select_orientation_invoke;
|
||||||
ot->exec = select_orientation_exec;
|
ot->exec = select_orientation_exec;
|
||||||
ot->poll = ED_operator_areaactive;
|
ot->poll = ED_operator_view3d_active;
|
||||||
|
|
||||||
prop= RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
|
RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
|
||||||
|
@ -342,17 +342,15 @@ void BIF_removeTransformOrientationIndex(bContext *C, int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) {
|
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target) {
|
||||||
|
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
|
||||||
View3D *v3d = CTX_wm_view3d(C);
|
View3D *v3d = CTX_wm_view3d(C);
|
||||||
if(v3d) {
|
TransformOrientation *ts = transform_spaces->first;
|
||||||
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
|
int i;
|
||||||
TransformOrientation *ts = transform_spaces->first;
|
|
||||||
int i;
|
for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
|
||||||
|
if (ts == target) {
|
||||||
for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
|
v3d->twmode = V3D_MANIP_CUSTOM + i;
|
||||||
if (ts == target) {
|
break;
|
||||||
v3d->twmode = V3D_MANIP_CUSTOM + i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user