diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-10-27 02:17:48 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-10-27 02:17:48 +0300 |
commit | d56a0fd72d58bc2504bfe43cbe3db8c3d4c226f4 (patch) | |
tree | e823d468ad316f1bd5365653a9c4816c1dd8f5f8 /source/blender/freestyle | |
parent | a9a4dee0d04e30d2e5706dbccd32b567ae4a0d0f (diff) |
Fixed PythonInterpreter::interpretFile() so as to just use add_text()
instead of add_empty_text() plus file I/O code of its own.
Diffstat (limited to 'source/blender/freestyle')
-rwxr-xr-x | source/blender/freestyle/intern/system/PythonInterpreter.h | 11 |
1 files changed, 2 insertions, 9 deletions
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 { |