Copy link to clipboard
Copied
I need to get, the beginning and end of the brush.
I don't know how to get the exact point.
Copy link to clipboard
Copied
I can find every point
But
How do I find the start and end points?
var selPoints = new Object();
var allBezierPoints = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].vertices
for ( i in allBezierPoints ) {
selPoints[i] = { x:allBezierPoints[i].x, y:allBezierPoints[i].y }
}
fl.getDocumentDOM().moveSelectedBezierPointsBy({x:1, y:0});
allBezierPoints = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].vertices
for ( i in allBezierPoints ) {
if ( allBezierPoints[i].x == selPoints[i].x ) delete selPoints[i];
}
fl.getDocumentDOM().moveSelectedBezierPointsBy({x:0, y:0});
for ( i in selPoints) {
fl.trace ( "Point " + i + " X: "+selPoints[i].x +", Y: "+ selPoints[i].y)
}
Copy link to clipboard
Copied
hi.
I just want to get the same auto-off line feature as any other animation tool.
Hope to help me
Copy link to clipboard
Copied
This might be a stupid question but would it not just be the first and last entries of the array of points? If the array uses a format of (x,y) for each entry then wouldn't the first and last be the litteral first and last?
This method would probably only work if you have a single shape on that frame. Maybe use another property of the line to determine if it's connected? (all shapes are grouped as one element on each frame unless they're drawing objects or groups themselves)