Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2011-12-26 22:44:56 +0400
committerMartin Poirier <theeth@yahoo.com>2011-12-26 22:44:56 +0400
commita73e700330449274aad7b602ae8c82f94b8a8277 (patch)
tree43246624bcd106f749fd84d452830d4ca934be2b /netrender/repath.py
parent910a5a70960aabded7145bff67b276a8b8ae9b27 (diff)
netrender
- Support for dynamic painting point cache (patch by Philippe Van Hecke) - Fix job log name generation to not exceed filename limits when using large chunks - Cleaning up duplicated code for point caches, fluid and multires between client and repath module
Diffstat (limited to 'netrender/repath.py')
-rw-r--r--netrender/repath.py59
1 files changed, 22 insertions, 37 deletions
diff --git a/netrender/repath.py b/netrender/repath.py
index bae90210..6b2a46ed 100644
--- a/netrender/repath.py
+++ b/netrender/repath.py
@@ -64,22 +64,6 @@ def update(job):
os.renames(new_path, job_full_path)
def process(paths):
- def processPointCache(ob, point_cache):
- if not point_cache.use_disk_cache:
- return
-
- cache_name = cacheName(ob, point_cache)
- new_path = path_map.get(cache_name, None)
- if new_path:
- point_cache.use_external = True
- point_cache.filepath = new_path
- point_cache.name = cache_name
-
- def processFluid(fluid):
- new_path = path_map.get(fluid.filepath, None)
- if new_path:
- fluid.path = new_path
-
path_map = {}
for i in range(0, len(paths), 2):
# special case for point cache
@@ -119,28 +103,29 @@ def process(paths):
###########################
# FLUID + POINT CACHE
###########################
- for object in bpy.data.objects:
- for modifier in object.modifiers:
- if modifier.type == 'FLUID_SIMULATION' and modifier.settings.type == "DOMAIN":
- processFluid(object, modifier.settings)
- elif modifier.type == "CLOTH":
- processPointCache(object, modifier.point_cache)
- elif modifier.type == "SOFT_BODY":
- processPointCache(object, modifier.point_cache)
- elif modifier.type == "SMOKE" and modifier.smoke_type == "DOMAIN":
- processPointCache(modifier.domain_settings.point_cache_low)
- if modifier.domain_settings.use_high_resolution:
- processPointCache(modifier.domain_settings.point_cache_high)
- 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
+ def pointCacheFunc(object, point_cache):
+ if not point_cache.use_disk_cache:
+ return
- # particles modifier are stupid and don't contain data
- # we have to go through the object property
- for psys in object.particle_systems:
- processPointCache(psys.point_cache)
+ cache_name = cacheName(object, point_cache)
+ new_path = path_map.get(cache_name, None)
+ if new_path:
+ point_cache.use_external = True
+ point_cache.filepath = new_path
+ point_cache.name = cache_name
+
+ def fluidFunc(object, modifier, cache_path):
+ fluid = modifier.settings
+ new_path = path_map.get(cache_path, None)
+ if new_path:
+ fluid.path = new_path
+
+ def multiresFunc(object, modifier, cache_path):
+ new_path = path_map.get(cache_path, None)
+ if new_path:
+ modifier.filepath = new_path
+
+ processObjectDependencies(pointCacheFunc, fluidFunc, multiresFunc)
if __name__ == "__main__":