diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-03 19:05:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-03 19:05:09 +0400 |
commit | 060ea498b0565764d154ce968cde173e5676a521 (patch) | |
tree | fab3a841271a090f1fe625a218be9f92bd46041e /intern | |
parent | eb87529e23cdc744ed52b00f3de25e208b29d7f1 (diff) |
use library argument for bpy.path.abspath in case of linked nodes.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/osl.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/blender/addon/osl.py b/intern/cycles/blender/addon/osl.py index 6b46fefce92..aac1e2422b9 100644 --- a/intern/cycles/blender/addon/osl.py +++ b/intern/cycles/blender/addon/osl.py @@ -39,7 +39,7 @@ def update_script_node(node, report): if node.mode == 'EXTERNAL': # compile external script file - script_path = bpy.path.abspath(node.filepath) + script_path = bpy.path.abspath(node.filepath, library=node.id_data.library) script_path_noext, script_ext = os.path.splitext(script_path) if script_ext == ".oso": @@ -75,7 +75,7 @@ def update_script_node(node, report): elif node.mode == 'INTERNAL' and node.script: # internal script, we will store bytecode in the node script = node.script - osl_path = bpy.path.abspath(script.filepath) + osl_path = bpy.path.abspath(script.filepath, library=script.library) if script.is_in_memory or script.is_dirty or script.is_modified or not os.path.exists(osl_path): # write text datablock contents to temporary file @@ -97,7 +97,10 @@ def update_script_node(node, report): node.bytecode = oso.read() oso.close() except: - report({'ERROR'}, "Can't read OSO bytecode to store in node at " + oso_path) + import traceback + traceback.print_exc() + + report({'ERROR'}, "Can't read OSO bytecode to store in node at %r" % oso_path) ok = False else: |