Kevin Camp
Forum Replies Created
-
It would be great if you could.
I had hoped that styles would work that way, but when I’ve tried to achieve something similar, I found the same issue that Yoan ran into, and then reverted to a method using text animators or separate layers and sourceRectAtTime().
-
It depends a little on what you mean by ‘mask’. If you mean layer mask like the kind you draw on a layer with the mask tool, then I don’t think so… I don’t know how you would use an expression to change the shape/vertices of a layer mask.
If you mean you’re using a layer as a Track Matte (or Set Matte effect) to reveal the text or the shape layer behind the text, then yes, since you can use sourceRectAtTime() to affect the position of the matte layer.
Assuming the reveal is a kind of simple wipe on the x-axis, try this:
Create a comp-sized solid and name it ‘matte’ and parent it to the layer that you want to reveal (it will make the expression a bit easier).
Add a position keyframe for the matte where and when you want the wipe to start, and then add another keyframe when you want it to end (the final position doesn’t matter since the expression will handle that, but maybe drag it halfway across the screen).
Then try this expression for the matte layer’s position:
startX = key(1).value[0] ;
rect = parent.sourceRectAtTime() ;
endX = rect.width +sourceRectAtTime().width / 2 ;
x = ease( time, key(1).time, key(2).time, startX, endX ) ;
[ x, value[1] ]The matte layer should now animate from the start position (from the 1st keyframe) to the right edge of the parent.
-
Interesting… I have not updated yet, but I do see Particle Playground under Simulations in AE 17.6.
Perhaps it has been moved into the Obsolete effects in 17.7
-
After looking a bit more closely at your example, my solution may not give you what you described… your example has ‘multi lines of text’ all centered to itself with ‘xyz’ hanging off to the right. Since my solution is injecting the ‘xyz’ text into the other text, the last line ‘text –xyz’ will recenter.
If that is a problem, then you can make separate text layers for each line (the text for those lines will can come from a single text layer by using expressions). Then you could use sourceRectAtTime() to add the ‘xyz’ to the end of the last text line. It would be a bit more complicated since you may need to evaluate which line is the last line with text in it, assuming not all 3 lines would always have text.
-
Hi Adam, this method would only work with text… if the precomp had text in it, and you only needed the text (not other layers) from that precomp, then it could work. You’d need to direct the expression to find the ‘small text’ text layer in the precomp… it would be something like:
comp("my precomp").layer("small text").text.sourceText ;However if there are other non-text layers in the precomp, this method would not work.
-
you could do it with two different text layers, but the smaller text layer would only be used to add text to the main text layer, and then you could use a text animator to make the ‘added’ text smaller…. and it will be a little easier if the main line is paragraph text rather than point text (ie, you would not use hard returns to make lines break, the lines just break as they wrap to the area).
try this:
Create a text layer as paragraph text (use the text tool and create a box for the text), then create another text layer (point text is fine, this layer will not be seen, we will just take the sourceText from it) and make that layer a guide layer.
In the sourceText property of the main layer add an expression like this:
value + ' ' + thisComp.layer("small text").text.sourceText ; // set the 'small text' layer to your second text layerThis should add the text from the second layer to the end of the main layer.
On the main text layer, add a text animator for scale and set the scale to 50% (or whatever scale you want). Then in the Start property of the Range Selector add an expression like this:
txt1 = text.sourceText ;txt2 = thisComp.layer("small text").text.sourceText ; // set this layer to your second text layer
100 - ( 100 * txt2.length / txt1.length )
Now your second text should be added to the main text and be smaller, but the characters may not have the tracking you’d like. To adjust that, simply add a Tracking animator to that same text animator from the ‘add’ menu to the right of the Animator in the timeline and adjust as needed.
-
Kevin Camp
February 17, 2021 at 4:30 pm in reply to: Laser/Ray Animation from Salvador Dali Paintingthere are a few different radial blur effects that can help you create a light ray effect like that.
try this:
create a new solid, add the circle effect and add the cc radial fast blur effect.
in the radial blur settings change the ‘center’ property so that it is not in the center of the solid, maybe move it to the upper-right of the circle. adjust the amount to make the light ray longer and also set the ‘zoom’ property to ‘brightest’.
it should get you close.
-
Also, if you have a newer version of AE (17+) and set the Expression Engine to JavaScript in the Project Settings, you can use the java function toLocaleString() to add commas/separators based on language and country.
This would put in commas as separators:
num = effect("Point Control")("Point")[0] ;num.toLocaleString('en-US') ;
This would use spaces for French:
num = effect("Point Control")("Point")[0] ;num.toLocaleString('fr-FR') ;
You can use a slider or rotation control or even the sourceText value, but you’ll need to convert it to float or integer first:
num = effect("Slider Control")("Slider") ;parseFloat(num).toLocaleString() ;
There are also options for currency and date and more in toLocaleString(). This link has some examples: https://www.c-sharpcorner.com/article/format-number-currency-and-date-using-tolocalestring-method-in-javascript/
-
Here’s a project file I put together.
-
I’m not sure how you are currently adding the cursor, but if you are adding the pipe (‘|’) in the sourceText, then you might be able to use a text animator to text layer to select just the last character of the sourceText and adjust the x-scale of the pipe to make it wider.