How to turn any mesh into its bounding box

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash 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







share|improve this question




























    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







    share|improve this question
























      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







      share|improve this question














      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









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 24 at 14:13









      Community♦

      1




      1










      asked Aug 24 at 7:45









      Reuben X

      1309




      1309




















          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()





          share|improve this answer




















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


















          up vote
          0
          down vote













          You can select Bounding box in Viewport Shading setting:



          enter image description here



          This option displays all objects as it's Bounding boxes






          share|improve this answer
















          • 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










          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "502"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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()





          share|improve this answer




















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















          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()





          share|improve this answer




















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













          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()





          share|improve this answer












          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()






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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













          up vote
          0
          down vote













          You can select Bounding box in Viewport Shading setting:



          enter image description here



          This option displays all objects as it's Bounding boxes






          share|improve this answer
















          • 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














          up vote
          0
          down vote













          You can select Bounding box in Viewport Shading setting:



          enter image description here



          This option displays all objects as it's Bounding boxes






          share|improve this answer
















          • 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












          up vote
          0
          down vote










          up vote
          0
          down vote









          You can select Bounding box in Viewport Shading setting:



          enter image description here



          This option displays all objects as it's Bounding boxes






          share|improve this answer












          You can select Bounding box in Viewport Shading setting:



          enter image description here



          This option displays all objects as it's Bounding boxes







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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












          • 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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          ip6kfO e2,LGVq5xI 6eApT5SZy,dUaA6pC,ubCggXRx90C wnoB 46cb
          wc U9,CkeAF68iYDg4CFd,x2cGNOgXiQ2z 2,IVyptW vqf

          這個網誌中的熱門文章

          How to combine Bézier curves to a surface?

          Propositional logic and tautologies

          Distribution of Stopped Wiener Process with Stochastic Volatility