1
$\begingroup$

Very new Blender user here, and posting my first question on this forum :)

I'm trying to keep the color-ramp consistent on the instances of an object with an array modifier. Right now the texture seems to have some "global" settings that cause the objects to have each a different color-ramp. Thanks a lot for any guidance on this. Screenshot of object with color-ramp texture and array modifier applied

$\endgroup$
2
  • $\begingroup$ what do you mean by "consistant": do you want the color ramp to go over all of them or do you want each to be the same? $\endgroup$ Commented Jan 8 at 8:08
  • $\begingroup$ Thank you Lemon. You are right. I mean for each instance to have the same gradient. $\endgroup$ Commented Jan 8 at 14:30

2 Answers 2

2
$\begingroup$

It is not causing the "objects" to have global settings. Using an Array modifier created duplicates of the base object, but they all belong to the same object, i.e. the object is the union of all duplicates together. So they all have the same "global" settings because it is a single object.

The Generated coordinates are going from (0, 0, 0) at the front bottom left to (1, 1, 1) at the back top right of the object's bounding box. But note: as long as the Array modifier is still in use, only the base object's bounding box is taken into account for this. Those instances outside the original bounding box get negative values < 0 or values > 1 assigned (depending on the direction in which they are outisde the bounding box), but since the the Color Ramp input is clamped to the 0 to 1 range, lower values will be limited to 0 and values > 1 are limited to 1.

Here an example only regarding the Z values, the Generated coordinates have a range of 0 to 1 over the bounding box of the base object:

generated with modifier

But if you would apply the Array modifier, the duplicates are no longer procedural and become a real mesh, so that the bounding box now includes the complete geometry:

new object

A different result you will get when using Object coordinates. They are (assuming you have no unapplied transformations on the object) according to the global coordinates, here the base object has a height of 2 m centered on the world, so it spans from -1 m to 1 m and so are the Object coordinates. Applying the Array modifier will make no difference in this case, since the coordinates are not relative to the bounding box and so the gradient will always look like this:

object coordinates

If you now want the gradient to be the same on each instance of the base object - for example, similar to the Generated coordinates with respect to the bounding box of the base object - you can do something like this:

View the object from the side, go into Edit Mode and select all with A, then hit U and choose Project from View (Bounds):

project from view bounds

This way you basically recreate something like the Generated coordinates (but only in a 2-dimensional plane which is totally fine if you want a gradient in one direction) and the (Bounds) option ensures that the object exactly fits the UV map in width and height:

uv map

But the good thing here is, the coordinates do not rely on the actual geometry's bounding box but are "stored" in the UVs, which get duplicated together with the mesh. So each instance of the base object inherits the same UVs and therefore the same gradient. The only thing I have to change here is now using the Y output of the Separate XYZ node because UVs only have XY coordinates. They keep those UVs even after applying the modifier, so the result will be the same:

uv coordinates

$\endgroup$
2
  • 1
    $\begingroup$ Thanks so much for your help Gordon. $\endgroup$ Commented Jan 8 at 15:01
  • $\begingroup$ @CarlosSerrano No need to thank us. If our answers helped you, you might consider to accept one of them as solution? $\endgroup$ Commented Jan 9 at 12:54
0
$\begingroup$

If you use an Array modifier you won't be able to keep the same gradient on each of the copies, unless you use the UV output of the Texture Coordinate as pointed out by Gordon.

If for some reason you don't want use UV you either need to apply the modifier and separate each mesh as a separate object, or use another method. Among these other methods you have Instancing or Particles or Geonode, it all depends on your project.

Instancing: Let's say that you want to repeat the cube on each of this edge vertex, select the edge object, go into the Object panel > Instancing > click on Vertices. Now parent the cube to the edge object, it will create an instance of the cube per vertex:

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ You can keep the same gradient on each of the copies if you use UV mapping. Then each duplicate gets the same UVs and they will keep them no matter if the modifier is active or after you applied it. $\endgroup$ Commented Jan 8 at 14:26
  • $\begingroup$ Oh yes you're right $\endgroup$ Commented Jan 8 at 14:28
  • $\begingroup$ Thank you Moonbots!! $\endgroup$ Commented Jan 8 at 15:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.