From d56a0fd72d58bc2504bfe43cbe3db8c3d4c226f4 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Mon, 26 Oct 2009 23:17:48 +0000 Subject: Fixed PythonInterpreter::interpretFile() so as to just use add_text() instead of add_empty_text() plus file I/O code of its own. --- source/blender/freestyle/intern/system/PythonInterpreter.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'source/blender/freestyle') diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h index 314b91228ce..e04e1d9b9d1 100755 --- a/source/blender/freestyle/intern/system/PythonInterpreter.h +++ b/source/blender/freestyle/intern/system/PythonInterpreter.h @@ -72,16 +72,9 @@ class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter int status = BPY_run_python_script(_context, fn, NULL, reports); #else int status; - FILE *fp = fopen(fn, "r"); - if (fp) { - struct Text *text = add_empty_text("tmp_freestyle.txt"); - char buf[256]; - while (fgets(buf, sizeof(buf), fp) != NULL) - txt_insert_buf(text, buf); - fclose(fp); - + Text *text = add_text(fn, G.sce); + if (text) { status = BPY_run_python_script(_context, NULL, text, reports); - unlink_text(G.main, text); free_libblock(&G.main->text, text); } else { -- cgit v1.2.3