Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to fill shapes with different images without creating hundreds of layers?

Explorer ,
Jul 10, 2024 Jul 10, 2024

I want lots of the same shape to appear but with a different country's flag in each one. Is there so expression magic that can randomize the flag image that fills each shape?

TOPICS
Expressions , How to
184
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2024 Jul 11, 2024
LATEST

Not sure I understand completely, and I may be a little out of my lane, but this sounds like a good application for Essential Graphics. You would create a precomp named ("Flags") that has all your flag images with a null named "control" at the bottom of the layer stack. You'd add a slider to the null and an opacity expression like this to each of the flag layers:

thisComp.layer("control").effect("Slider Control")("Slider") == index ? 100 : 0

Then you'd add the slider to the Essential Graphics panel. Then you'd create a new comp and drag the Flags precomp in as a layer. Twirl open the Essential Properties and add this expression to the Slider Control:

numFlags = comp("Flags").numLayers-1;
1 + Math.floor(random(numFlags))

Then add your star shape as a mask or track matte.

Duplicate the comp in the Project panel and you should get a random flag in each copy. Hope that helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines