- January 7, 2019 at 9:38 am
Using the powerful ‘ Create nulls from paths ‘ script, I am writing a script that reads the Path from an external XML file.
The Path has no keyframes, but the points auto-created as linear :
- January 7, 2019 at 10:30 am
Since CC 18 you can directly access path nodes and their tangents in a manner like this:
comp(“Comp”).layer(“Shape Layer”).content(“Shape”).content(“Path”).path.points()[i] = [666, 666]
comp(“Comp”).layer(“Shape Layer”).content(“Shape”).content(“Path”).path.inTangents()[i] = [1, 0]
comp(“Comp”).layer(“Shape Layer”).content(“Shape”).content(“Path”).path.outTangents()[i] = [0,1]
Those “linear” nodes of yours are nodes with no tangent handles i.e. with In Tangent and Out Tangent both equal [0,0]. Changing those to something different than [0,0] will give you a Bezier curve.
Hope this helps you one way or another.
- January 7, 2019 at 4:55 pm
Thank you Oleg <:]
I’ll try that ;
So ill need to know what is the next point is to figure out the direction and value of those tangents.
Since the path is created automatically
- February 2, 2019 at 3:30 pm
I’ve written a script which does the thing for every selected property of shape type (i.e. select the shape path and run the script):
//the script smooths (sets interpolation to Auto Bezier) selected shape properties
//smooths a shape path
//create dummy composition and a text layer in it
var comp = app.project.items.addComp("Dummy", 100, 100, 1, 1, 1);
var pos = comp.layers.addText().transform.position;
//create key frames in null position for every shape vertex
for (var i=0; i
Log in to reply.