- Python console argument '--python-console', option so you can start blender and drop into a python console, (useful for debugging some problems on a renderfarm over ssh)

- Also made it so sys.stdin isnt overwritten anymore, instead the interactive consoel overwrites while it executes and restores after.

- removed hope folder from sphinx patch path
This commit is contained in:
2010-05-30 14:05:58 +00:00
parent a668915404
commit 1658a28a58
9 changed files with 106 additions and 40 deletions

View File

@@ -528,7 +528,7 @@ int BPY_run_python_script_space(const char *modulename, const char *func)
#endif
int BPY_button_eval(bContext *C, char *expr, double *value)
int BPY_eval_button(bContext *C, const char *expr, double *value)
{
PyGILState_STATE gilstate;
PyObject *dict, *mod, *retval;
@@ -599,6 +599,40 @@ int BPY_button_eval(bContext *C, char *expr, double *value)
return error_ret;
}
int BPY_eval_string(bContext *C, const char *expr)
{
PyGILState_STATE gilstate;
PyObject *dict, *retval;
int error_ret = 0;
if (!expr) return -1;
if(expr[0]=='\0') {
return error_ret;
}
bpy_context_set(C, &gilstate);
dict= CreateGlobalDictionary(C, NULL);
retval = PyRun_String(expr, Py_eval_input, dict, dict);
if (retval == NULL) {
error_ret= -1;
BPy_errors_to_report(CTX_wm_reports(C));
}
else {
Py_DECREF(retval);
}
Py_DECREF(dict);
bpy_context_clear(C, &gilstate);
return error_ret;
}
void BPY_load_user_modules(bContext *C)
{
PyGILState_STATE gilstate;