Fix Cycles to mostly work with render layer / depsgraph changes.
[blender.git] / intern / cycles / blender / addon / engine.py
index cbc21b79da84bc137b7f63be5590520cfba142d7..8a13b67f91de573fa53aad8d3a3a230144b27eee 100644 (file)
@@ -123,13 +123,12 @@ def exit():
     _cycles.exit()
 
 
-def create(engine, data, depsgraph, scene, region=None, v3d=None, rv3d=None, preview_osl=False):
+def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False):
     import bpy
     import _cycles
 
     data = data.as_pointer()
     userpref = bpy.context.user_preferences.as_pointer()
-    depsgraph = depsgraph.as_pointer()
     scene = scene.as_pointer()
     if region:
         region = region.as_pointer()
@@ -144,7 +143,7 @@ def create(engine, data, depsgraph, scene, region=None, v3d=None, rv3d=None, pre
         _cycles.debug_flags_reset()
 
     engine.session = _cycles.create(
-            engine.as_pointer(), userpref, data, depsgraph, scene, region, v3d, rv3d, preview_osl)
+            engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl)
 
 
 def free(engine):
@@ -158,14 +157,14 @@ def free(engine):
 def render(engine, depsgraph):
     import _cycles
     if hasattr(engine, "session"):
-        _cycles.render(engine.session)
+        _cycles.render(engine.session, depsgraph.as_pointer())
 
 
-def bake(engine, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
+def bake(engine, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
     import _cycles
     session = getattr(engine, "session", None)
     if session is not None:
-        _cycles.bake(engine.session, obj.as_pointer(), pass_type, pass_filter, object_id, pixel_array.as_pointer(), num_pixels, depth, result.as_pointer())
+        _cycles.bake(engine.session, depsgraph.as_pointer(), obj.as_pointer(), pass_type, pass_filter, object_id, pixel_array.as_pointer(), num_pixels, depth, result.as_pointer())
 
 
 def reset(engine, data, scene):
@@ -175,9 +174,9 @@ def reset(engine, data, scene):
     _cycles.reset(engine.session, data, scene)
 
 
-def update(engine, data, scene):
+def update(engine, depsgraph, data, scene):
     import _cycles
-    _cycles.sync(engine.session)
+    _cycles.sync(engine.session, depsgraph.as_pointer())
 
 
 def draw(engine, depsgraph, region, v3d, rv3d):