AmigoProductions
AmigoProductions Recent Posts Threads Started
332 posts
  • Trendsetter
  • Author Level 5
  • Exclusive Author
  • Beta Tester
+4 more
AmigoProductions
says



Not with expressions.
Thanks for your reply – is there a way of doing this without expressions?
Scripting. Check out the scripting links in the first post. And in particular, this http://videohive.net/forums/thread/the-expressions-thread/79625?page=29#773930

Great! Thanks again, I’ll look into it.

313 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Meetup Participant
+3 more
DarkLand
says

Hi,
How to call the comp layers by using ‘Text layer’ characters?

For example I have one ‘Text layer’ and some comp layers called A,B,C,D,etc. If my ‘Text layer’ contains the string “BAD” means each letter should call the respective comp layers ‘B’ ‘A’ ‘D’ . And the comp layers should Blink simultaneously. Like this

5327 posts
  • Elite Author
  • Moderator
  • Weekly Top Seller
  • Top Monthly Author
+13 more
felt_tips
Moderator
says

Hi,
How to call the comp layers by using ‘Text layer’ characters?

For example I have one ‘Text layer’ and some comp layers called A,B,C,D,etc. If my ‘Text layer’ contains the string “BAD” means each letter should call the respective comp layers ‘B’ ‘A’ ‘D’ . And the comp layers should Blink simultaneously. Like this

Do you want them to blink simultaneously, as in what you wrote, or consecutively, as in the gif you posted?

In opacity:
tText = thisComp.layer("Text Layer").text.sourceText;
myLetter = "B"; //<---- you have to customize this for each layer.
if(tText.indexOf(myLetter) != -1) {
    myStart = 50;
    myFreq = 2;
    myCycleLength = 100;
    tFrame = timeToFrames(time)-myStart;
    tFrame = (tFrame+10000) % myCycleLength;
    tFrame = linear(tFrame, 0, myCycleLength, 0, myFreq*2*Math.PI);
    Op = tFrame<myCycleLength/(myFreq*2) ? Math.max(0,100*Math.sin(tFrame)) : 100; //use segment of a sine curve to fade
    -Op+100;
} else {
    100;
}
313 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Meetup Participant
+3 more
DarkLand
says

Thankyou so much felt,
Sorry for the confussion. I want consecutively as mentioned in the gif.

5327 posts
  • Elite Author
  • Moderator
  • Weekly Top Seller
  • Top Monthly Author
+13 more
felt_tips
Moderator
says

Thankyou so much felt,
Sorry for the confussion. I want consecutively as mentioned in the gif.

And what kind of blink do you want? Smooth like in the gif, like a sine wave, or more triangle or square?

I need to know these things. There’s more than one way to skin a cat. :-)

313 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Meetup Participant
+3 more
DarkLand
says

I want smooth one :)
how to control No.of Cycles? And How to inverse the opacity (i.e from 0 -> 100 -> 0)?

5327 posts
  • Elite Author
  • Moderator
  • Weekly Top Seller
  • Top Monthly Author
+13 more
felt_tips
Moderator
says

About the code: Basically, it is using a modulo to repeatiedly cycle the frames. Then range mapping the blink section to between 0 and 1 and using a cosine function to do the smooth fade. Finally, subtracting by 1 to flip it if required and multiply by the original value.

  • aCycleFrames is the number of frames for a whole on/off cycle
  • aBlinkSectionFrames is the duration of the blink part.
  • If you use aBlinkSectionFrames = 40 and aCycleFrames = 200 as in the example below, then the blink will be 1.6seconds out of a whole cycle of 8 seconds.
  • To offset, use the third argument, aOffsetFrames. 25 in the example below.
  • To have the thing blink on, set aOn to true, to have it blink off, set it to false.

Enjoy. :-)

blink(200, 40, 25, true);

function blink(aCycleFrames, aBlinkSectionFrames, aOffsetFrames, aOn) {
    var tFrame = ( timeToFrames(time)+(Math.pow(10,8)-aOffsetFrames) ) % aCycleFrames;
    var tBlinkSec = linear(tFrame, 0, aBlinkSectionFrames, 0,1);
    tOp = (1 + Math.cos(Math.PI + tBlinkSec*2*Math.PI))/2;
    if(!aOn) tOp = 1-tOp;
    return tOp*value;
}
313 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Meetup Participant
+3 more
DarkLand
says

Thank you so much felt. You are really great!!
Sorry for this basic qus. How can I link both expressions together?

5327 posts
  • Elite Author
  • Moderator
  • Weekly Top Seller
  • Top Monthly Author
+13 more
felt_tips
Moderator
says

Thank you so much felt. You are really great!!
Sorry for this basic qus. How can I link both expressions together?

You gotta start working out how this stuff works for yourself, Darkland… or you’ll always be dependent on other people to do it for you. Study the code… make sure you understand what it’s doing, google “Javascript” and any terms you don’t understand. It’s all completely standard. Anything you can’t find with those Googles will be Ae specific stuff that you can look up in the help.

You may start out slowly, but that’s normal. Once you’ve jumped that hurdle of working it out for yourself, you’ll be amazed at what you learn to achieve quite quickly.

On this occasion though…

tText = thisComp.layer("Text Layer").text.sourceText;
myLetter = "B"; //<---- you have to customize this for each layer.
if(tText.indexOf(myLetter) != -1) {
    blink(200, 40, 25, true);
} else {
    value;
}

//custom function
function blink(aCycleFrames, aBlinkSectionFrames, aOffsetFrames, aOn) {
    var tFrame = ( timeToFrames(time)+(Math.pow(10,8)-aOffsetFrames) ) % aCycleFrames;
    var tBlinkSec = linear(tFrame, 0, aBlinkSectionFrames, 0,1);
    tOp = (1 + Math.cos(Math.PI + tBlinkSec*2*Math.PI))/2;
    if(!aOn) tOp = 1-tOp;
    return tOp*value;
}
313 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Meetup Participant
+3 more
DarkLand
says
You gotta start working out how this stuff works for yourself, Darkland… or you’ll always be dependent on other people to do it for you. Study the code… make sure you understand what it’s doing.

Definitely, Its time to learn coding :)


with love,
-Guna
by
by
by
by
by
by