diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 03:17:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 03:17:45 +0400 |
commit | 769ab3eed81e8b14dff46af7ca28e2b70a7aac41 (patch) | |
tree | 5c8949a5fddfc7a287375c2d0913cdf2150feff7 /intern/cycles/blender/addon/osl.py | |
parent | 97d62f018397d279f6f1654c76d1e6b414c9d343 (diff) |
code cleanup:
- cycles ui used 'cscene' for scene.cycles and scene.cycles_curves
- style cleanup
Diffstat (limited to 'intern/cycles/blender/addon/osl.py')
-rw-r--r-- | intern/cycles/blender/addon/osl.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/intern/cycles/blender/addon/osl.py b/intern/cycles/blender/addon/osl.py index 79ce3df20c3..0a67edac1e3 100644 --- a/intern/cycles/blender/addon/osl.py +++ b/intern/cycles/blender/addon/osl.py @@ -18,10 +18,13 @@ # <pep8 compliant> -import bpy, _cycles, os, tempfile +import bpy +import _cycles + -# compile .osl file with given filepath to temporary .oso file def osl_compile(input_path, report): + """compile .osl file with given filepath to temporary .oso file""" + import tempfile output_file = tempfile.NamedTemporaryFile(mode='w', suffix=".oso", delete=False) output_path = output_file.name output_file.close() @@ -33,9 +36,12 @@ def osl_compile(input_path, report): return ok, output_path -# compile and update shader script node + def update_script_node(node, report): - import os, shutil + """compile and update shader script node""" + import os + import shutil + import tempfile if node.mode == 'EXTERNAL': # compile external script file @@ -103,7 +109,7 @@ def update_script_node(node, report): report({'ERROR'}, "Can't read OSO bytecode to store in node at %r" % oso_path) ok = False - + else: report({'WARNING'}, "No text or file specified in node, nothing to compile") return @@ -125,4 +131,3 @@ def update_script_node(node, report): pass return ok - |