Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Eric Sanderson on January 22, 2009 at 12:48 am

    I remember learning a script a long time ago that randomly generated source text to pre-determined words but i cant for the life of me remember how to do it. I basically have 10 or so different words i need duplicated and spread out all over the place,x,y and z. Ive already done a seedRandom on the position to duplicate all over the place when copied, but i dont want to have to type out in seperate layers all the different words so if someone knows the script i cant seem to remember that would be greatly appreciated.

    Michael Asgian replied 10 years, 2 months ago 6 Members · 6 Replies
  • 6 Replies
  • Eric Sanderson

    January 22, 2009 at 1:01 am
    i started by keyframing my source word with all the words i want within 1 second then used this...
    
    seedRandom(1,true);
    text.sourceText.valueAtTime(time=random(0,1))

    ok so i figured out a way to get the result i want but im sure its not the way ive done it before and probably not the best way of going about it, so heres what i did but i would still like to know the “right” way to do it. thanks.

  • Dan Ebberts

    January 22, 2009 at 1:02 am

    This should work:

    myWords = [“one”,”two”,”three”,”four”,”five”,”six”,”seven”,”eight”,”nine”,”ten”];

    seedRandom(index,true);
    myIdx = Math.floor(random(myWords.length));
    myWords[myIdx]

    Dan

  • Paul Hennell

    January 22, 2009 at 10:29 am

    I think you might find this script useful.


    Only in after effects do children get to pick and whip their parents.
    https://hennell-online.co.uk

  • Filip Vandueren

    January 23, 2009 at 12:31 am
    seedRandom(1,true);
    random(0,1);

    I think you might be better off precomping that text-layer with the keyframes,
    enable collapse-geometries on the precomp (so they remain vector-scalabel),
    then add Time-remapping with a similar expression.

    This way, you can use different fonts, sizes, colours, or ever important kerning-adjustments etc… for the different words.
    The sourceText only copies the actual string, not any other fine-tuning settings contained in a text keyframe.

  • Greg Jones

    January 30, 2009 at 9:07 pm

    This is great. Once typing this expression in, how do you get it to animate?

    Greg Jones

    Greg Jones
    Orlando,Fl.
    https://www.d7-inc.com

  • Michael Asgian

    February 6, 2016 at 6:05 pm

    This is great!

    Is there any way to stop animating and have just one random that will value that will stay up throgh the composition?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy