Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Object Bounding Box",
"author": "Patrick R. Moore",
"version": (0, 1),
"blender": (2, 7, 3),
"blender": (2, 8, 1),
"location": "View3D > Add > Mesh > New Object",
"description": "Adds new cube which is minumum bounding box!",
"warning": "",
Expand All @@ -23,9 +23,9 @@ def bbox_orient(bme_verts, mx):
takes a lsit of BMverts ora list of vectors
'''
if hasattr(bme_verts[0], 'co'):
verts = [mx * v.co for v in bme_verts]
verts = [mx @ v.co for v in bme_verts]
else:
verts = [mx * v for v in bme_verts]
verts = [mx @ v for v in bme_verts]

xs = [v[0] for v in verts]
ys = [v[1] for v in verts]
Expand Down Expand Up @@ -124,9 +124,9 @@ def main(context, rand_sample, spin_res, make_sphere):
box_verts = box_cords(min_box)
bpy.ops.mesh.primitive_cube_add()

fmx = tr_mx * r_mx * min_mx.inverted() * sc_mx
fmx = tr_mx @ r_mx @ min_mx.inverted() @ sc_mx
context.object.matrix_world = fmx
context.object.draw_type = 'BOUNDS'
context.object.display_type = 'BOUNDS'
for i, v in enumerate(box_verts):
context.object.data.vertices[i].co = v

Expand Down Expand Up @@ -253,7 +253,7 @@ def main_SVD(context, down_sample, method, spin_res, make_box):
bpy.ops.mesh.primitive_cube_add()

context.object.matrix_world =rmx.transposed().inverted() * world_mx
context.object.draw_type = 'BOUNDS'
context.object.display_type = 'BOUNDS'
for i, v in enumerate(box_verts):
context.object.data.vertices[i].co = v

Expand All @@ -265,10 +265,10 @@ def main_SVD(context, down_sample, method, spin_res, make_box):
box_verts = box_cords(min_box)
bpy.ops.mesh.primitive_cube_add()
#FinalMatrix = TranslationMatrix * RotationMatrix * ScaleMatrix
fmx = tr_mx * r_mx * min_mx.inverted() * sc_mx
fmx = tr_mx @ r_mx @ min_mx.inverted() @ sc_mx

context.object.matrix_world = fmx
context.object.draw_type = 'BOUNDS'
context.object.display_type = 'BOUNDS'
for i, v in enumerate(box_verts):
context.object.data.vertices[i].co = v

Expand Down