AmigoProductions
AmigoProductions Recent Posts Threads Started
168 posts
  • Has sold $5,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
  • Has referred 50+ members
+3 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.

312 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Located in India
+2 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

5257 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+11 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;
}
312 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Located in India
+2 more
DarkLand says

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

5257 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+11 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. :-)

312 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Located in India
+2 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)?

5257 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+11 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;
}
312 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Located in India
+2 more
DarkLand says

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

5257 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+11 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;
}
312 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Located in India
+2 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by