[Bf-blender-cvs] [d9ec25844b4] master: Fix T72636: Error with matrix multiplication in freestyle modifier

Robert Guetzkow noreply at git.blender.org
Tue Dec 24 03:40:42 CET 2019


Commit: d9ec25844b4ac3143775615469fe69b27105c108
Author: Robert Guetzkow
Date:   Mon Dec 23 23:38:24 2019 -0300
Branches: master
https://developer.blender.org/rBd9ec25844b4ac3143775615469fe69b27105c108

Fix T72636: Error with matrix multiplication in freestyle modifier

The //Distance from Object// and //Distance from Camera// modifiers still used the old 2.79 matrix multiplication syntax.

Differential Revision: https://developer.blender.org/D6468

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

M	release/scripts/startup/bl_operators/freestyle.py

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

diff --git a/release/scripts/startup/bl_operators/freestyle.py b/release/scripts/startup/bl_operators/freestyle.py
index baac3556fb2..393dd467e88 100644
--- a/release/scripts/startup/bl_operators/freestyle.py
+++ b/release/scripts/startup/bl_operators/freestyle.py
@@ -89,16 +89,16 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
             min_dist = sys.float_info.max
             max_dist = -min_dist
             if m.type == 'DISTANCE_FROM_CAMERA':
-                ob_to_cam = matrix_to_camera * ob.matrix_world
+                ob_to_cam = matrix_to_camera @ ob.matrix_world
                 for vert in selected_verts:
                     # dist in the camera space
-                    dist = (ob_to_cam * vert.co).length
+                    dist = (ob_to_cam @ vert.co).length
                     min_dist = min(dist, min_dist)
                     max_dist = max(dist, max_dist)
             elif m.type == 'DISTANCE_FROM_OBJECT':
                 for vert in selected_verts:
                     # dist in the world space
-                    dist = (ob.matrix_world * vert.co - target_location).length
+                    dist = (ob.matrix_world @ vert.co - target_location).length
                     min_dist = min(dist, min_dist)
                     max_dist = max(dist, max_dist)
             # Fill the Range Min/Max entries with the computed distances



More information about the Bf-blender-cvs mailing list