- November 23, 2019 at 4:23 pm
Maybe you can help me with the following:
I have a MainComp that contains another comp that contains a text layer (and other stuff) lets call this child comp “IDs”. The text layer inside IDs should be a random number. That’s no problem… but now I want to duplicate the IDs inside the MainComp n times and with every duplicate it should change the random number of my text layer.
My idea was to use the index that IDs has in the MainComp (parent) as a multiplicator. But I don’t know how to fetch the index number that this comp has as child of another comp?
Does this makes sense?
I thought it should be somethin like this:
posterizeTime(0); // x should be kept over the whole time
var y = // how do I get the index of this comp thats a child of another?
var x = Math.round(random(99999))*y;
- November 23, 2019 at 6:34 pm
Are you talking about duplicating the IDs layer inside the main comp? If so, you only end up with one instance of the IDs comp in the project panel, so there’s no way to have each layer copy render differently.
You’d have to duplicate the comp in the project panel. Then each copy of the comp should get its own random number with:
- November 23, 2019 at 7:11 pm
Thanks for your reply. No I want to duplicate the comp that contains the text layer, but this text layer should receive a random number nevertheless. That’s why I wanted to link the random to the index one level above. Do you have an idea how to get this done?
- November 23, 2019 at 7:19 pm
To be clear, when you say “duplicate the comp”, you’re talking about duplicating the comp in the project panel, not duplicating the comp layer in your master comp timeline, is that correct? If so, each duplicate comp should get automatically its own random number seed.
If you’re talking about duplicating the comp layer in the master comp’s timeline, then each of the “duplicates” actually has the same comp as it source, so you won’t be able to have a different random number for each.
- November 23, 2019 at 9:12 pm
Sorry, I think I didn’t explained it correctly.
Within the Main Comp I want to duplicate the IDs composition, not in the projects panel.
And the text layer inside the IDs composition should get a new random value with each duplicate inside the Main Comp.
|_ _ IDs Comp
| |_ Text Layer
|__ IDs Comp (duplicate)
| |_Text Layer
That’s why I wanted to know how to refer one level above and figure out how‘s the index for each duplicate
- November 23, 2019 at 9:19 pm
Sorry, doing it that way won’t work. Duplicating in the time line doesn’t create multiple versions of the comp. There may be multiple layers, but they all reference the same comp, and therefore there is only one text layer. Any change you make to that text layer will show up in all the “duplicates”.
- November 23, 2019 at 9:27 pm
I know. That’s why I want to multiply the random number with the index the comp receives when I duplicate it. But not the index of the texlayer inside the IDs comp but the index of the duplicate. That’s why I want to read out the index of the duplicate inside the duplicate.
Does this make sense?
- November 23, 2019 at 9:41 pm
>with the index the comp receives when I duplicate it
The problem is that you’re not duplicating a comp. You’re duplicating a layer.
There is a way you can fake it. If you replace the expression on the text layer with this:
so that it generates a new random number on each frame, and then turn on time remapping for the comp layer in your main comp, and add this time remapping expression:
Then when you duplicate the comp layer, each duplicate will display a different random number. Of course that won’t work if you have other stuff going on in the comp.
- November 24, 2019 at 8:25 am
You guessed it, theres more going on in this comp- But your workaround yet helps me in case I need static comps.
Log in to reply.