Skip to main content
benp1711322
Inspiring
October 26, 2019
Question

SmartFX check out other multiple layers' pixels

  • October 26, 2019
  • 1 reply
  • 719 views

I am trying to smartify my plugin. The plugin takes other layers' pixels, selected from a layer param, to put a resized copy of the source layer where the user wants. (Well, that's the gist, anyway). 

 

Now I am making the plugin Smart FX (everything else is working fine. But I am lost in the business of checking out layers from layer params. 

 

I seem to be able to do this, no problem: 

 

extra->cb->checkout_layer(	in_data->effect_ref,
				LAYERPARAM,
				ID,
				&req,
				in_data->current_time,
				in_data->time_step,
				in_data->time_scale,
				&in_result);

 

I can check in_result, and see my layer. 

 

But in smartRender when I try to do this...

 

PF_EffectWorld	*thePixels = NULL;
extra->cb->checkout_layer_pixels(in_data->effect_ref, ID, &thePixels);

 

...thePixels remains NULL. 

 

Am I supposed to be doing something with in_result? I cannot see in the examples anything that matches my use case. I had assumed that I only needed the ID to match in pre-render and smart render for the pixels to be obtained. 

 

 

 

 

This topic has been closed for replies.

1 reply

benp1711322
Inspiring
October 26, 2019

What would be really helpful here is a SmartFX version of the Checkout sample project. 

 

 

 

 

benp1711322
Inspiring
October 27, 2019

It seems the problem may have been that I was calling extra->cb->checkout_layer_pixels after calling extra->cb->checkout_output. 

 

However, now it seems I'm getting zero dimensions on the checked out layers. As far as I can tell, I need to specify the size of the layer before checking it out. I can do this manually for my test case, but there seems to be no way of interrogating a layer to find out the dimensions of its source.