Alex Printz
Forum Replies Created
-
Do you want it to measure curves, or just straight line sections? Curves are going to require more work, but it is possible to approximate the distance (measuring bezier curves is basically splitting the curve into lots of little bits and measuring between those as straight lines).
Alex Printz
Mograph Designer -
Alex Printz
March 5, 2020 at 6:31 pm in reply to: Is it possible to combine two properties from textSource into new text layer?I don’t think extendScript is being updated; Javascript is the new engine that everything will be developed in moving forward.
Alex Printz
Mograph Designer -
Alex Printz
March 5, 2020 at 6:30 pm in reply to: Start Linear Expression at certain time, play it once and hold at end resultI think I understand what you’re trying to do, but I don’t understand how it fits in as a whole or what is driving what. How is your animation running? Are you keyframing it, running it through time (and if so, what is changing and what are the parameters)? What slider is your master control?
Linear is not a trigger, it’s a proportion scale, so it will have to be constantly calculating every frame, unless you have a trigger outside of this expression that you’re not describing here.
Alex Printz
Mograph Designer -
No what I’m suggesting is that the expression is dependent on some properties that aren’t passing through a toWorld function, so that it’s not registering correctly.
Can you highlight the changes you made before and after the toWorld was added? You may need to parse some of the data back through a fromWorld or something similar.
Alex Printz
Mograph Designer -
Alex Printz
March 5, 2020 at 6:08 pm in reply to: Is it possible to combine two properties from textSource into new text layer?Make sure you’re using the newer Javascript expression engine, not extendScript. Style attributes are only available there.
Alex Printz
Mograph Designer -
Compositions in and of themselves do not have indexes; they are entirely object orientated based on their name. They only get layer indexes when they are precomps inside another comp.
Dan’s solution seems right, but if you are looking for the inverse of that where Comp B is inside Comp A and has a specific index, you could do the code below.
The strength in this method is you can swap out the compB’s with many different precomps all with different text layers inside each, and your compA will update it’s expression.
i = 3; //comp B's exact layer index inside compA;
comp(thisComp.layer(i).name).layer("text layer 1").text.sourceText;
Alex Printz
Mograph Designer -
Can you first get this to work without the overshoot element of the script? I’m not sure what was added before and after the overshooting script, as that is (likely) the problem.
Alex Printz
Mograph Designer -
Because after effects 3D rotations are 3 different expressions: X, Y, and Z, while orientation calculations are matrix-based mathematics.
https://en.wikipedia.org/wiki/Rotation_matrix
After Effects expressions calculate independently one at a time; so an X-rotation is the first thing solved, then Y, then Z, etc, and the only thing that is shared is the final value.
Matrix calculations need to be preformed all at once and are interdependent, so if you solve for one and apply it, it will affect the others. They have to all be done at once. 2D rotation is a single rotation, so it’s much easier to solve for.
In the past I’ve built a 3D-based null that can steal the properties of other layers before, and the only way to solve for 3D rotation is to lock the rotation properties and instead use orientation, which is again going to be based on shortest path orientations and will (probably) give some incorrect results since orientation is not world-based, but object based.
There might be a way to calculate the orientation back to the worldspace through a toWorldVec calculation, but that’s a bit beyond me off the top of my head.
Alex Printz
Mograph Designer -
Not really, AE isn’t (officially) capable of calculating and distributing multiple rotation values at once which you need to do for 3D rotation calculations, so you would have to do it on orientation which wouldn’t be optimal, given it’s based on shortest-distance calculations to itself rather than world.
You could maybe cheat a lookAt expression on the orientation of an upper and lower limb and use an elbow and wrist controllers as targets, but it wouldn’t be true IK.
Alex Printz
Mograph Designer -
Alex Printz
March 3, 2020 at 7:49 pm in reply to: Start Linear Expression at certain time, play it once and hold at end resultIm a little confused, what is supposed to be driving what here?
You’re trying to start an animation when something else equals something else in time? What if x becomes greater than Y, or vice versa?
Here is an inline if operator, that sets typeOn equal to 0 unless x equals y, then it begins to linear in time from x to x+1, outputting 0 to length.
x = thisComp.layer("Text").effect("Type_on")("Slider");
y = thisComp.layer("Text").text.sourceText.length;
z = timeToFrames(time);
length = text.sourceText.length;typeOn = (x==y ? linear(time, x, x+1, 0, length) : 0);
Alex Printz
Mograph Designer