diff options
author | Eugenio Pignataro <info@oscurart.com.ar> | 2018-03-22 00:55:17 +0300 |
---|---|---|
committer | Eugenio Pignataro <info@oscurart.com.ar> | 2018-03-22 00:55:17 +0300 |
commit | eaacbf59e13a2519f924d47579289bc7a7422a82 (patch) | |
tree | 14698394d7d67f702dbaddd7e2dae8b5dbddb3bf /oscurart_tools | |
parent | 0f1b2e7ea7a5b957f39fd5e41ae96ae288323b25 (diff) |
Render Tools new feature: TOKENS for render filepath
Diffstat (limited to 'oscurart_tools')
-rw-r--r-- | oscurart_tools/oscurart_render.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/oscurart_tools/oscurart_render.py b/oscurart_tools/oscurart_render.py index e65b06bf..4e36338e 100644 --- a/oscurart_tools/oscurart_render.py +++ b/oscurart_tools/oscurart_render.py @@ -70,12 +70,20 @@ def defRenderAll(frametype, scenes): for i in scene.render.layers: i.use = False layer.use = 1 + print("SCENE: %s" % scene.name) print("LAYER: %s" % layer.name) print("OVERRIDE: %s" % str(proptolist)) - scene.render.filepath = os.path.join( - os.path.dirname(renpath), filename, scene.name, layer.name, "%s_%s_%s" % - (filename, scene.name, layer.name)) + #scene.render.filepath = os.path.join( + # os.path.dirname(renpath), filename, scene.name, layer.name, "%s_%s_%s" % + # (filename, scene.name, layer.name)) + tokens = { + "$Scene":bpy.context.scene.name, + "$File":bpy.path.display_name(bpy.data.filepath), + "$Layer":layer.name} + + scene.render.filepath = renpath.replace("$Scene",tokens["$Scene"]).replace("$File",tokens["$File"]).replace("$Layer",tokens["$Layer"]) + bpy.context.window.screen.scene = scene bpy.ops.render.render( animation=True, |