Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Layer Params in Effects

$
0
0
Hi,<br /><br />I don't (want to) know whether I'm too stupid to understand or it's Visual Studio's fault, but I can't seem to get my effect, which uses two layer parameters, to work. <br /><br />I want to compute my output image by taking the single pixel values for red, green and so on and multiplying them by my own rule (additional factors). <br /><br />My problem is, I don't really know how to start the iterate function and how and where to handle the pixel data from both my chosen layers. At the moment, my code looks like this:<br /><br />AllInfo          ai; //which is a struct containing 2 PF_LayerDefs<br /><br />ai.layerleftLD     = params[2]->u.ld;<br />ai.layerrightLD = params[3]->u.ld;<br /><br />ERR(suites.Iterate8Suite1()->iterate(in_data,<br />           0,<br />           (output->extent_hint.bottom - output->extent_hint.top),<br />           &params[0]->u.ld, //Why can't I just put &params[2]->u.ld here, which is equally a PF_LayerDef?<br />           NULL,<br />           (long)&ai, <br />           MyPixelFunc,<br />           output));<br /><br />In MyPixelFunc, I'm trying to access the two layers (just an example):<br /><br />register AllInfo* aiP = reinterpret_cast<AllInfo*>(refcon);<br />outP->red     = aiP->layerleftLD.data->red;<br /><br />And yes, I DO know this could be terribly wrong. After Effects tells me everytime. I can see myself that the problem is that for example params[2]->u.ld contains no data (width and height are 0). What I don't know is WHY. Please help me, I'm still a newbie...<br /><br />Note: would be nice if one of the samples in the next SDK would USE its layer parameter instead of only showing it in the EW... or haven't I seen this one?

Viewing all articles
Browse latest Browse all 73444

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>