Ronan De lacy
Forum Replies Created
-
Hey Filip,
I think that I have found a solution to this, using regex expression on the source text property. For my use case, I am working with localising comps, where the target language and Latin characters will have different typefaces.
text.sourceText.style.setFont("PingFangTC-Medium");
var textIndex = text.sourceText.length;
var RE = /[a-z_ ]/gi;
txt = text.sourceText.replace(RE, function($0) {
return '~'.repeat($0.length);
});
if(txt.charAt(textIndex - 1) == '~') { style.setFont("ComicSansMS-Bold"); }
The “solution” is a bit buggy and works intermittently. Would be very interested to hear your take on it. I’ve attached a basic example project file if anyone want’s to take a look.
-
Hi Dan,
Thanks for your explanations here. It’s starting to make things a little clear when trying ut use Penner easing in expressions. One question, however.
I have it working with easeInOutExpo, but when I switch out the function to another Penner ease, either the scale of the object increases 100x(ish) or the animation loops.
Any idea where I’m going wrong?
Here’s my expression as it stands, working with easeInOutExpo.
function easeInOutExpo (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2 * Math.pow( 2, 10 * (t - 1) ) + b;
t--;
return c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b;
};
Out=thisComp.layer("Controls").effect("Resolve By")("Slider"); //When should the animatiob be complete
Dur=thisComp.layer("Controls").effect("End Resolve Duration")("Slider"); //How long should the animtion be
x1 = 0;
x2 = 24;
t = time- Out+Dur;
d = Dur;
x=transform.scale[0]+easeInOutExpo(t,x1, x2 - x1, d);
y=transform.scale[1]+easeInOutExpo(t,x1, x2 - x1, d);
[x,y]
And this one, for example, just loops continuously
function easeInOutSine (t, b, c, d) {
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
}
Out=thisComp.layer("Controls").effect("Resolve By")("Slider");//When should the animatiob be complete
Dur=thisComp.layer("Controls").effect("End Resolve Duration")("Slider");//How long should the animtion be
x1 = 0;
x2 = 24;
t = time- Out+Dur;
d = Dur;
x=transform.scale[0]+easeInOutSine(t,x1, x2 - x1, d);
y=transform.scale[1]+easeInOutSine(t,x1, x2 - x1, d);
[x,y]
-
Ronan De lacy
May 20, 2021 at 7:36 am in reply to: Is it possible to convert slider decimal place to FPS?Thank you, Filip! This is just what I wanted to achieve!
-
Ronan De lacy
February 3, 2021 at 9:51 am in reply to: Filter Dropdown List results by layer type – ExtendscriptHi Fabrice – thanks so much, this has corrected my path!!
-
Ronan De lacy
January 27, 2021 at 11:15 am in reply to: ExtendScript – Items in my dropdown list are repeating – HelpHi Andrei,
I have a follow up question to my last (sorry).
<font face=”inherit”>If I wanted to filter the results that appear in my dropdown list by label color, how should I go about it? for example, if </font>I<font face=”inherit”> only want the list to contain layers that have the have a label color of red (1)?</font>
<font face=”inherit”>
</font><font face=”inherit”>
</font> -
Ronan De lacy
January 25, 2021 at 10:22 am in reply to: ExtendsScript – dynamic variable names function loop – HelpHi Filip,
Thank you so much – all if your suggestions worked.
And yes, compWidth and compHeight are globals within the larger script.
Cheers,
Ronan
-
Crisis averted. I moved the add stroke to the bottom of the stack and placed it within it’s own variable. See below for fix
var addLayer = app.project.item(5).layers;
//Add Headline Grid
var addGrid = addLayer.addShape();
addGrid.label = (13);
addGrid.name = ("headline-text-grid");
var group = addGrid.content.addProperty("ADBE Vector Group");
group.name = "P1";
var myShapeGroup = group.content.addProperty("ADBE Vector Shape - Group");
var myShape = new Shape();
myShape.vertices = [[-compWidth/2,-compHeight/2],[compWidth/2,-compHeight/2]];
myShape.closed = false;
// set the value of th path too the shape object
myShapeGroup.property("ADBE Vector Shape").setValue(myShape);
var stroke = group.content.addProperty("ADBE Vector Graphic - Stroke"); // add a stroke
-
Ronan De lacy
January 12, 2021 at 3:04 pm in reply to: ExtendScript – Items in my dropdown list are repeating – HelpHi Andrei. That worked, thanks so much!!
-
Ronan De lacy
November 19, 2020 at 2:16 pm in reply to: Variables returning as Undefined – ExtendScriptThanks Matt,
The weird thing here is that the way I have it structured on the above post, it works sometimes and doesn’t others. I’m using Visual Studio Code and I’m a bit of a noob with it comes to ExtendScript. I cannot figure out what’s going on with it!
-
Hey Filip – Thanks so much… I’ve been tearing my hair all morning trying to figure out where I went wrong!!