From 060ea498b0565764d154ce968cde173e5676a521 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 3 Nov 2012 15:05:09 +0000 Subject: [PATCH] use library argument for bpy.path.abspath in case of linked nodes. --- intern/cycles/blender/addon/osl.py | 9 ++++++--- 1 file 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: