Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


HI. [JSFL] I want to get the start and end coordinates of the brush.

Enthusiast ,
Apr 04, 2021 Apr 04, 2021

Copy link to clipboard

Copied

444.JPG

 

 

I need to get, the beginning and end of the brush.

I don't know how to get the exact point.

 

 

 

 

Views

85

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 16, 2021 Apr 16, 2021

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)
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 16, 2021 Apr 16, 2021

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

 

封闭.gif

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 12, 2021 Sep 12, 2021

Copy link to clipboard

Copied

LATEST

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)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines