Alex Printz
Forum Replies Created
-
Alex Printz
November 7, 2018 at 5:22 pm in reply to: Illegal use of Reserved word – multiple If/Else statementsAfter effects does not register “else if” statements. You would just want to put a series of if statements in a tree, swap out the variables, or use a switch case.
R = transform.rotation;
C = thisComp.layer("Controller").effect("Width")(1);switch(true){
case 0 < R && R <= 90:
R *= C;
break;case 90 < R && R < 180:
R = (180 - R) * C;
break;case 180 < R && R < 270:
R = (180 - R) * C;
break;case R == 270:
R = C * -90;
break;case 270 < R && R < 360:
R = -(360 - R) * C;
break;default:
R = 0;
}R
You might want to check all of your statements as I see some gaps (R < 0, R=180, R<=360, etc.)
Alex Printz
Mograph Designer -
but, if the comp you’re applying this expression to is parent to another layer, you have to counter it’s parents position. That would be:
L = comp("COMPNAME").layer("LAYERNAME");
parent.fromWorld(L.toWorld(L.anchorPoint));
Alex Printz
Mograph Designer -
Try this, will work if the comp dimensions are the same:
L = comp("COMPNAME").layer("LAYERNAME");
L.toWorld(L.anchorPoint)Alex Printz
Mograph Designer -
Alex Printz
November 7, 2018 at 4:41 pm in reply to: Scale up rotated rectangle to cover comp canvas.Assuming it is a square, in middle of the comp, and the same size of the comp, it would be this:
a = degreesToRadians(Math.abs(transform.rotation%90));
h = Math.sqrt(2 * Math.pow(value[0]/2, 2));
o = Math.cos(a - degreesToRadians(45))*h;
s = 2*o / value[0];
value*s
Alex Printz
Mograph Designer -
oops, disregard my message, I thought you were talking about layer label colors.
Alex Printz
Mograph Designer -
IIRC expressions do not have access to anything GUI related except markers, so your label colors cannot be referenced. Someone else will have to chime in for scripting through; I know it’s possible there.
Alex Printz
Mograph Designer -
Alex Printz
October 31, 2018 at 2:30 pm in reply to: reference time value of precomp without timeRemap enabled?digging a bit deeper, I figured it out; it would be:
targetLayer.sourceTime(time)
Hope anyone else who’s googling around can find this helpful.
Alex Printz
Mograph Designer -
Alex Printz
October 24, 2018 at 2:18 pm in reply to: Differentiating Properties by their Property GroupsI don’t think so; effect elements stack as layers, the sub-groups inside effects are just peudo-groups that are for usability only but are not used in actual referencing.
Your best bet would be referencing indexes and relative use, or using a name structure in your effect that you can add/subtract strings from to call sections appropriately.
Alex Printz
Mograph Designer -
I’ve used the pseudo effect maker plugin before with great success.
https://aescripts.com/pseudo-effect-maker/
Alex Printz
Mograph Designer -
Oh man Dan you’re a life saver, I never would have thought something like that; here I was looking for code issues in my if/for loops. Crazy.
Thanks so so much.
Alex Printz
Mograph Designer