//CREATE LINE WITH MULTIPLE POINTS
int pointCount = chi("Point_Count");
int points[];
resize(points, pointCount);
for (int i=0; i < pointCount; i++)
{
vector curPos = set(0,i,0);
int curPointId = addpoint(geoself(), curPos);
points[i] = curPointId;
}
for(int i=0; i<pointCount-1; i++;
{
addprim(geoself(), "polyline", points[i], points[i+1]);
}
//addprim(geoself(), "polyline", points);
===========================================================================
//RECREATING LINE NODE
float length = ch("Length");
int pointCount = chi("Points");
vector dir = chv("Division");
vector offset = chv("Offset");
dir = normalize(dir);
int points[];
resize(points, pointCount);
float stepVal = length/(float)(pointCount-1);
for(int i=0; i<pointCount; i++)
{
vector pointPos = (dir) * (stepVal*i) + offset;
int cutID = addpoint(geoself(), pointPos);
points[i] = curID;
}
addprim(geoself(), "polyline", points);
===========================================================================
Tuesday, May 15, 2018
Wednesday, May 2, 2018
AE - PointAt
1) Create 3 nulls: Null_PointAt, Null_Base, Null_Target
2) Set the following transform expressions on Null_PointAt:
Position:
thisComp.layer("Null_Base").transform.position
Scale:
point1 = thisComp.layer("Null_Base").transform.position;
point2 = thisComp.layer("Null_Target").transform.position;
scl=length(point1, point2);
[scl, scl]
Rotation:
fromPoint = thisComp.layer("Null_Base").transform.position;
atPoint = thisComp.layer("Null_Target").transform.position;
Pointer3=lookAt(fromPoint, atPoint);
if(atPoint[1]<fromPoint[1]) [Pointer3[1]]-180; else [-Pointer3[1]];
2) Set the following transform expressions on Null_PointAt:
Position:
thisComp.layer("Null_Base").transform.position
Scale:
point1 = thisComp.layer("Null_Base").transform.position;
point2 = thisComp.layer("Null_Target").transform.position;
scl=length(point1, point2);
[scl, scl]
Rotation:
fromPoint = thisComp.layer("Null_Base").transform.position;
atPoint = thisComp.layer("Null_Target").transform.position;
Pointer3=lookAt(fromPoint, atPoint);
if(atPoint[1]<fromPoint[1]) [Pointer3[1]]-180; else [-Pointer3[1]];
Subscribe to:
Posts (Atom)