How to get position of checked out layer in composition coordinate space?
I'm implementing an effect that has a layer parameter and blends the image from that layer with the layer that the effect is applied on:
- The effect is applied on LayerA which is 1920x1080
- The effect's layer parameter is set to LayerB which is 800x600
Everything works except that the image coming through the layer parameter (LayerB) is always positioned at the top left corner of LayerA, regardless of where I positioned LayerB in the composition.
When I call checkout_layer() during PF_Cmd_SMART_PRE_RENDER, the returned result_rect rectangle has the correct dimentions (800x600) but the top and left fields are always set to zero, regardless where I positioned LayerB.
Interestingly, if I create a Shape layer instead of importing an image from disk, I observe that checkout_layer() returns correct values for top and left fields of result_rect and I get the result that I expect.
What do I need to do to get the position of a layer passed via layer parameter, when the source of that layer is an image that I imported from disk?
Thank you!
