26
$\begingroup$

I am trying to add cubes to my scene. I'm sure there are lots of ways to get a cube into the scene (but for the purposes of this question, I have no idea what they are) - Are there any ways to add a cube that are easier than using the python console and manually adding them by using this command?

bpy.ops.mesh.primitive_cube_add()
$\endgroup$

13 Answers 13

37
+200
$\begingroup$
import bpy
from random import randint
bpy.ops.mesh.primitive_cube_add()

#how many cubes you want to add
count = 10

for c in range(0,count):
    x = randint(-10,10)
    y = randint(-10,10)
    z = randint(-10,10)
    bpy.ops.mesh.primitive_cube_add(location=(x,y,z))

Run this script in the Text Editor with the Run Script button.
The var count controls how many cubs will be added.
The three vars x, y, and z are random numbers for the placement of the cubes. Change the sets of numbers, to change the range where the cubes can be added on each axes.

$\endgroup$
13
$\begingroup$

If you need a more specific shape for you distributed cubes, you can use a particle system.

  1. Make a cage that will contain all the cubes.
  2. Add a particle system set it to Hair then set to Advanced, and set the Emit From to Volume.
  3. Set the Dupli Object under the Render section to the cube that you want to distribute.

particle system settings

$\endgroup$
11
$\begingroup$

My personal favorite is the array modifier. Simply add the modifier to any cube and set the amount you want and BAM!

enter image description here

Multiple arrays in union can be used to quickly create thousands of cubes.

enter image description here

$\endgroup$
1
  • $\begingroup$ Loved that way. $\endgroup$
    – m3nda
    Commented Sep 7, 2016 at 0:49
10
$\begingroup$

Another option would be to duplicate the cubes by a particle system, you didn't mention how the cubes should be arranged.

Cubes on cubes:

enter image description here

Or some other shape:

enter image description here

$\endgroup$
1
  • $\begingroup$ That's quite interesting. U can convert cubes to externally solid cube but with internal plastic volume splitted in cubes. So you create something like a 3d grid inside with is a cube with half a plastic ( and hours of work ) for an 3d printer. Im rlly new to Blender but that did came to my mind today. Thank you so much. $\endgroup$
    – m3nda
    Commented Sep 7, 2016 at 0:42
8
$\begingroup$

you can also get more cubes in your scene by selecting the default cube (if you already edited and/or deleted the default cube then you must add another cube), and pressing Shift D to duplicate it. Or you can select Alt D to make another instance of the default cube that will remain editable.

All of the default objects can be found here, In nice color and with good lighting. All of which is packed into a nice scene with GLSL shading.

enter image description here

enter image description here

$\endgroup$
7
$\begingroup$

You can use Shift-A>mesh>cube. enter image description here

$\endgroup$
7
$\begingroup$

You can also do this by saving a scene with the default objects such as this one.

click File>Append>

enter image description here

select the file that has the cube you need.

enter image description here

select the folder for objects

enter image description here

select the cube you want to copy. in this case it is called "cube"

enter image description here

this will add append the cube form your other file.

$\endgroup$
6
$\begingroup$

You can use the add menu at the bottom right coner of the 3d view:

enter image description here

$\endgroup$
6
$\begingroup$

You can use the create tab in the tools panel:

enter image description here

$\endgroup$
6
$\begingroup$

There is a fast, easy ten key combination shortcut for this.

Space+ADD+Space+CUBE+Enter

This method may seem a bit tiring if you only want to add one cube, but the next cube can be added much easier. Also, if you can type Really fast it might be faster than some of the other solutions to this question.

enter image description here

If you are really lazy, or simply want to keep a few keys working on your keyboard, you can skip typing the BE at the end because add cube will be the only one left in the search menu.

For the next cube you add, you will only need to press Space+Enter (assuming that you have not typed anything else in the search menu)

Technically this method places less wear on your keyboard, because Space+Enter requires fewer key presses than Shift+A M C

$\endgroup$
1
  • $\begingroup$ I think space + "cub" is enough - 4 key presses! $\endgroup$ Commented Feb 8, 2018 at 22:23
6
$\begingroup$

You can also model a cube by adding a plane Add Plane

Then select the plane and press Tab to enter edit mode.

enter image description here

then press E 2 to extrude 2 units. If you are using default units, this will make a default sized cube.

enter image description here

To place the origin in the center, exit edit mode by pressing Tab again. then press Shift + Ctrl + Alt + C and select Origin to Center of Mass this will place the origin in the center of the cube.

enter image description here

Now all you need to do is add your favorite color to it, and you will have a perfect cube.

enter image description here

$\endgroup$
1
1
$\begingroup$

Add a plane to your default cube (yes, keep it!)

Add geometry nodes modifier to plane.

Use this node setup:

enter image description here

and you get:

enter image description here

$\endgroup$
0
$\begingroup$

Press F3 key, then type add cube into the search box and choose first item: enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .