* temporary PKey in the script and 3D view runs "./test.py" (for testing PyOperators that need to run in the user interface context atm)

* added ED_SCRIPT_OT_run_pyfile that takes a filename argument.
* RNA_property_string_set didn't add a value to ID props if the prop wasnt there (like ints, floats and bools do)
* bpy_operator.c - raise an error when unknown keyword args are passed to any operator .

Examples of bpy operator api...

bpyoperator.ED_VIEW3D_OT_viewhome(center=1)
bpyoperator.ED_SCR_OT_frame_offset(delta=10)
bpyoperator.ED_VIEW3D_OT_make_parent(type='OBJECT')

At the moment there is no way to stop the operators .invoke() function from running so ED_VIEW3D_OT_make_parent still opens the menu even though it doesn't need to.
This commit is contained in:
2008-12-25 14:17:54 +00:00
parent d7e8becefe
commit de9437e57a
9 changed files with 208 additions and 20 deletions

View File

@@ -72,9 +72,9 @@ void BPY_run_python_script( bContext *C, const char *fn )
PyObject *py_dict, *py_result;
char pystring[512];
PyGILState_STATE gilstate;
/* TODO - look into a better way to run a file */
sprintf(pystring, "exec(open(r'%s').read())", fn);
sprintf(pystring, "exec(open(r'%s').read())", fn);
BPY_start_python();