Results 1 to 2 of 2

Thread: Turning a huge floor texture into a randomized tile set using After Effects

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Turning a huge floor texture into a randomized tile set using After Effects

    So, I had this huge marble texture, and I wanted to use it to make a floor for a battlemap.

    ss+(2018-08-05+at+03.48.28).png

    First problem: It's not sufficient to simply lay a grid over this and call it good, because the marble pattern wouldn't perfectly flow from tile to tile. Each tile should have its own marble pattern.

    So, what I want to do is chop this huge texture into square chunks and then place them in random positions, or something to that effect.

    The solution that I found? AFTER EFFECTS of all things. (I don't know how many of you have AE, but if you're playing for Adobe CC you've got it whether you use it or not, so yay)

    Steps:

    1. Create a composition that matches the size of a single floor tile.

    2. Drop the huge texture into the floor tile comp.

    3. Go to Composition > Open in Essential Graphics

    (This allows you to take certain properties in the comp and modify them individually among multiple instances of the same comp)

    4. On the texture layer, click and drag the "Position" property into the Essential Graphics panel.

    5. Create a new parent comp that will match the size of the floor texture you want -- should be a multiple of the floor tile size.

    6. Drop the floor tile comp into the parent comp.

    We're now going to write two expressions in order for this to work properly.

    7. In the timeline, on the floor tile comp, under Master Properties, Alt-click on the stopwatch next to "Position". To the right, where you type in the script, paste this:

    Code:
    [random(-1000,1050), random(-700,800)]
    (Adjust the numbers of each range to ensure that the texture will always be completely covering the tile comp)

    8. now, on the Transform > Position property of the floor tile comp, alt-click the stopwatch and paste the following:

    Code:
    origin = [70,70]; // center of upper-left element
    hDist = 140; 
    vDist = 140;
    numCols = 25;
    
    myCol = (index-1)%numCols;
    myRow = Math.floor((index-1)/numCols);
    
    origin + [myCol*hDist,myRow*vDist]
    (Change the value of origin, hDist, vDist, and numCols to match the needed dimensions)

    9) Duplicate the floor tile until the entire parent comp is filled.

    10) Render the current frame. You're done!

    ss+(2018-08-05+at+04.10.21).png
    Last edited by Dumont; 08-05-2018 at 08:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •