6
$\begingroup$

I have a shipping container made up of around 30 different meshes. I want 3200 containers stacked together, each with a single random colour of a selected gradient (red container, blue container, green container, etc).

Another post on the site suggests to "Separate as loose parts" after applying the array, but this assigns a random color to each SINGLE mesh component (observable in the monkey's eyes).

  1. Is there a way to merge all objects into a single one, joining all intersecting external faces automagically? (Boolean modifier doesn't appear to be designed or smart enough to handle several complicated meshes)

  2. Is there another way to apply random colors to array items without separating into loose parts?

Thank you!

$\endgroup$
1

2 Answers 2

9
$\begingroup$

Use duplifaces

Parent your object to an object made up of faces (you can create it using a single plane and an -- applied -- array modifier, or you can just build it creatively):

enter image description here

Orange: your "single object" (to be duplicated). Yellow: your "duplicator". It works better if their origins are in the same location, and the origin of the "single object" corresponds to its floor.

Select them both (first the "single object", then Shift+Select the duplicator) and parent them (CtrlP).

On the duplicator object enable DupliFaces:

enter image description here

(the menu is called "Instancing", not "Duplication", in Blender 2.80+)

On the single object, add a material that uses the Random Object Info: for instance

enter image description here

The result:

enter image description here

Duplifaces are pretty easy to use! Just move the individual faces around in Edit mode. For example: need more space between the containers? Scale up!

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ This is a new concept for me, but I like it! Will be diving into this more tomorrow, and if I and up trying this out, I'll let you know how it goes! Thanks! $\endgroup$ Commented Nov 27, 2018 at 16:42
9
$\begingroup$

I think that you shouldn't use an array.

Use a particle system instead. Create a mesh were the containers would be: enter image description here

Then add a particle system, star on 1 and end on 1, choose volume as emit form and grid. enter image description here

Now you will have this: enter image description here

If your containers aren't square (probably) change the scale in object mode of the emmiter to be similar to the container ratio.

Change the physics to "No", render to "Object" choose the object (with the material of the link that you already visited) and change the size as you need:

enter image description here

Any other question, just ask.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks, it looks like I'll be learning more about the particle system then! I appreciate your care with this answer, and I'll be sure to ask if I have more questions. Thanks! $\endgroup$ Commented Nov 27, 2018 at 16:40

You must log in to answer this question.

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