How to turn any mesh into its bounding box

How to turn any mesh into its bounding box



I have a scene and I want to turn it into a blockout scene for presentational purposes. I want to turn every mesh into a box or a block model. Is there any way to achieve this? Scripts are also welcome




2 Answers
2



Bmesh script



Quick, n dirty little bmesh script to do this. For all mesh objects in the screen replace the mesh with the box created from the eight corners of the bounding box.



script


import bpy
import bmesh
context = bpy.context
scene = context.scene
bm = bmesh.new()
mesh_obs = [o for o in scene.objects if o.type == 'MESH']
for ob in mesh_obs:
me = ob.data
#me = ob.data.copy() # create a copy

verts = [bm.verts.new(b) for b in ob.bound_box]
bmesh.ops.convex_hull(bm, input=verts)
bm.to_mesh(me)
ob.data = me # needed if copy
bm.clear()
bm.free()





I'll change it to keep the original mesh! But thank you for your time!
– Reuben X
Aug 24 at 8:40




You can select Bounding box in Viewport Shading setting:



enter image description here



This option displays all objects as it's Bounding boxes





No. I don't want it to be for the viewport only. I want to actually deform the mesh into it's bounding box
– Reuben X
Aug 24 at 8:34





Do you want to render it? Do you know, that you can render OpenGL of current viewport?
– Crantisz
Aug 24 at 8:38






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)