Copy link to clipboard
Copied
I'm using a control layer (gradient ramp) to attempt to adjust the scale of another layer but I am baffled why my expression when added to the layer scale transform is affecting the position of my layer object. It should only adjust the scale and leave the position parameters alone?
The expression I am using is:
x = thisComp.layer("Gradient: Plus Chevron").sampleImage(transform.position, [.5,.5]/2, true, time)[0];
100*[x,x]
Here is a video showing that the layer object moves from the center leftward to end at it's origin when the scale goes from 0-100%. How do I prevent the layer from moving? I just need it to scale in place.
Copy link to clipboard
Copied
This is the youtube tutorial I have been following that explains using the gradient ramp as a control layer via the sampleimage expression: https://www.youtube.com/watch?v=1UaZNcVobhg
Copy link to clipboard
Copied
Simple answer: You did not pay attention to actually center the transforms of the actual shape layer groups. The values are probably completely wacky and you need to reset them or else of course they will affect the origin of the scaling, making it appear as if stuff moves.
Mylenium
Copy link to clipboard
Copied
this is helpful, so I imported an .eps file -> .ai and then imported that into AE, then converted .ai into shape layers. How would I center the transform for these imported layers?
Copy link to clipboard
Copied
Note that I need to retain the position of the layers, I also have another file with 100's of shapes setup in a micropattern and so I somehow need to retain the positions into AE without manually redoing the layout if possible? Here is a sample of the microp[atterns that I need to animate.
Copy link to clipboard
Copied
First, there is no need to convert your vector layers to shape layers. You don't gain anything unless you need to use Shape layer animators like Trim Paths or you need to actually animate the path of the shape layer. The only other reason to ever convert a vector layer (Illustrator layer) to a shape layer is to use the C4D rendering engine to extrude the layer or export a C4D file to generate shapes in C4D that you can animate. Every time you convert a vector layer to a shape you increase render time, loose brush strokes, gradients become gray fills, and a dozen or so other common drawing techniques used in AI get thrown away.
I would make sure the layer structure in Illustrator put each object that I wanted to animate on a separate layer. I would ent import the AI file as a composition retaining layer size. I would then add my animated gradient using a shape layer and then use the position of each vector layer as the sample point to look at the gradient.
In this case, I'm using a half dozen text layers with a "+" sign and scale to recreate your comp. I didn't take the time to do it in Illustrator, but I could have. The workflow and expressions are the same. Here is the expression I would use:
point = position;
srcLayer = thisComp.layer("Shape Layer 1");
t = srcLayer.sampleImage(point, radius = [.5, .5])[0];
scl = linear(t, 0, 1, 200, 50);
[scl, scl]
The gradient is white to black to 60 % gray and the linear method changes the scale from 50% for white to 200% for black to 100% for 66% gray.
I've uploaded the comp. I would use the same linear method to control position or rotation, or any other property that you want to animate. You just have to set the appropriate values.
Your mistake was not having the shape position and transform property set correctly. You could apply the expression to Shape Layer, Shape 1/Transform Shape 1/ scale if the Transform Shape 1/ Anchor Point was exactly over the center of the + shape
The tutorial gets a C- because the workflow is fairly inefficient, especially when it comes to distributing the layers and the expression is oversimplified and does not allow for any real customization.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now