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

To get the new position of these layers without using the Motion Track utility?

Engaged ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

Hi all

 

Two compositions Comp1 and Displase have been created in the application
Composition Comp1 contains three layers (Blue Solid 1, Magenta-Red Solid 1, Green Solid 1).

Comp1.png

The Comp1 composition is placed within the Displase composition and the Displacement Map effect is applied to it.

Displase.png

The displacement layer is set to the Gradient layer of the Displase composition.

As a result of applying the Displacement Map effect, the position of the layers (Blue Solid 1, Magenta-Red Solid 1, Green Solid 1) changes.

 

Is there a way to get the new position of these layers without using the Motion Track utility?

 
 
 
 
 
TOPICS
Scripting

Views

87

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 ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

The math is all there already. You could probably use  something like this:

 

mPos=transform.position;
mPoint=mPos.toComp(transform.anchorPoint);

mVal=sampleImage(mPoint,[0.5,0.5]);
mLum=rgbToHsl(mVal)[2];

X=mPoint[0]+effect("Displacement Map")("Max Horizontal Displacement")*mLum;
Y=mPoint[1]+effect("Displacement Map")("Max Vertical Displacement")*mLum;

[X,Y]

 

Haven't  checked it and it's made up from memory, but this is the basic drill should work - multiplying the offset from the map with the map value and adding it to the source value. You may need to add another "correction factor" as displacments tend to not produce the exact value that you dial in due to how all this color math works and of course will need to tweak things for your setup.

 

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
Engaged ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

LATEST

Thanks Mylenium.


I'll try it tomorrow and share the results

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