Alex Printz
Forum Replies Created
-
No it is not possible.
Alex Printz
Mograph Designer -
Alex Printz
March 18, 2020 at 2:41 pm in reply to: How’s business right now? (Also, what and where?) And how are YOU doing?I work as video/mograph expert for a medium international company – luckily I was able to transition my motion graphics from onsite to home from personal effort prior to COVID-19 outbreak becoming reality. Three months ago I built a PC system that is equivalent the one I use at the office and I was able to mirror all my work files to a offsite backup service prior to all of this happening.
It amazes me that IT was upset that I was taking on responsibility and preemptive-ness with backing up and mirroring my work so that I could work from home whenever I choose, and now it’s saved my own ass and is letting me work at 90% efficiency when most of my colleagues are caught off guard and IT can’t give me the time of day they’re so busy.
Alex Printz
Mograph Designer -
Alex Printz
March 17, 2020 at 6:24 pm in reply to: Finding the trim path end point across multiple pathsSimply keyframe each 0-100 and spread the keys as necessary.
If you really want to measure the length between the different strokes, you’re going to have to build a loop that measures each length, compares them, and then trims them. I don’t suggest doing it that way.
Alex Printz
Mograph Designer -
Alex Printz
March 12, 2020 at 9:14 pm in reply to: Finding the trim path end point across multiple pathsYou’re going to need to do a few things; if i was going to do this I would:
1. Get the target image to follow the point and rotation (if desired) on a single path with pointOnPath/normalOnPath and toWorld functions/toWorldVec from a selected point. Dan has great writeups on that already.
Then you’re going to need to make a global ‘trim’ slider that can go from 0-(numPaths*100), and then for each of your shape layer paths you’re going to need to set their trims to go from ((pathIndex-1)*100 – pathIndex*100) so that sliding the global slider will draw each path appropriately.
Then add a switch function prior to the image’s pointOnPath section of the script, and make the case function look for which trim path is ‘active’ in the global ‘trim’ slider, and then swap out the target Layer based on whichever is the target.
Sliding through the global ‘trim’ slider should now draw through all of the layers. If you need to do blank sections, simply don’t add a stroke for another layer to bridge two visible layers.
Alex Printz
Mograph Designer -
Alex Printz
March 12, 2020 at 9:05 pm in reply to: Get Font, Font Size and Source Text ONLY from other Textline AE 20 for Essential Graphic use.So you are looking to get 3 other properties from another text layer (font, font size, source text);
where are the rest of the properties going to come from for generating the font? They must be defined from somewhere.
These are all the setStyle functions (and there are corresponding ‘get’ functions).
setText
setFontSize
setFont
setFauxBold
setFauxItalic
setAllCaps
setSmallCaps
setTracking
setLeading
setAutoLeading
setBaselineShift
setApplyFill
setFillColor
setApplyStroke
setStrokeColor
setStrokeWidthYou can either create a new style, or grab an existing style and modify it.
Alex Printz
Mograph Designer -
You can do it with a linear interpolation. you can change linear to ease if you want below, or try to implement penner easing with some more complex functions.
If you wanted to use keyframes instead of different paths, you would generate two different times (ta, tb) using key(1).time, key(2).time, and then instead generate Pa/Ta/Oa using ta instead of t, and the same thing for B sets.
You miiiight be able to try:
P = linear(m,0,1,Pa,Pb);
T = linear(m,0,1,Ta,Tb);
O = linear(m,0,1,Oa,Ob);
but I am unsure if it will work, not at a workstation to test if linear can handle longer arrays.
A = thisComp.layer("path A").content("group 1").content("Path 1").path; //path A point
B = thisComp.layer("path B").content("group 1").content("Path 1").path; //path B point;
m = .5 // percent to morph between them
t = time; //sets the time to grabPa = A.points(t); //points for path A
Ta = A.inTangents(t); inTangents for path A
Oa = A.outTangents(t); outTangents for path APb = B.points(t);
Tb = B.inTangents(t);
Ob = B.outTangents(t);P = []; //final points
T = []; //final inTangents
O = []; //final outTangentsfor(i=0; i<Pa.length; i++){ //linearizes all properties for each point
P.push(linear(m,0,1,Pa[i],Pb[i]));
T.push(linear(m,0,1,Ta[i],Tb[i]));
O.push(linear(m,0,1,Oa[i],Ob[i]));
}
createPath(P,T,O,A.isClosed()); //creates new path, checks if A was closedAlex Printz
Mograph Designer -
Whoops, the else statment was supposed to be different, not the exact same thing than the divisible by 10 if statement
p = value + (value*.1 * i); modify position another way;Alex Printz
Mograph Designer -
No there is no way to differentiate items inside repeaters.
What you might have been doing is duplicating the contents, transforming them based on their propertyIndex, and every 10th modifying it.
Should look something like this (expression being applied to the position)
shape layer > contents > “all assets” group > “asset 1” group > transform > position
i = thisProperty.propertyGroup(2).propertyIndex; //get the group index of this asset group inside the all assets group
v = value //value of property
if( i%10 === 0){ //modify the position based on if the index is equally divisible by 10
p = value + (value*.1 * i) + [0,-100]; modify position one way;
} else{
p = value + (value*.1 * i) + [0,-100]; modify position another way;
}
p //final callAlex Printz
Mograph Designer -
Which part of the 2nd script is getting the index out of range? The only thing I can think is the group with the nested paths inside; IIRC that’s the only index measuring. Shape layers can be tricky, there’s the group and then the content nested seperately, so make sure you’re linking it similar to how I have it written.
Yes this would be easier to do in a script than expressions; you could simply store the selected path data as a variable, cycle through modifying the selected path down to its individual segments and measuring their length, put the final path back in,
then compare the different path path lengths relative to their positions in the total length and then get a percentage.Paul’s awesome, glad to see his stuff is being put to use;. looks like he’s pulled in a more advanced measuring method than I would use (or could ever begin to think of).
Alex Printz
Mograph Designer -
So, I figured it out, but it cannot be calculated from a single expression, and because of how after effects’ “createPath” function works it requires a minimum number of additional path layers in a sub folder equal to or greater than the number of vertices in the target path.
In short, it’s a pain, but here’s how you do it:
make a shape layer with a bunch of paths inside the same isolated folder, and into all of those put this expression:
L = thisComp.layer("Shape Layer 1").content("master path").path //target path;
i = thisProperty.propertyGroup(1).propertyIndex; //get index;P = L.points();
T = L.inTangents();
O = L.outTangents();try{
tP = [ P[i-1], P[i] ];
tT = [ [0,0], T[i] ];
tO = [ O[i-1], [0,0] ];
createPath(tP, tT, tO, false); //create temp path
} catch(e) {createPath([[0,0],[0,0]],[],[],false)}Then, after that, place this code into whatever property you want to return the percentage, and make sure you property link the location of the master path, and the location of the sub-paths.
use r to set the resolution (higher means more accurate, but more calculations), while n will target the index you desire to grab.
L = content("master path").path //target path;
T = content("split paths"); //target content folder;n = 1; //index of point to get percentage
r = 10; //resolutionP = L.points();
n = clamp(n,0,P.length-1) //limits the target index to number of pointspA = []; //point array
for(i=1;i<=L.points().length;i++){
pA[i] = T.content(i).path; //pushes the sub-paths into an array
}pL = [0]; //per-point segment length
pT = 0; //total line length
pd = [0]; //per-point distancefor(i=1;i<P.length;i++){ //for each point
pL[i] = 0; //initial distance 0;
for(j=1;j<r;j++) pL[i] += length(pA[i].pointOnPath((1/r)*(j-1)),pA[i].pointOnPath((1/r)*j)); //measure length;
}for(i=0;i<pL.length;i++) pT+= pL[i]; //total length
for(i=1;i<pL.length;i++) pL[i] += pL[i-1]; //adds distances before to current point;
for(i=1;i<pL.length-1;i++) pd.push(pL[i] / pT); //gets a percentage
pd.push(1); //last point 100%pd[n]*100;
Alex Printz
Mograph Designer