3D View: remove poll 3D view for copy/paste

These operators only need selected objects.
This commit is contained in:
Campbell Barton
2018-05-24 16:40:33 +02:00
parent 1318660b04
commit 8d9faf840b
3 changed files with 11 additions and 2 deletions

View File

@@ -140,6 +140,7 @@ int ED_operator_screen_mainwinactive(struct bContext *C);
int ED_operator_areaactive(struct bContext *C);
int ED_operator_regionactive(struct bContext *C);
int ED_operator_scene(struct bContext *C);
int ED_operator_scene_editable(struct bContext *C);
int ED_operator_objectmode(struct bContext *C);

View File

@@ -138,6 +138,14 @@ int ED_operator_screen_mainwinactive(bContext *C)
return 1;
}
int ED_operator_scene(bContext *C)
{
Scene *scene = CTX_data_scene(C);
if (scene)
return 1;
return 0;
}
int ED_operator_scene_editable(bContext *C)
{
Scene *scene = CTX_data_scene(C);

View File

@@ -109,7 +109,7 @@ static void VIEW3D_OT_copybuffer(wmOperatorType *ot)
/* api callbacks */
ot->exec = view3d_copybuffer_exec;
ot->poll = ED_operator_view3d_active;
ot->poll = ED_operator_scene;
}
static int view3d_pastebuffer_exec(bContext *C, wmOperator *op)
@@ -146,7 +146,7 @@ static void VIEW3D_OT_pastebuffer(wmOperatorType *ot)
/* api callbacks */
ot->exec = view3d_pastebuffer_exec;
ot->poll = ED_operator_view3d_active;
ot->poll = ED_operator_scene_editable;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;