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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-08-12 08:01:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-12 08:22:58 +0300
commit4b6fa4d897a0bb3252b16383492b526d2cef3920 (patch)
tree2793afc516c9a97e0d23d33a62028a6a9d87e8e2 /release/scripts/modules
parent444a0202d40705b6a6f21e59e883518be577cf4e (diff)
PyAPI: update scripts for matrix multiply operator
Operators: - add torus - align objects - bake physics - make dupli faces - smart project Templates: - 3D view ray cast Other: - Methods for bones/edit-bones
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py2
-rw-r--r--release/scripts/modules/bpy_extras/view3d_utils.py4
-rw-r--r--release/scripts/modules/bpy_types.py14
3 files changed, 10 insertions, 10 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index fff73a4285a..c9ea684862d 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -100,7 +100,7 @@ def add_object_align_init(context, operator):
if operator:
properties.rotation = rotation.to_euler()
- return location * rotation
+ return location @ rotation
def object_data_add(context, obdata, operator=None, name=None):
diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py
index a4834a4531c..a2e394b270f 100644
--- a/release/scripts/modules/bpy_extras/view3d_utils.py
+++ b/release/scripts/modules/bpy_extras/view3d_utils.py
@@ -54,7 +54,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
w = out.dot(persinv[3].xyz) + persinv[3][3]
- view_vector = ((persinv * out) / w) - viewinv.translation
+ view_vector = ((persinv @ out) / w) - viewinv.translation
else:
view_vector = -viewinv.col[2].xyz
@@ -179,7 +179,7 @@ def location_3d_to_region_2d(region, rv3d, coord, default=None):
"""
from mathutils import Vector
- prj = rv3d.perspective_matrix * Vector((coord[0], coord[1], coord[2], 1.0))
+ prj = rv3d.perspective_matrix @ Vector((coord[0], coord[1], coord[2], 1.0))
if prj.w > 0.0:
width_half = region.width / 2.0
height_half = region.height / 2.0
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index d6d4ecd6fce..96193b047c6 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -205,21 +205,21 @@ class _GenericBone:
""" Vector pointing down the x-axis of the bone.
"""
from mathutils import Vector
- return self.matrix.to_3x3() * Vector((1.0, 0.0, 0.0))
+ return self.matrix.to_3x3() @ Vector((1.0, 0.0, 0.0))
@property
def y_axis(self):
""" Vector pointing down the y-axis of the bone.
"""
from mathutils import Vector
- return self.matrix.to_3x3() * Vector((0.0, 1.0, 0.0))
+ return self.matrix.to_3x3() @ Vector((0.0, 1.0, 0.0))
@property
def z_axis(self):
""" Vector pointing down the z-axis of the bone.
"""
from mathutils import Vector
- return self.matrix.to_3x3() * Vector((0.0, 0.0, 1.0))
+ return self.matrix.to_3x3() @ Vector((0.0, 0.0, 1.0))
@property
def basename(self):
@@ -378,9 +378,9 @@ class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup):
:type roll: bool
"""
from mathutils import Vector
- z_vec = self.matrix.to_3x3() * Vector((0.0, 0.0, 1.0))
- self.tail = matrix * self.tail
- self.head = matrix * self.head
+ z_vec = self.matrix.to_3x3() @ Vector((0.0, 0.0, 1.0))
+ self.tail = matrix @ self.tail
+ self.head = matrix @ self.head
if scale:
scalar = matrix.median_scale
@@ -388,7 +388,7 @@ class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup):
self.tail_radius *= scalar
if roll:
- self.align_roll(matrix * z_vec)
+ self.align_roll(matrix @ z_vec)
def ord_ind(i1, i2):