PyTemplates operator_modal_view3d_raycast: update to blender2.8 (*/@)
authorPhilipp Oeser <info@graphics-engineer.com>
Fri, 16 Nov 2018 11:09:41 +0000 (12:09 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Fri, 16 Nov 2018 11:10:35 +0000 (12:10 +0100)
release/scripts/templates_py/operator_modal_view3d_raycast.py

index 103c13dc1c28743f9a38197e2fbdfde9d30d9ca0..4b9700dd3feb8e4848bff1425ad5df0177000aee 100644 (file)
@@ -37,8 +37,8 @@ def main(context, event):
 
         # get the ray relative to the object
         matrix_inv = matrix.inverted()
 
         # get the ray relative to the object
         matrix_inv = matrix.inverted()
-        ray_origin_obj = matrix_inv * ray_origin
-        ray_target_obj = matrix_inv * ray_target
+        ray_origin_obj = matrix_inv @ ray_origin
+        ray_target_obj = matrix_inv @ ray_target
         ray_direction_obj = ray_target_obj - ray_origin_obj
 
         # cast the ray
         ray_direction_obj = ray_target_obj - ray_origin_obj
 
         # cast the ray
@@ -57,7 +57,7 @@ def main(context, event):
         if obj.type == 'MESH':
             hit, normal, face_index = obj_ray_cast(obj, matrix)
             if hit is not None:
         if obj.type == 'MESH':
             hit, normal, face_index = obj_ray_cast(obj, matrix)
             if hit is not None:
-                hit_world = matrix * hit
+                hit_world = matrix @ hit
                 scene.cursor_location = hit_world
                 length_squared = (hit_world - ray_origin).length_squared
                 if best_obj is None or length_squared < best_length_squared:
                 scene.cursor_location = hit_world
                 length_squared = (hit_world - ray_origin).length_squared
                 if best_obj is None or length_squared < best_length_squared: