Blender Git Commit Log
Git Commits -> Revision 1bc67f3
Revision 1bc67f3 by Joseph Eagar (master) March 2, 2009, 04:08 (GMT) |
Created a printf-style method of calling operators. I did this to cut down on duplicated code, and also because calling operators was such a pain. The basic form of the format is "opname %[code]", where each % matches to an argument. The codes are fairly simple: d - int i - int f - float h[v/e/f] - all verts/edges/faces with a certain header flag. f[v/e/f] - all verts/edges/faces with a certain flag. For example: EDBM_CallOpf(em, op, "dissolveverts %hv", BM_SELECT) will call the dissolve verts operator. The relevent functions are: //calls a bmesh operator, doing necassary conversions and error reporting. int EDBM_CallOpf(EditMesh *em, struct wmOperator *op, char *fmt, ...); //execute an operator int BMO_CallOpf(BMesh *bm, char *fmt, ...); //initializes but doesn't execute an op. int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...); //vlist version of above. int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist); Note this system is dependant on getting the slot codes from the argument order. I'd like to make it better, possibly pass in slot names, but that'd mean actually giving the slots names (which I can do, but wanted to discuss with Briggs and others what I have now first). |
Commit Details:
Full Hash: 1bc67f36d682bb4e5786dee7adfacdc844f1a539
SVN Revision: 19167
Parent Commit: 3faf2b6
Lines Changed: +209, -35
6 Modified Paths:
/source/blender/bmesh/bmesh_operators.h (+12, -2) (Diff)
/source/blender/bmesh/intern/bmesh_opdefines.c (+12, -0) (Diff)
/source/blender/bmesh/intern/bmesh_operators.c (+149, -0) (Diff)
/source/blender/editors/mesh/bmeshutils.c (+27, -2) (Diff)
/source/blender/editors/mesh/editmesh_tools.c (+4, -30) (Diff)
/source/blender/editors/mesh/mesh_intern.h (+5, -1) (Diff)
/source/blender/bmesh/intern/bmesh_opdefines.c (+12, -0) (Diff)
/source/blender/bmesh/intern/bmesh_operators.c (+149, -0) (Diff)
/source/blender/editors/mesh/bmeshutils.c (+27, -2) (Diff)
/source/blender/editors/mesh/editmesh_tools.c (+4, -30) (Diff)
/source/blender/editors/mesh/mesh_intern.h (+5, -1) (Diff)