• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with explanation of CreatePath() expression

New Here ,
Jun 27, 2021 Jun 27, 2021

Copy link to clipboard

Copied

Pic below is the curvng line l want to make but got stuck understanding the expression.

This line was made using createPath() in a solid layer applied with a thicc stroke effect And with a few keyframes this line can have a nice bounce animation.

截屏2021-06-28 上午9.57.50.png

So l know the oranges nulls are points and green nulls are intangents and outtangents. Each green null parented to the corresponding orange null.

------------------------------------------------------------------------

And here is the expression:

var nullLayerNames = ["White Solid 1: Mask 1 [1.0]","White Solid 1: Mask 1 [1.1]","White Solid 1: Mask 1 [1.2]","White Solid 1: Mask 1 [1.3]","White Solid 1: Mask 1 [1.4]","White Solid 1: Mask 1 [1.5]","White Solid 1: Mask 1 [1.6]"]; 
 
var nullLayerNamesIn = ["White Solid 1: Mask 1 [1.0][In]","White Solid 1: Mask 1 [1.1][In]","White Solid 1: Mask 1 [1.2][In]","White Solid 1: Mask 1 [1.3][In]","White Solid 1: Mask 1 [1.4][In]","White Solid 1: Mask 1 [1.5][In]","White Solid 1: Mask 1 [1.6][In]"]; 
 
var nullLayerNamesOut = ["White Solid 1: Mask 1 [1.0][Out]","White Solid 1: Mask 1 [1.1][Out]","White Solid 1: Mask 1 [1.2][Out]","White Solid 1: Mask 1 [1.3][Out]","White Solid 1: Mask 1 [1.4][Out]","White Solid 1: Mask 1 [1.5][Out]","White Solid 1: Mask 1 [1.6][Out]"]; 
 
var origPath = thisProperty; 
var origPoints = origPath.points(); 
var origInTang = origPath.inTangents(); 
var origOutTang = origPath.outTangents(); 
var getNullLayers = []; 
var getNullLayersIn = []; 
var getNullLayersOut = []; 
for (var i = 0; i < nullLayerNames.length; i++){ 
    try{  
        getNullLayers.push(effect(nullLayerNames[i])("ADBE Layer Control-0001")); 
        getNullLayersIn.push(effect(nullLayerNamesIn[i])("ADBE Layer Control-0001")); 
        getNullLayersOut.push(effect(nullLayerNamesOut[i])("ADBE Layer Control-0001")); 
    } catch(err) { 
        getNullLayers.push(null); 
    }} 
for (var i = 0; i < getNullLayers.length; i++){ 
    if (getNullLayers[i] != null && getNullLayers[i].index != thisLayer.index){ 
        origPoints[i] = fromCompToSurface(getNullLayers[i].toComp(getNullLayers[i].anchorPoint));  
        origInTang[i] = fromCompToSurface(getNullLayersIn[i].toComp(getNullLayersIn[i].anchorPoint)) - origPoints[i];  
        origOutTang[i] = fromCompToSurface(getNullLayersOut[i].toComp(getNullLayersOut[i].anchorPoint)) - origPoints[i];  
    }} 
createPath(origPoints,origInTang,origOutTang,origPath.isClosed());

-----------------------------------------------------------------------

please help l'm dying to know how this expression generate the nice bounce curving line.

TOPICS
Expressions , FAQ , How to , Scripting

Views

1.9K

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
LEGEND ,
Jun 27, 2021 Jun 27, 2021

Copy link to clipboard

Copied

The code you posted hasn't anything to do with the bounce itself. It merely compares the points of a given mask with how many Nulls are available and then associates the Nulls with the mask points. The bounce most likely is some wiggle() expression or similar on the Nulls, so check that.

 

Mylenium

Votes

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
Community Expert ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

LATEST

Not sure how this particular expression works, but if you look for an easy solution to make a path based on nulls with roundedness controls, my "Connect Multiple Layers iExpression offers an easy and powerful solution for that. (iExpressions is a paid extension).

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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