Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-06-16 17:09:36 +0400
committerTon Roosendaal <ton@blender.org>2009-06-16 17:09:36 +0400
commit2d40b8d56ff100b71dac7c4694f6115dcc0b01b5 (patch)
treee6ad74b116dccf3442290ba4a76bd314729bce6b /source/blender/editors/mesh
parent7d026421142306dee486628bd15d4f5aa2b77481 (diff)
2.5
Added SpaceLogic, to restore the old logic buttons into. In future it can be used for a more advanced logic editor, with states, behaviour, whatever. We'll see! This commit only adds the backend for new space. Committed this now as reference for when we need another space type. It's still not well plugin-able (dynamic space types), but my idea is to just have a new SpacePlugIn for this, with a neat small API to define all relevant callbacks. Also note the icon for the spacetype is wrong still.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_lib.c9
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c6
-rw-r--r--source/blender/editors/mesh/mesh_intern.h1
3 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c
index bfa381550df..e1b63022dd4 100644
--- a/source/blender/editors/mesh/editmesh_lib.c
+++ b/source/blender/editors/mesh/editmesh_lib.c
@@ -51,11 +51,13 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data
#include "BLI_editVert.h"
#include "BKE_customdata.h"
+#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_utildefines.h"
#include "ED_mesh.h"
+#include "ED_screen.h"
#include "ED_view3d.h"
#include "mesh_intern.h"
@@ -2278,3 +2280,10 @@ void EM_free_uv_vert_map(UvVertMap *vmap)
}
}
+/* poll call for mesh operators requiring a view3d context */
+int EM_view3d_poll(bContext *C)
+{
+ if(ED_operator_editmesh(C) && ED_operator_view3d_active(C))
+ return 1;
+ return 0;
+}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 83ef88a48a3..b26fded4fb6 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -966,7 +966,7 @@ void MESH_OT_spin(wmOperatorType *ot)
/* api callbacks */
ot->invoke= spin_mesh_invoke;
ot->exec= spin_mesh_exec;
- ot->poll= ED_operator_editmesh;
+ ot->poll= EM_view3d_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1073,7 +1073,7 @@ void MESH_OT_screw(wmOperatorType *ot)
/* api callbacks */
ot->invoke= screw_mesh_invoke;
ot->exec= screw_mesh_exec;
- ot->poll= ED_operator_editmesh;
+ ot->poll= EM_view3d_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -4995,7 +4995,7 @@ void MESH_OT_rip(wmOperatorType *ot)
/* api callbacks */
ot->invoke= mesh_rip_invoke;
- ot->poll= ED_operator_editmesh; // XXX + v3d!
+ ot->poll= EM_view3d_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index f7d2fcfc1f2..83a4211dda1 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -135,6 +135,7 @@ extern int convex(float *v1, float *v2, float *v3, float *v4);
extern struct EditFace *EM_face_from_faces(EditMesh *em, struct EditFace *efa1,
struct EditFace *efa2, int i1, int i2, int i3, int i4);
+extern int EM_view3d_poll(struct bContext *C);
/* ******************* editmesh_loop.c */