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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-01-27 13:22:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-27 13:22:59 +0300
commit784cf2c9bbc221f6cf1d973cc0b6376c3dc1ab3e (patch)
treecfd3898e7a43afeaba1f11c083d33119dce9f136 /blenderkit
parentebe8b034c825cbdf7116806ff82e4c267ded94e1 (diff)
parent896eaa753e82c4bf217ed7cc5f044bec71b306fc (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'blenderkit')
-rw-r--r--blenderkit/ui.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index 60ffa812..8d39b56f 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -907,7 +907,6 @@ def mouse_raycast(context, mx, my):
r = context.region
rv3d = context.region_data
coord = mx, my
- print(dir(rv3d))
# get the ray from the viewport and mouse
view_vector = view3d_utils.region_2d_to_vector_3d(r, rv3d, coord)
if rv3d.view_perspective == 'CAMERA' and rv3d.is_perspective == False:
@@ -919,12 +918,14 @@ def mouse_raycast(context, mx, my):
ray_target = ray_origin + (view_vector * 1000000000)
- print(view_vector, ray_origin)
vec = ray_target - ray_origin
has_hit, snapped_location, snapped_normal, face_index, object, matrix = deep_ray_cast(
bpy.context.view_layer.depsgraph, ray_origin, vec)
- print(has_hit)
+
+ #backface snapping inversion
+ if view_vector.angle(snapped_normal)<math.pi/2:
+ snapped_normal = -snapped_normal
# print(has_hit, snapped_location, snapped_normal, face_index, object, matrix)
# rote = mathutils.Euler((0, 0, math.pi))
randoffset = math.pi