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

help with inTangents

New Here ,
Feb 20, 2020 Feb 20, 2020
Hive mind...a bit new to expressions and, well I could be an engineer if i could forgo the maths....
 
I’m having a hard time getting the inTangents and outTangents to work. I have a path with 3 points, and when I add [3] to in tangents and [3] to outTangents I get an error….thoughts?
 
Here is my script…. The first point is attached to a moving null, but the other two aren’t….
 
createPath(points = [thisComp.layer("Watch null").transform.position+thisComp.layer("Particle Motion").transform.position, thisComp.layer("Null 135").transform.position, [1460,0]], inTangents = [], outTangents = [], isClosed = false)
 
my problem is I want the path to have curves and not be linear. I cant figure out what to put in the brackets in the tangents part to make the spline....
 
TIA,
B
 
 
TOPICS
Expressions , Scripting
1.6K
Translate
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
Advocate ,
Feb 20, 2020 Feb 20, 2020

I’m having a hard time getting the inTangents and outTangents to work. I have a path with 3 points, and when I add [3] to in tangents and [3] to outTangents I get an error….thoughts?

 

Arrays start with index 0, not 1. Therefore, when you have 3 elements in the array (inTangents for instance), then the index of the last inTangent is [2], not [3];

Translate
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
New Here ,
Feb 20, 2020 Feb 20, 2020

Thanks Tomas, but lets assume for a minute that i'm an idiot...which I generally am. How do I change my script (referenced in orig post) to account for that?

thx

Translate
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
Advocate ,
Feb 20, 2020 Feb 20, 2020

What about this? Im not sure about values for in/out tangents, as it's specific for every case, but here's a general code, that uses some random tangents.

var watchNull = thisComp.layer("Watch null");
var particleMotion = thisComp.layer("Particle Motion");
var null135 = thisComp.layer("Null 135");

var p1 = watchNull.transform.position.value + particleMotion.transform.position.value;
var p2 = null135.transform.position.value;
var p3 = [1460, 0];
var points = [p1, p2, p3];

var inT1 = [-10, 0];
var inT2 = [-10, 0];
var inT3 = [-10, 0];
var inTangens = [inT1, inT2, inT3];

var outT1 = [10, 0];
var outT2 = [10, 0];
var outT3 = [10, 0];
var outTangens = [outT1, outT2, outT3];

createPath(points, inTangens, outTangens, false)
Translate
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
New Here ,
Feb 20, 2020 Feb 20, 2020
LATEST

Thank you sir....I'll give it a try. Appreciate it.

 

b

Translate
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