[Bf-blender-cvs] [2ce9bab] master: Fix python error when OSL file has wrong extension.
Brecht Van Lommel
noreply at git.blender.org
Fri Aug 5 01:01:30 CEST 2016
Commit: 2ce9bab8ce88d25830633b8258063811d861c2f8
Author: Brecht Van Lommel
Date: Fri Aug 5 00:03:28 2016 +0200
Branches: master
https://developer.blender.org/rB2ce9bab8ce88d25830633b8258063811d861c2f8
Fix python error when OSL file has wrong extension.
===================================================================
M intern/cycles/blender/addon/osl.py
===================================================================
diff --git a/intern/cycles/blender/addon/osl.py b/intern/cycles/blender/addon/osl.py
index f4aaaab..19f2ecc 100644
--- a/intern/cycles/blender/addon/osl.py
+++ b/intern/cycles/blender/addon/osl.py
@@ -41,6 +41,8 @@ def update_script_node(node, report):
import shutil
import tempfile
+ oso_file_remove = False
+
if node.mode == 'EXTERNAL':
# compile external script file
script_path = bpy.path.abspath(node.filepath, library=node.id_data.library)
@@ -49,7 +51,6 @@ def update_script_node(node, report):
if script_ext == ".oso":
# it's a .oso file, no need to compile
ok, oso_path = True, script_path
- oso_file_remove = False
elif script_ext == ".osl":
# compile .osl file
ok, oso_path = osl_compile(script_path, report)
@@ -65,7 +66,6 @@ def update_script_node(node, report):
elif os.path.dirname(node.filepath) == "":
# module in search path
oso_path = node.filepath
- oso_file_remove = False
ok = True
else:
# unknown
@@ -88,12 +88,10 @@ def update_script_node(node, report):
osl_file.close()
ok, oso_path = osl_compile(osl_file.name, report)
- oso_file_remove = False
os.remove(osl_file.name)
else:
# compile text datablock from disk directly
ok, oso_path = osl_compile(osl_path, report)
- oso_file_remove = False
if ok:
# read bytecode
More information about the Bf-blender-cvs
mailing list