[Bf-blender-cvs] [f914311949a] gsoc-2018-many-light-sampling: 3D View: remove poll 3D view for copy/paste
Campbell Barton
noreply at git.blender.org
Fri Jun 1 16:17:25 CEST 2018
Commit: f914311949a4b32e7474cfdf9b92bd159eaa8e25
Author: Campbell Barton
Date: Thu May 24 16:40:33 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rBf914311949a4b32e7474cfdf9b92bd159eaa8e25
3D View: remove poll 3D view for copy/paste
These operators only need selected objects.
===================================================================
M source/blender/editors/include/ED_screen.h
M source/blender/editors/screen/screen_ops.c
M source/blender/editors/space_view3d/view3d_ops.c
===================================================================
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index af4abc60a23..dca4e7bf813 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -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);
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index cbdf05a1c82..4ecbeeed837 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -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);
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index d71639c35d2..d897b1b13af 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -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;
More information about the Bf-blender-cvs
mailing list