-
Reference value inside Shape Layer Group (independant of hirarchy)
So I have a Shape Layer with a “Group 1” that contains a path, a “Fill 1” and a “Stroke 1”.
I want to duplicate “Group1” a bunch of times and generate a random fill for every clone. the stroke should be white except when the fill is white, then the stroke would be randomly colored.the color value of “Fill 1” is randomly generated whenever I duplicate the Group. Like this
colors=
[[1,0.1,0.14,1],
//AND SOME MORE COLORS
];shapeIndex=thisProperty.propertyGroup(3).name.split(" ")[1];
seedRandom(shapeIndex, true);idx1 = Math.floor(random(colors.length));
colors[idx1]
this is referencing the property index so I can duplicate the group to generate a random color for each clone.
Now I want to reference the “Fill 1” inside of “Stroke 1”. This is how far I’ve gotten:
if(content(thisProperty.propertyGroup(2).name.split(" ")).content("Fill 1").color==[1,1,1,1])
{colors=
[[1,0.1,0.14,1],
//AND SOME MORE COLORS
];shapeIndex=thisProperty.propertyGroup(3).name.split(" ")[1];
seedRandom(shapeIndex, timeless = true);idx1 = Math.floor(random(colors.length));
content("Group 1").content("Stroke 1").color=colors[idx1]}
else
{[1,1,1,1]
};
The “if” condition gives me the problem here.
QUESTION
what’s the correct syntax here to reference the parent group’s fill color?Thank you so much for reading, let me know if anything isn’t perfectly understandable.
Paddy
Credits to stib from stackexchange, his post got me half the way to where I wanted to be:
https://video.stackexchange.com/questions/15237/vary-the-color-of-repeated-shape-in-after-effects