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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-01-21 14:17:50 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-01-21 14:18:02 +0300
commit73f88be5067be19aa2c1af75ee9566d41f69a5c0 (patch)
treee5093aea16e17e6e4cdb33de2a5804a756ae4139 /mesh_looptools.py
parent6522b4e0bf1dd49ce9b9f46f5ee8657ffe8e0351 (diff)
Bool Tools: Fix error accessing transform orientations
also fix matrix multiplication ('@') Fixes T60706
Diffstat (limited to 'mesh_looptools.py')
-rw-r--r--mesh_looptools.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/mesh_looptools.py b/mesh_looptools.py
index 17425de4..75a15b06 100644
--- a/mesh_looptools.py
+++ b/mesh_looptools.py
@@ -765,14 +765,14 @@ def initialise():
def move_verts(object, bm, mapping, move, lock, influence):
if lock:
lock_x, lock_y, lock_z = lock
- orientation = bpy.context.space_data.transform_orientation
- custom = bpy.context.space_data.current_orientation
+ orient_slot = bpy.context.scene.transform_orientation_slots[0]
+ custom = orient_slot.custom_orientation
if custom:
- mat = custom.matrix.to_4x4().inverted() * object.matrix_world.copy()
- elif orientation == 'LOCAL':
+ mat = custom.matrix.to_4x4().inverted() @ object.matrix_world.copy()
+ elif orient_slot.type == 'LOCAL':
mat = mathutils.Matrix.Identity(4)
- elif orientation == 'VIEW':
- mat = bpy.context.region_data.view_matrix.copy() * \
+ elif orient_slot.type == 'VIEW':
+ mat = bpy.context.region_data.view_matrix.copy() @ \
object.matrix_world.copy()
else: # orientation == 'GLOBAL'
mat = object.matrix_world.copy()
@@ -786,20 +786,20 @@ def move_verts(object, bm, mapping, move, lock, influence):
else:
index = mapping[index]
if lock:
- delta = (loc - bm.verts[index].co) * mat_inv
+ delta = (loc - bm.verts[index].co) @ mat_inv
if lock_x:
delta[0] = 0
if lock_y:
delta[1] = 0
if lock_z:
delta[2] = 0
- delta = delta * mat
+ delta = delta @ mat
loc = bm.verts[index].co + delta
if influence < 0:
new_loc = loc
else:
- new_loc = loc * (influence / 100) + \
- bm.verts[index].co * ((100 - influence) / 100)
+ new_loc = loc @ (influence / 100) + \
+ bm.verts[index].co @ ((100 - influence) / 100)
bm.verts[index].co = new_loc
bm.normal_update()
object.data.update()