Generate Your Own Splendid Spirographical Designs

Generate Your Own Splendid Spirographical Designs

Tutorial Details
Download Source Files

Final Product What You'll Be Creating

Today, we’re going to resurrect a classic drawing toy in After Effects using an expression tied into a few custom sliders. I used Trapcode Particular 2.0 to display the resulting animated patterns but CC Particle World could be used almost as easily and the results can be used in a myriad of ways for your projects. Or you can just experiment and see what kind of unique shapes you can generate just by changing a few numbers.

Republished Tutorial

Every few weeks, we revisit some of our reader's favorite posts from throughout the history of the site. This tutorial was first published in March 2010.


Tutorial

Download Tutorial .flv

File size 135MB

  • Teminator

    hurrey i am the first

    • Axel

      Do you have to do this for every tutorial?

      • jedi

        at least spell “hurray” correctly if you are.

  • Jonas

    While expressions are great, you can do the same spirographing with three parented null objects (simulating physical spirograph) and a single toWorld function. I prefer this way because it provides better visual understanding.

  • Terminator

    hurrey i am the first to download the video

    • http://psd-links.blogspot.com kswiss

      Ill be back for this tut

  • Nathanael

    I understand that it’s good to help beginners, and yes, this is a good tutorial for ‘beginners’, but what i want to say is, it’s been a LONG TIME since we’ve seen an actual tutorial for non-beginners who actually not their way around After Effects.

    I would die for an EPIC tutorial from someone again…Seriously…its been AGES!

  • Max

    I really like the effect, but the patterns after they’ve been drawn/generated look kinda static? But I’m not sure myself what would give it a bit more life?

  • http://www.gsatgames.com kamal98

    Hey this not a bad idea i can see some use for this thanks men.

  • http://www.marvgilbert.com/ Marv Gilbert

    Just now have a client with a spiro shape in their logo. Good Timing! Thanks.

  • jakz

    DIDNT WORK!!!!
    what did I do wrong?

    Fr = thisComp.layer(“control”).effect(“Fixed radius”)(“Slider”);
    Mr = thisComp.layer(“control”).effect(“Moving radius”)(“Slider”);
    O = thisComp.layer(“control”).effect(“Point offset”)(“Slider”);
    Sp = thisComp.layer(“control”).effect(“speed”)(“Slider”)*time;
    Sc = thisComp.layer(“control”).effect(“scale”)(“Slider”);

    if(Mr==0)Mr = 1;
    if(Fr==0)Fr = 1;

    x = (Fr+Mr)*math.cos(Sp) – ( Mr+O)*math.cos(((Fr+Mr)/Mr)*Sp);
    y = (Fr+Mr)*math.sin(Sp) – ( Mr+O)*math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

    • http://www.media-geeks.com Christopher Kirkman

      Hi jakz,

      AE functions are case sensitive and when referencing a math function, the M has to be capitalized. Just caps-up those four instances in the last lines of the expression and you should be fine. Here’s the whole thing for anyone who wants to copy/paste (note, your layers and slider names might be different, so change as necessary):

      Fr = thisComp.layer(“control”).effect(“Fixed Radius”)(“Slider”);
      Mr = thisComp.layer(“control”).effect(“Moving Radius”)(“Slider”);
      O = thisComp.layer(“control”).effect(“Pen Offset”)(“Slider”);
      Sp = thisComp.layer(“control”).effect(“Speed”)(“Slider”)*time;
      Sc = thisComp.layer(“control”).effect(“Scale”)(“Slider”);

      if(Fr==0) Fr=1;
      if(Mr==0)Mr=1;

      x=(Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
      y=(Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

      [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

  • jNothing

    uhm… I can’t dload source files but I’m logged in…
    ideas?

  • yogafish

    The tutorial video says it’s having playback error – can someone please fix this?

  • Imray

    Can someone explain the expression? Seems you just completely ran over that, even though it was the main part

  • http://www.skyvat.net skyvat

    Great tutorial – however I am getting an error in line 10 and not quite clear why. Says it is a syntax error, but I copied the expression from directly above. Anyone able to see the error?

    Fr = thisComp.layer(“control”).effect(“Fixed Radius”)(“Slider”)
    Mr = thisComp.layer(“control”).effect(“Moving Radius”)(“Slider”)
    O = thisComp.layer(“control”).effect(“Point Offset”)(“Slider”);
    Sp = thisComp.layer(“control”).effect(“Speed”)(“Slider”)*time;
    Sc = thisComp.layer(“control”).effect(“Scale”)(“Slider”)

    if(Fr==0) Fr=1;
    if(Mr==0)Mr=1;

    x=(Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
    y=(Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

    Thank you

  • http://plasticexistence.pt.vu plastic

    I’m having the exact same issue has the user above me..
    I’m using CS5 and Particular v2.
    I’ve made sure that all the variable names and layer names are correct.

    Anyone has a fix?

    Thank you

  • dane

    The apparent “generated look” can be greatly improved by going, in your particular layer, to “position subframe” in the emitter section and choosing “10x smooth.” I’m going to see if I can attach an equation to the position z as well to try and make these more 3d.

  • dane

    Just ftr, yeah, it works. Just do something like “math.Sin(time)*100″ and the z value will go from -100 to 100 and back again, allowing you to fly a camera through the middle of it.

  • Rohith

    Fr = thisComp.layer(“control”).effect(“Fixed Radius”)(“Slider”)
    Mr = thisComp.layer(“control”).effect(“Moving Radius”)(“Slider”)
    O = thisComp.layer(“control”).effect(“Point Offset”)(“Slider”);
    Sp = thisComp.layer(“control”).effect(“Speed”)(“Slider”)*time;
    Sc = thisComp.layer(“control”).effect(“Scale”)(“Slider”)

    if(Fr==0) Fr=1;
    if(Mr==0)Mr=1;

    x=(Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
    y=(Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

    If anyone gets error using this script replace “–” with “-” in x and y equation

  • ricardo hubbs

    I keep getting this error, but my code is identical? i am also curious where i can find the line numbers, where is line 13, for example? thanks

    my code:

    Fr = thisComp.layer(“spiro controller”).effect(“Fixed Radius”)(“Slider”);
    Mr = thisComp.layer(“spiro controller”).effect(“Moving Radius”)(“Slider”);
    O = thisComp.layer(“spiro controller”).effect(“Point Offset”)(“Slider”);
    Sp = thisComp.layer(“spiro controller”).effect(“Speed”)(“Slider”)*time;
    Sc = thisComp.layer(“spiro controller”).effect(“Scale”)(“Slider”);

    if(Mr==0)Mr = 1;
    if(Fr==0)Fr = 1;

    X = (Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
    Y = (Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;
    _________

    After Effects warning: Class ‘global’ has no property or method named ‘x’

    Expression disabled.

    Error occurred at line 13.
    Comp:’spiro’
    Layer: 2(‘particles’)
    Property: ‘Position XY’