Joining objects with material using Colorramp

I was working on a tutorial… in the tutorial, we take a Leaf on a plane image, add several new nodes and add a colorramp and an Object Info node and connect the Object Info node to the colorramp with “Random” When the object is duplicated, it changes it’s color each time… this all worked fine… But in the tutorial, all the leaves created are joined together… (and he did say Ctrl+J) once they are joined,
all the leaves have the same color… is there a way to join these together so the leaves don’t change all to the same color… these trees are going to be as an object in a particles system, to line a road with the trees…
thanks

Since this was posted, I have learned that they will all have the same color after they are joined…
I found myself a work around so the leaves maintain their individual colors when all are joined… Few more steps to do but it works…

thanks

This is normal, the object info node will give a random value per object. As you have joined all your leaf objects into one they have the same value.

When making trees with leaves the usual thing to do is to set the tree as the emmiter and use the leaf as the particle (in the particle settings of the tree choose render - “render as object” and object - instance object – “your leaf”)

Then all the particle instances of the leaf object will be considered different objects (even if you only have one leaf) and the object info node will output different values for them. You can tell the particles to have different sizes and rotation in the particle system settings.

If you have different shapes of leaves you can put them into a collection (as separate objects) and choose “render as collection” in the particle system settings (with the pick random option). That way each instance will randomly pick one of the leaf shape objects.

thank you …

If you want to join all to one object and still have different colors, instead of the object info node use the geometry node. The geometry node has a “Random per Island” output which does what you want.

It only works in Cycles, though, so if you want to use EEVEE then

thanks…I will try that and will let someone else know… I was asking for someone who asked me the question and trying to help him…
have good evening