diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-12-04 04:28:00 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-12-04 04:28:00 +0300 |
commit | d3d11ede4453fbcce0f010b6418c1faeb6ec05e1 (patch) | |
tree | 2910c0684f1152958afb63bff03c97e1e9a0bc34 /release | |
parent | 77aacc6ce437dbe526fe08e12a6f68a16d7e2c30 (diff) |
Fix for cache path.
Operator for background baking (no support in netrender itself yet).
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/io/netrender/client.py | 2 | ||||
-rw-r--r-- | release/scripts/io/netrender/operators.py | 49 |
2 files changed, 50 insertions, 1 deletions
diff --git a/release/scripts/io/netrender/client.py b/release/scripts/io/netrender/client.py index 8fdedde3f52..f39beadfe57 100644 --- a/release/scripts/io/netrender/client.py +++ b/release/scripts/io/netrender/client.py @@ -127,7 +127,7 @@ def clientSendJob(conn, scene, anim = False): # FLUID + POINT CACHE ########################### root, ext = os.path.splitext(name) - default_path = path + "blendcache_" + root + os.sep # need an API call for that + default_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that for object in bpy.data.objects: for modifier in object.modifiers: diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py index b5b16b1fb9c..84a00970018 100644 --- a/release/scripts/io/netrender/operators.py +++ b/release/scripts/io/netrender/operators.py @@ -27,6 +27,55 @@ import netrender.client as client import netrender.model @rnaOperator +class RENDER_OT_netslave_bake(bpy.types.Operator): + '''NEED DESCRIPTION''' + bl_idname = "render.netslavebake" + bl_label = "Bake all in file" + + def poll(self, context): + return True + + def execute(self, context): + scene = context.scene + netsettings = scene.network_render + + filename = bpy.data.filename + path, name = os.path.split(filename) + root, ext = os.path.splitext(name) + default_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that + + # Force all point cache next to the blend file + for object in bpy.data.objects: + for modifier in object.modifiers: + if modifier.type == 'FLUID_SIMULATION' and modifier.settings.type == "DOMAIN": + modifier.settings.path = default_path + bpy.ops.fluid.bake({"active_object": object, "scene": scene}) + elif modifier.type == "CLOTH": + modifier.point_cache.disk_cache = True + modifier.point_cache.external = False + elif modifier.type == "SOFT_BODY": + modifier.point_cache.disk_cache = True + modifier.point_cache.external = False + elif modifier.type == "SMOKE" and modifier.smoke_type == "TYPE_DOMAIN": + modifier.domain_settings.point_cache_low.disk_cache = True + modifier.domain_settings.point_cache_low.external = False + modifier.domain_settings.point_cache_high.disk_cache = True + modifier.domain_settings.point_cache_high.external = False + + # particles modifier are stupid and don't contain data + # we have to go through the object property + for psys in object.particle_systems: + psys.point_cache.disk_cache = True + psys.point_cache.external = False + + bpy.ops.ptcache.bake_all() + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +@rnaOperator class RENDER_OT_netclientanim(bpy.types.Operator): '''Start rendering an animation on network''' bl_idname = "render.netclientanim" |