diff options
Diffstat (limited to 'release/scripts/io/netrender/repath.py')
-rw-r--r--[-rwxr-xr-x] | release/scripts/io/netrender/repath.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/release/scripts/io/netrender/repath.py b/release/scripts/io/netrender/repath.py index 7f9befd34fb..3ac9636b628 100755..100644 --- a/release/scripts/io/netrender/repath.py +++ b/release/scripts/io/netrender/repath.py @@ -66,10 +66,10 @@ def update(job): def process(paths): def processPointCache(point_cache): - point_cache.external = False + point_cache.use_external = False def processFluid(fluid): - new_path = path_map.get(fluid.path, None) + new_path = path_map.get(fluid.filepath, None) if new_path: fluid.path = new_path @@ -83,14 +83,17 @@ def process(paths): elif paths[i].endswith(".bobj.gz"): path_map[os.path.split(paths[i])[0]] = os.path.split(paths[i+1])[0] else: - path_map[paths[i]] = paths[i+1] + path_map[os.path.split(paths[i])[1]] = paths[i+1] + + # TODO original paths aren't really the orignal path (they are the normalized path + # so we repath using the filenames only. ########################### # LIBRARIES ########################### for lib in bpy.data.libraries: - file_path = bpy.utils.expandpath(lib.filepath) - new_path = path_map.get(file_path, None) + file_path = bpy.path.abspath(lib.filepath) + new_path = path_map.get(os.path.split(file_path)[1], None) if new_path: lib.filepath = new_path @@ -99,8 +102,8 @@ def process(paths): ########################### for image in bpy.data.images: if image.source == "FILE" and not image.packed_file: - file_path = bpy.utils.expandpath(image.filepath) - new_path = path_map.get(file_path, None) + file_path = bpy.path.abspath(image.filepath) + new_path = path_map.get(os.path.split(file_path)[1], None) if new_path: image.filepath = new_path @@ -118,10 +121,10 @@ def process(paths): processPointCache(modifier.point_cache) elif modifier.type == "SMOKE" and modifier.smoke_type == "TYPE_DOMAIN": processPointCache(modifier.domain_settings.point_cache_low) - if modifier.domain_settings.highres: + if modifier.domain_settings.use_high_resolution: processPointCache(modifier.domain_settings.point_cache_high) - elif modifier.type == "MULTIRES" and modifier.external: - file_path = bpy.utils.expandpath(modifier.filepath) + elif modifier.type == "MULTIRES" and modifier.is_external: + file_path = bpy.path.abspath(modifier.filepath) new_path = path_map.get(file_path, None) if new_path: modifier.filepath = new_path @@ -144,4 +147,4 @@ if __name__ == "__main__": process(args) - bpy.ops.wm.save_as_mainfile(path=new_path, check_existing=False) + bpy.ops.wm.save_as_mainfile(filepath=new_path, check_existing=False) |