Revision: 30447 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30447 Author: theeth Date: 2010-07-17 20:40:00 +0200 (Sat, 17 Jul 2010)
Log Message: ----------- netrender - Temporary fix for linked libs repathing (didn't work correctly when using relative links). - autorefresh only for main page (on job page, it's really annoying because it keeps reseting results preview, so until that's fixed, off it is). Modified Paths: -------------- trunk/blender/release/scripts/io/netrender/master_html.py trunk/blender/release/scripts/io/netrender/repath.py trunk/blender/release/scripts/io/netrender/slave.py trunk/blender/release/scripts/io/netrender/utils.py Modified: trunk/blender/release/scripts/io/netrender/master_html.py =================================================================== --- trunk/blender/release/scripts/io/netrender/master_html.py 2010-07-17 18:08:14 UTC (rev 30446) +++ trunk/blender/release/scripts/io/netrender/master_html.py 2010-07-17 18:40:00 UTC (rev 30447) @@ -27,9 +27,10 @@ def output(text): handler.wfile.write(bytes(text, encoding='utf8')) - def head(title): + def head(title, refresh = False): output("<html><head>") - output("<meta http-equiv='refresh' content=5>") + if refresh: + output("<meta http-equiv='refresh' content=5>") output("<script src='/html/netrender.js' type='text/javascript'></script>") # output("<script src='/html/json2.js' type='text/javascript'></script>") output("<title>") @@ -104,7 +105,7 @@ f.close() elif handler.path == "/html" or handler.path == "/": handler.send_head(content = "text/html") - head("NetRender") + head("NetRender", refresh = True) output("<h2>Jobs</h2>") Modified: trunk/blender/release/scripts/io/netrender/repath.py =================================================================== --- trunk/blender/release/scripts/io/netrender/repath.py 2010-07-17 18:08:14 UTC (rev 30446) +++ trunk/blender/release/scripts/io/netrender/repath.py 2010-07-17 18:40:00 UTC (rev 30447) @@ -83,14 +83,17 @@ 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) + new_path = path_map.get(os.path.split(file_path)[1], None) if new_path: lib.filepath = new_path @@ -100,7 +103,7 @@ 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) + new_path = path_map.get(os.path.split(file_path)[1], None) if new_path: image.filepath = new_path Modified: trunk/blender/release/scripts/io/netrender/slave.py =================================================================== --- trunk/blender/release/scripts/io/netrender/slave.py 2010-07-17 18:08:14 UTC (rev 30446) +++ trunk/blender/release/scripts/io/netrender/slave.py 2010-07-17 18:40:00 UTC (rev 30447) @@ -79,6 +79,8 @@ job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path, force = True) if not found: + # Force prefix path if not found + job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path, force = True) temp_path = JOB_PREFIX + "slave.temp" conn.request("GET", fileURL(job_id, rfile.index), headers={"slave-id":slave_id}) response = conn.getresponse() Modified: trunk/blender/release/scripts/io/netrender/utils.py =================================================================== --- trunk/blender/release/scripts/io/netrender/utils.py 2010-07-17 18:08:14 UTC (rev 30446) +++ trunk/blender/release/scripts/io/netrender/utils.py 2010-07-17 18:40:00 UTC (rev 30447) @@ -171,7 +171,7 @@ # if an absolute path, make sure path exists, if it doesn't, use relative local path full_path = file_path if force or not os.path.exists(full_path): - p, n = os.path.split(full_path) + p, n = os.path.split(os.path.normpath(full_path)) if prefix_path and p.startswith(prefix_path): if len(prefix_path) < len(p): _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs