Skip to main content
Known Participant
December 1, 2024
Answered

PF_ParamDef vs PF_LayerDef

  • December 1, 2024
  • 1 reply
  • 287 views

Hi everyone!

I'm a newbie AE plugin developer, and I would like someone to shed some light on some confusing things for me. I'm developing a plugin where the user chooses a layer from the composition via UI dropdown.

 

The layer is then checked with PF_CHECKOUT_PARAM before my custom function. I use new_world to reduce the resolution/size so that when I finally use transform_world in my custom function (which is in a loop), it doesn't have to iterate over all the input pixels. (I hope I was clear enough about this and that this is the correct way to go about things.)

In my custom function, I need to PF_CHECKOUT_PARAM again for every iteration (the plugin basically repeats the input, something like motion blur) and access in_data->current_time and similar data. The issue is, I need transform_world to use PF_LayerDef since I'm working with the scaled-down layer from new_world, but I also need to use PF_ParamDef from the layer to get current_time, time_step, etc. The only solution I can think of is to use PF_COPY(&param_def.u.ld, &layer_def, NULL, NULL), but that slows everything down in an unacceptable way (10x slower). Any help would be much appreciated.

This topic has been closed for replies.
Correct answer James Whiffin

Hi Mikik

I think using smartFX and the prerender checkout_layer will be much more performant. You can choose exactly which pixels you need rather than just receiving the entire layers buffer each time. As you mention a motion blur type effect, you can also choose which source time the pixels should be from. 

1 reply

James Whiffin
James WhiffinCorrect answer
Legend
December 7, 2024

Hi Mikik

I think using smartFX and the prerender checkout_layer will be much more performant. You can choose exactly which pixels you need rather than just receiving the entire layers buffer each time. As you mention a motion blur type effect, you can also choose which source time the pixels should be from. 

Known Participant
December 19, 2024

Hi James, thank you very much for your reply! Appreciate it!