NetRender

Repath functionality: Edit paths in blend file on slaves to match the transfered files.
Tested with textures and point caches. Fluid should work. Point Caches with the External option might not.


This should fix previous problems when using absolute paths in blend files.
This commit is contained in:
2010-05-02 21:34:08 +00:00
parent 31cfad9fda
commit 139f456bd1
5 changed files with 172 additions and 10 deletions

View File

@@ -28,7 +28,7 @@ try:
except:
bpy = None
VERSION = bytes("0.8", encoding='utf8')
VERSION = bytes("0.9", encoding='utf8')
# Jobs status
JOB_WAITING = 0 # before all data has been entered
@@ -166,18 +166,21 @@ def hashData(data):
return m.hexdigest()
def prefixPath(prefix_directory, file_path, prefix_path):
def prefixPath(prefix_directory, file_path, prefix_path, force = False):
if os.path.isabs(file_path):
# if an absolute path, make sure path exists, if it doesn't, use relative local path
full_path = file_path
if not os.path.exists(full_path):
if force or not os.path.exists(full_path):
p, n = os.path.split(full_path)
if prefix_path and p.startswith(prefix_path):
directory = prefix_directory + p[len(prefix_path):]
full_path = directory + os.sep + n
if not os.path.exists(directory):
os.mkdir(directory)
if len(prefix_path) < len(p):
directory = prefix_directory + p[len(prefix_path)+1:] + os.sep # +1 to remove separator
if not os.path.exists(directory):
os.mkdir(directory)
else:
directory = prefix_directory
full_path = directory + n
else:
full_path = prefix_directory + n
else: