Skip to main content
Known Participant
Dec 1, 2024 12:23 PM UTC
Answered

PF_ParamDef vs PF_LayerDef

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 is closed to new replies. Start a new post to keep the conversation going.
James Whiffin
James WhiffinCorrect answer
Legend
Dec 7, 2024 5:05 AM UTC

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. 

2 replies

James Whiffin
James WhiffinCorrect answer
Legend
Dec 7, 2024 5:05 AM UTC

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. 

Translate
Known Participant
Dec 19, 2024 12:50 PM UTC

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

Translate