Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Layer Params in Effects

New Here ,
Jun 06, 2007 Jun 06, 2007

Copy link to clipboard

Copied

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?
TOPICS
SDK

Views

4.7K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2007 Jun 07, 2007

Copy link to clipboard

Copied

Sorry, forget it. I just forgot to checkout the layer params. Anyway, it isn't too intuitional to find that information in the path chapter of the SDK's documentation...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 22, 2007 Jun 22, 2007

Copy link to clipboard

Copied

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.

I always like to blame the compiler first. ;)

Agreed, it's not made terribly obvious throughout the documentation.

During PF_Cmd_RENDER, your input layer is always there; any other layer params need to be checked out.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2007 Jul 24, 2007

Copy link to clipboard

Copied

I guess it's not the nicest way to place my user under disabilty, but can AEGPs somehow manipulate the layer param of an effect? I have already got the streamvalue, but as I see it there's nothing useful in it and I have no idea how the PF_EffectWorld on which the layer param points is encrypted there, and even less clues about how I could change this value to another layer...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 01, 2007 Aug 01, 2007

Copy link to clipboard

Copied

The stream value is an index into the comp's layers.

While it's possible to manipulate effects' layer params from within an AEGP, it's not recommended (users won't be expecting it, and surprising users increases your tech support load).

What's your AEGP trying to accomplish by manipulating an effect's layer param?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2007 Aug 08, 2007

Copy link to clipboard

Copied

Ok, I agree it would puzzle users. But, well, I would not need a layer param at all if I could somehow set the PF_EffectWorld source data for my Iterate-Function in Render to a layer I specify myself (supposed my effect plug-in already knows the AEGP_LayerH of a nice little layer to work with). Can I do that anyhow?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2007 Aug 13, 2007

Copy link to clipboard

Copied

By the way, I am a little bit puzzled where the values for time_scale and time_step, that in_data contains, come from... Why has my normal 25fps Comp a time scale of 3200 and steps of 128? I mean... it's alright, we come down to 25 by division anyway... but why these values?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 23, 2007 Aug 23, 2007

Copy link to clipboard

Copied

> ...why these values?

AE probably needed to do some math to get a lowest common denominator...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 16, 2007 Oct 16, 2007

Copy link to clipboard

Copied

Just in case somebody is interested how it DOES work to give your effect any layer of your comp as input (without layer params):

Create a new PF_EffectWorld.
Get the AEGP_LayerH of the Layer you want.
Get this layer's AEGP_ItemH.
Get a new AEGP_RenderOptionsH for this item.
Set the RenderOptions' time to current time (or whichever you want).
RenderAndCheckoutFrame... GetReceiptWorld... FillOutPFEffectWorld... CheckinFrame... Dispose(RenderOptions).

There you go with a nice EffectWorld of your own! (Disposing the AEGP_WorldH and the PF_EffectWorld in the end is tricky and doesn't seem to work for me...)

Have fun with it, I already do!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2007 Nov 06, 2007

Copy link to clipboard

Copied

i need to be straight on this: how can i get an AEGP_LayerH from a PF_LayerDef ? I have already tried a number of things, but i always get stuck... i think the solution might be on the AEGP_GetLayerFromLayerID ... but i cant figure out what is the AEGP_LayerIdVal (i know the documentation says it is what i get when i get an effect parameter stream, but in that case, wouldnt i need a LayerH ?)

thank you!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 08, 2007 Nov 08, 2007

Copy link to clipboard

Copied

This should work:

AEGP_GetNewEffectForEffect(your_effect_id, in_data->effect_ref, &your_effect);
AEGP_GetNewEffectStreamByIndex(your_effect_id, your_effect, LAYER_PARAM_NUMBER, &stream);
AEGP_GetNewStreamValue(for this stream... on streamval);

streamval.val.layer_id should contain the layer id then. Then simply do AEGP_GetLayerFromLayerID. Alright?

PS: Don't forget to dispose them all.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 05, 2007 Dec 05, 2007

Copy link to clipboard

Copied

Nicely put, dirtyDavey.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 22, 2008 Nov 22, 2008

Copy link to clipboard

Copied

Ok. This looks promising...

I have an effect plugin. I want to retrieve a Layer Param's frame from Comp Time zero (and other comp-time values).

PF_Checkout_Param(time,time,time) is in current-layer time of course.

Is there a way to find out "this layer's inpoint"? Then I could just subtract it to get comp time.

The recipe above to get AEGP_LayerH looks promising! LayerH had just what I need. But what is my own effect_id?

Any help or tips appreciated! Thanks.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 22, 2008 Nov 22, 2008

Copy link to clipboard

Copied

LATEST
Oh, I'm a dork. InterfaceSuite makes it easy, just find compTime for effectTime=0.

(In case anyone's ever grepping for layer in point inpoint comp time comptime layer time in an effect plugin, to convert effect time to comp time.)


A_Time compTime;
{
PF_Err err;
AEGP_PFInterfaceSuite1 *interfaceSuite = 0;
err = ACQUIRE_SUITE(kAEGPPFInterfaceSuite,kAEGPPFInterfaceSuiteVersion1,&interfaceSuite);
if(err) return err;

err = (*interfaceSuite->AEGP_ConvertEffectToCompTime)(in_data->effect_ref,0,1,&compTime); // our comp in-time
if(err) return err;

RELEASE_SUITE(kAEGPPFInterfaceSuite,kAEGPPFInterfaceSuiteVersion1);
}

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines