[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51839] trunk/blender/intern/cycles/ blender/addon/osl.py: use library argument for bpy.path. abspath in case of linked nodes.
Campbell Barton
ideasman42 at gmail.com
Sat Nov 3 16:05:11 CET 2012
Revision: 51839
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51839
Author: campbellbarton
Date: 2012-11-03 15:05:09 +0000 (Sat, 03 Nov 2012)
Log Message:
-----------
use library argument for bpy.path.abspath in case of linked nodes.
Modified Paths:
--------------
trunk/blender/intern/cycles/blender/addon/osl.py
Modified: trunk/blender/intern/cycles/blender/addon/osl.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/osl.py 2012-11-03 14:32:35 UTC (rev 51838)
+++ trunk/blender/intern/cycles/blender/addon/osl.py 2012-11-03 15:05:09 UTC (rev 51839)
@@ -39,7 +39,7 @@
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 @@
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 @@
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:
More information about the Bf-blender-cvs
mailing list