diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-03-02 07:08:24 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-03-02 07:08:24 +0300 |
commit | 1bc67f36d682bb4e5786dee7adfacdc844f1a539 (patch) | |
tree | e8814c4dddc24f6595bbcb2cab525d9ee548d7ed /source/blender/SConscript | |
parent | 3faf2b6db7cbe42c3439cad09b7035a25fa5c6c2 (diff) |
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).
Diffstat (limited to 'source/blender/SConscript')
0 files changed, 0 insertions, 0 deletions