[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24101] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/system/PythonInterpreter.h: Fixed PythonInterpreter::interpretFile() so as to just use add_text()

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Tue Oct 27 00:18:08 CET 2009


Revision: 24101
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24101
Author:   kjym3
Date:     2009-10-27 00:17:48 +0100 (Tue, 27 Oct 2009)

Log Message:
-----------
Fixed PythonInterpreter::interpretFile() so as to just use add_text()
instead of add_empty_text() plus file I/O code of its own.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h	2009-10-26 23:00:06 UTC (rev 24100)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h	2009-10-26 23:17:48 UTC (rev 24101)
@@ -72,16 +72,9 @@
 	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 {





More information about the Bf-blender-cvs mailing list