[Bf-extensions-cvs] [82ed41ec] master: Update calls to `Scene.ray_cast()` to pass depsgraph instead of view layer

Sybren A. Stüvel noreply at git.blender.org
Wed Aug 5 18:16:16 CEST 2020


Commit: 82ed41ec632483fa9260d90dae7afdf3192c509b
Author: Sybren A. Stüvel
Date:   Wed Aug 5 18:16:08 2020 +0200
Branches: master
https://developer.blender.org/rBA82ed41ec632483fa9260d90dae7afdf3192c509b

Update calls to `Scene.ray_cast()` to pass depsgraph instead of view layer

This is in light of the change in Blender rBe03d53874dac5f.

===================================================================

M	archipack/archipack_object.py
M	archipack/archipack_wall2.py
M	blenderkit/ui.py

===================================================================

diff --git a/archipack/archipack_object.py b/archipack/archipack_object.py
index 8c908214..f513b506 100644
--- a/archipack/archipack_object.py
+++ b/archipack/archipack_object.py
@@ -259,7 +259,7 @@ class ArchipackDrawTool(ArchipackCollectionManager):
         view_vector_mouse = region_2d_to_vector_3d(region, rv3d, co2d)
         ray_origin_mouse = region_2d_to_origin_3d(region, rv3d, co2d)
         res, pos, normal, face_index, object, matrix_world = context.scene.ray_cast(
-            view_layer=context.view_layer,
+            depsgraph=context.view_layer.depsgraph,
             origin=ray_origin_mouse,
             direction=view_vector_mouse)
         return res, pos, normal, face_index, object, matrix_world
diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py
index d9a486eb..53375992 100644
--- a/archipack/archipack_wall2.py
+++ b/archipack/archipack_wall2.py
@@ -1639,7 +1639,7 @@ class archipack_wall2(ArchipackObject, Manipulable, PropertyGroup):
             # prevent self intersect
             o.hide_viewport = True
             res, pos, normal, face_index, r, matrix_world = context.scene.ray_cast(
-                view_layer=context.view_layer,
+                depsgraph=context.view_layer.depsgraph,
                 origin=p,
                 direction=up)
 
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index 5333b65e..47bf1a51 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -927,7 +927,7 @@ def mouse_raycast(context, mx, my):
     vec = ray_target - ray_origin
 
     has_hit, snapped_location, snapped_normal, face_index, object, matrix = bpy.context.scene.ray_cast(
-        bpy.context.view_layer, ray_origin, vec)
+        bpy.context.view_layer.depsgraph, ray_origin, vec)
 
     # rote = mathutils.Euler((0, 0, math.pi))
     randoffset = math.pi



More information about the Bf-extensions-cvs mailing list