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

Expression for opposite position?

Community Beginner ,
Jul 24, 2022 Jul 24, 2022

Hey there,

 

I'm trying to create a bezier point rig where the left handle (bez-handle-left) mirrors the right handle's (bez-handle-right) position behavior: when right handle moves right, left handle moves left; when right handle moves up, left handle moves down, etc.

 

I scoured the Internet but didn't have much luck. Tried writing a few options myself too but fear I may be overthinking it.

 

Would appreciate some guidance!

 

Thanks

TOPICS
Expressions
358
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

correct answers 1 Correct answer

Contributor , Jul 24, 2022 Jul 24, 2022
//get information
var centerPos = thisComp.layer("center").position; // parent to "point's position
var otherTangentPos = thisComp.layer("outTangent").position; // parent to other tangent's position

// subtract the center from the other tangent to get a relative offset
var relativeOutTangentPos = otherTangentPos - centerPos;

// flip
var flippedRelative = relativeOutTangentPos * -1;

// add back the center point to get the new position
centerPos + flippedRelative

zsaaro_0-1658692935529.png

Apply this to one of the tangent

...
Translate
Contributor ,
Jul 24, 2022 Jul 24, 2022
//get information
var centerPos = thisComp.layer("center").position; // parent to "point's position
var otherTangentPos = thisComp.layer("outTangent").position; // parent to other tangent's position

// subtract the center from the other tangent to get a relative offset
var relativeOutTangentPos = otherTangentPos - centerPos;

// flip
var flippedRelative = relativeOutTangentPos * -1;

// add back the center point to get the new position
centerPos + flippedRelative

zsaaro_0-1658692935529.png

Apply this to one of the tangents, and parent to the center point and the other tangent at the top of the expression.

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
Community Beginner ,
Jul 24, 2022 Jul 24, 2022
LATEST

Incredible, thanks so much! Appreciate the comments on each line too, nice to know how everything works together.

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