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

Expression for opposite position?

Community Beginner ,
Jul 24, 2022 Jul 24, 2022

Copy link to clipboard

Copied

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

Views

162

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

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

...

Votes

Translate

Translate
Contributor ,
Jul 24, 2022 Jul 24, 2022

Copy link to clipboard

Copied

//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.

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

Copy link to clipboard

Copied

LATEST

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

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