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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-05-23 13:13:21 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-23 14:21:02 +0300
commitb20449cc08f33fc6b55fc6c326f5ab1b5f240fb9 (patch)
treeac49c0554144d98392ff68de34d037cf7be391e6 /intern/cycles/blender/addon/__init__.py
parentd59b74adb38f3ac6b85107aa506e471efbd2a20c (diff)
Cycles/Render API: changes for better copy-on-write support.
Mainly just passing the depsgraph and evaluated scene and camera, instead of the original one. Patch by Sergey, further modifications by Brecht.
Diffstat (limited to 'intern/cycles/blender/addon/__init__.py')
-rw-r--r--intern/cycles/blender/addon/__init__.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py
index 9bf9a3839d2..353f2a1ad5b 100644
--- a/intern/cycles/blender/addon/__init__.py
+++ b/intern/cycles/blender/addon/__init__.py
@@ -66,31 +66,32 @@ class CyclesRender(bpy.types.RenderEngine):
engine.free(self)
# final render
- def update(self, data, scene):
+ def update(self, data, depsgraph):
if not self.session:
if self.is_preview:
cscene = bpy.context.scene.cycles
use_osl = cscene.shading_system and cscene.device == 'CPU'
- engine.create(self, data, scene,
- None, None, None, use_osl)
+ engine.create(self, data, preview_osl=use_osl)
else:
- engine.create(self, data, scene)
- else:
- engine.reset(self, data, scene)
+ engine.create(self, data)
+
+ engine.reset(self, data, depsgraph)
def render_to_image(self, depsgraph):
engine.render(self, depsgraph)
- def bake(self, depsgraph, scene, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
+ def bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
engine.bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result)
# viewport render
def view_update(self, context):
if not self.session:
- engine.create(self, context.blend_data, context.scene,
+ engine.create(self, context.blend_data,
context.region, context.space_data, context.region_data)
- engine.update(self, context.depsgraph, context.blend_data, context.scene)
+
+ engine.reset(self, context.blend_data, context.depsgraph)
+ engine.sync(self, context.depsgraph, context.blend_data)
def render_to_view(self, context):
engine.draw(self, context.depsgraph, context.region, context.space_data, context.region_data)