Checking out image layer works but pre-comp layer does not
Hi gang;
I am pulling my hair out trying to solve this seemingly simple issue.
My plugin checks out a layer, and transforms it elsewhere using Transform_world. If the layer I check out is an imported image (circle.png) or an After Effects shape, it works correctly as expected. However, if I make a new comp, draw a circle, and then checkout that pre-comp as my layer, it does not. It simply outputs black.
Please take a look at my code:
First I check out my layer:
AEFX_CLR_STRUCT(checkoutLayer);
ERR(PF_CHECKOUT_PARAM(in_data,
SKELETON_PLAYER,
(in_data->current_time* in_data->time_step),
in_data->time_step,
in_data->time_scale,
&checkoutLayer));
ERR(PF_ABORT(in_data));
If the checkout layer has data (if checkoutLayer.u.ld) then I create a world for it:
ERR(suites.WorldSuite1()->new_world(in_data->effect_ref,
checkoutLayer.u.ld.width,
checkoutLayer.u.ld.height,
flags,
&particle_world));
ERR(PF_ABORT(in_data));
Then I copy the checkout layer to my newly created world:
ERR(suites.WorldTransformSuite1()->copy_hq(in_data->effect_ref,
&checkoutLayer.u.ld,
&particle_world,
NULL,
NULL));
ERR(PF_ABORT(in_data));
And finally, after setting up my transform_world matrices, calculating them, and other Transform_world setups, I output:
PF_Rect dest;
dest.bottom = in_data->height;
dest.left = 0;
dest.right = in_data->width;
dest.top = 0;
err = suites.WorldTransformSuite1()->transform_world(NULL,
quality,
PF_MF_Alpha_STRAIGHT,
PF_Field_FRAME,
&particle_world,
&mode,
NULL,
&mat1,
1L,
true,
&dest,
output);
And after that destroy the world:
ERR(PF_ABORT(in_data));
ERR2(suites.WorldSuite1()->dispose_world(in_data->effect_ref, &particle_world));
So, like I said, this works perfectly well if my layer is an image layer that has been imported. But if the layer is a comp that I made with a shape, it does not.
I should also say that if I create a shape in my main comp, and use that as my checkout layer, it also works correctly. So it is specifically pre-comps that aren't working. I also tried enabling and disabling the collapse transformations to see if that would make any difference.
Any ideas what I'm doing wrong?
Thanks,
-Rich
