How to turn any mesh into its bounding box
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
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
mesh transforms
add a comment |Â
up vote
1
down vote
favorite
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
mesh transforms
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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
mesh transforms
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
mesh transforms
edited Aug 24 at 14:13
Communityâ¦
1
1
asked Aug 24 at 7:45
Reuben X
1309
1309
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
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.
- I've used the convex hull operator which produces a triangulated
mesh. - Current version replaces mesh with hull.
- As always save before, and / or test on a copy.
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
add a comment |Â
up vote
0
down vote
You can select Bounding box in Viewport Shading setting:
This option displays all objects as it's Bounding boxes
1
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
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
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.
- I've used the convex hull operator which produces a triangulated
mesh. - Current version replaces mesh with hull.
- As always save before, and / or test on a copy.
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
add a comment |Â
up vote
3
down vote
accepted
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.
- I've used the convex hull operator which produces a triangulated
mesh. - Current version replaces mesh with hull.
- As always save before, and / or test on a copy.
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
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
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.
- I've used the convex hull operator which produces a triangulated
mesh. - Current version replaces mesh with hull.
- As always save before, and / or test on a copy.
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()
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.
- I've used the convex hull operator which produces a triangulated
mesh. - Current version replaces mesh with hull.
- As always save before, and / or test on a copy.
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()
answered Aug 24 at 8:26
batFINGER
19.6k31959
19.6k31959
I'll change it to keep the original mesh! But thank you for your time!
â Reuben X
Aug 24 at 8:40
add a comment |Â
I'll change it to keep the original mesh! But thank you for your time!
â Reuben X
Aug 24 at 8:40
I'll change it to keep the original mesh! But thank you for your time!
â Reuben X
Aug 24 at 8:40
I'll change it to keep the original mesh! But thank you for your time!
â Reuben X
Aug 24 at 8:40
add a comment |Â
up vote
0
down vote
You can select Bounding box in Viewport Shading setting:
This option displays all objects as it's Bounding boxes
1
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
add a comment |Â
up vote
0
down vote
You can select Bounding box in Viewport Shading setting:
This option displays all objects as it's Bounding boxes
1
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
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can select Bounding box in Viewport Shading setting:
This option displays all objects as it's Bounding boxes
You can select Bounding box in Viewport Shading setting:
This option displays all objects as it's Bounding boxes
answered Aug 24 at 8:24
Crantisz
5,670728
5,670728
1
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
add a comment |Â
1
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
1
1
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
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
Do you want to render it? Do you know, that you can render OpenGL of current viewport?
â Crantisz
Aug 24 at 8:38
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f116772%2fhow-to-turn-any-mesh-into-its-bounding-box%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password