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

parameter by layer height/width

$
0
0

Hi,

I am really new to programming for AE so I apologize if this is a stupid question or if it is solved somewhere here.

 

I have a slider and I want it to have the size of the height (or width) of the layer that the plugin is applied to.

Is there a way to achieve this in ParamSetup (PF_Cmd_PARAMS_SETUP)? Or do I have to do it somewhere else?

 

Thank you for your replies

Vasek Divis

 

P.S. I am sorry for my english. I am from Czech Republic and my english is little bit rusty :-)


Has the CC version of the SDK been released?

Visual Studio 2010 with After Effects SDK?

$
0
0

The documentation explicitly references Visual Studio 2008 .NET (version 9.0) SP1 for Windows 7 (64).

 

Is Visual Studio 2010 supported as well?

Make parameter disabled depending on layer type.

$
0
0

Is it possible to make a parameter disabled dependant on the type of layer it is applied to?  For example, if I apply the plugin to a TextLayer can I disable certain params, but enable them if I apply the same plugin to an Image layer?

 

In the SDK, I read, that PF_PUI_DISABLED "Disables (grays out) the parameter, usually in response to PF_Cmd_USER_CHANGED_PARAM" but how would I disable the parameter immediately by checking the type of layer.  I was thinking of using javacript to detect the layer type, but maybe that's too much overhead.  Is there any way to:

 

1.  Programatically fire off PF_Cmd_USER_CHANGED_PARAM

2.  Detect the layer type with the SDK instead of resorting to calling a javascript from within the plugin's code?

 

Thank you for your time and help!

 

Best,
Arie

AEGP_SetCompFlags ?

$
0
0

Hey guys,

There exists AEGP_GetCompFlags() but I can't find AEGP_SetCompFlags() in the SDK Guide.

For instance, how would you do to hide all shy layers in the comp ?

Thanks

How to retrieve a text font, text colour, text size from the text layer?

$
0
0

How to retrieve a text font, text colour, text size from the text layer?

PiPL and code version mismatch warning

$
0
0

Hey, I was hoping someone could help me understand PiPL versions.  I have had some problems with a warning flag when I apply my plugin in after effects, getting a warning flag that says:

 

"effect has version mismatch.  Code version is 2.0 and PiPL version is 2.0 (108600) (25 :: 16)"

 

This is a pretty unhelpful message as 2.0 == 2.0. 

 

I've found I can make the error go away if I dutifully replicate the header and pipl versioning found on the adobe sdk examples, but this is kind of annoying and I'd like to understand it better. 

 

To load without error, my PiPL resource looks like this:

                    AE_PiPL_Version { 2, 0 },

                    AE_Effect_Version { 1048577 } /* 2.0 */

 

and my plugin header looks like this:

#define          MAJOR_VERSION                    2

#define          MINOR_VERSION                    0

#define          BUG_VERSION                    0

#define          STAGE_VERSION                    PF_Stage_DEVELOP

#define          BUILD_VERSION                    1

 

I'm guessing the "code version" the warning refers to is a concatenation of major and minor versions, and it seems the "PiPL version" the warning is reporting comes from AE_Effect_Version (1048577) and NOT AE_PiPL_Version (2,0). 

 

If I change ANY of the values in the plugin header (not just major/minor versions), I get the warning.  So I suspect the AE_Effect_Version number is some kind of a hash of all the version info (major, minor, bug, stage, build versions), and that the warning is a bit misleading. 

 

Can anyone explain more about that number, 1048577?  Is it some kind of hex value?  Thanks!

Put a picture(like .png)into Composition Window .

$
0
0

Hi,everybody!

Firstly,i have to admit that I did a 'stupid' thing...I am trying to do a simple plugin for 'play'...

Now,i am getting in the trouble.  So i come here for some help.

I want to konw how i can let my plugin put a picture(i have edited) into composition window.(like the plugin'Optical Flares', but i just let my plugin put one picture.)

And i can do some simple adjustment(such as width,height,center).

I am puzzled about the code.If someone can provide an example or way,it will be very helpful.

(I am a CS5 user)

 

Thank You!


Allocating Memory for a System Class (Avoiding new/delete)

$
0
0

My plugin has been crashing a lot, but only in Windows. I've figured out that the culprit is in my code for setting up a bitmap for GDI+ drawing.

 

The code I'm using is:

 

...

Bitmap *tempImg = NULL;

try {

  tempImg = new Bitmap(width, height, bitmap_bytes_per_rowL, PixelFormat32bppPARGB, reinterpret_cast<BYTE *>(bitmap_dataP));

} catch (A_long &e) {

  return PF_Err_OUT_OF_MEMORY;    // Assuming...

}

if(tempImg != NULL) {

  canvas = Graphics::FromImage(tempImg);

  delete tempImg;

}

 

In this case, bitmap_bytes_per_rowL has been calculated earlier, and bitmap_dataP points to properly allocated memory (via host_new_handle()) where the drawing will happen. tempImg is a Windows GDI+ Bitmap object, which is solely used to create the Graphics object 'canvas'. Once it's served its purpose it's deleted.

 

I'm 99% sure this is the cause of my crashes. It doesn't crash all the time, and is more likely when the code is compiled in release mode.

 

So, I've two options:

- Allocate memory for the Bitmap object using host_new_handle(sizeof(Bitmap)), then lock & cast the handle to get a pointer to my bitmap object. Problem there is, how do I initialise it, since I'll no longer be using the 'new' keyword?

- Create my Graphics object 'canvas' without first creating a Bitmap object. This would be my preferred method, however the only other way to create a Graphics object is via a HDC or HWND, neither of which I know how to access, and then how do I associate my (actual) drawing memory?

 

Thanks for any tips!

 

Christian

Can my plugin detect whether or not we're in a Linearized working space?

$
0
0

I would like my plugin to be able to detect if the user has checked 'Linearize working space' in the project settings.

 

Is this possible? and if so, how do I access that information?

 

cheers,

-Gareth

How do I use RGBtoHLS for PF_PixelFloat?

$
0
0

I was trying to reach the PF_ColorCallbacksFloatSuite1, but I couldn't get to it either via in_data->utils (the colorCB accepts only PF_Pixel) nor via AEGP suites.

 

Any help would be appreciated.

Project files crash after adding new parameters to an effect plugin

$
0
0

Hi There,

 

As I was developing an effect, I built projects to test things out.  Now, however, I added a new parameter to an effect and when I open the projects that contain the old build of the same effect, I get the following three error messages:

 

1.  After Effects warning: effect control conversion required in effect "Test Plugin".  Some effect controls will be reset.  To avoid silently resetting these same effect controsl on all subsequently loaded projects, save this project and then quit & re-launch After Effects. (25 :: 0)

 

2.  After Effects error: missing data in file. (33 :: 4)

 

3.  After Effects warning: your project file is apparently damaged (skipped sections: 3).  Please save using a different name.  (26 :: 0)

 

Why does this happen, and what can I do, if anything, to avoid this from happening.

 

Thanks for your time and help!

 

--Arie

Full Size Layer

$
0
0

Hello,

 

What i am trying to do:

I am trying to render some distance functions from an alpha channel.

For that i run a distance transform on the alpha channel.

 

The problem:

when composition size is smaller than the layer size, after effects decides in preRender stage of smart render, to give me an input request of : composition size + 20 % more pixels.

The max_result_rect is the size of the layer... fine.

But when i do my  checkout of layer pixels in smartrender, i get only a portion of the input layer equivalent to composition size + 20% more pixels.

ERR(extraP->cb->checkout_layer_pixels(in_data->effect_ref,   IN_LAYER, &input_worldP));

 

 

This can be enough... but not always, depending on my distance function i may need the FULL layer.

So I read the SDK guide and it says that i should specify the region i need in rendering at prerender stage.

So i tried something like:

static PF_Err

PreRender(

    PF_InData            *in_dataP,

    PF_OutData            *out_dataP,

    PF_PreRenderExtra    *extraP) {

 

    PF_Err err = PF_Err_NONE;

 

    PF_RenderRequest req = extraP->input->output_request;

    PF_CheckoutResult in_result;

    AEGP_SuiteHandler suites(in_dataP->pica_basicP);

    //TODO: optimize to make it visible data + threshold

    PF_LRect fullLayer = {0, 0, in_dataP->width, in_dataP->height};

    UnionLRect(&fullLayer, &req.rect);

    ERR(extraP->cb->checkout_layer(    in_dataP->effect_ref,

                                    IN_LAYER,

                                      IN_LAYER,

                                    &req,

                                    in_dataP->current_time,

                                    in_dataP->time_step,

                                    in_dataP->time_scale,

                                    &in_result));

  

    UnionLRect(&in_result.result_rect,         &extraP->output->result_rect);

    UnionLRect(&in_result.max_result_rect,     &extraP->output->max_result_rect);

  

    return err;

}

 

 

Then i get an error at execution, telling me that output rect can not be bigger than input->output_request...

How am i supposed to tell After effects that his rough evaluation of what pixels i need in the input layer is NOT big enough?

 

 

It seems obvious to do ... but i tried to modify the rect... nothing worked to give me after the checkout the full size layer i need...

 

If anyone can point my mistake i would be happy

Flattening Data for Sequence Data & Arbitrary Data, is this so different from serializing data?

$
0
0

Howdy folks,

 

I have an effect plugin that needs to store persistent data.  I've read all the forum threads I could find discussing flattening/unflattening data, the SDK sections discussing this, as well as many external sites  discussing serializing data.   I've got a few questions, they aren't explicitly SDK related, so sorry in advance if this ends up being a bit broad.

 

It seems to me, that flattening data is essentially the same task as serializing data.  I'm using STL vectors to store data while my effect is doing its thing.   Obviously these cannot be stored/flattened due to their internal structure and use of pointers.  My current plan is to convert my data struct to JSON text, reserve a handle of proper size for the JSON, and memcopy the JSON data into the reserved memory space.

I'm sure there will be a performance hit when converting my data struct to JSON (and vice versa) but I found a terrific little JSON library that handles most of the work for me. 

Is this a terrible idea? 

I've read that Boost has a good serialization library, have people used it for the task of flattening/unflattening data in effects plugins?

 

Finally, my really stupid question:

In the SDK example of flattening data, they show an example where the sequence data struct contains a char pointer.  When they flatten the data, they use a different struct that has replaced the char pointer with a char array of a fixed size.  If I wanted to do something similar, how would one actually go about doing this when a portion of the struct has an arbitrary size (IE: the number of elements in my vector changes depending upon user settings, its parent layer, and other factors).  It seems to me that you have to do all the legwork of serializing data to accomplish this task (unless you set the fixed size of the flattened data array to be bigger than any user will ever need, which sounds like a bug/error waiting to happen).

 

thanks!

-Andy

Maybe a Subpixel-Rendering problem ?

$
0
0

Hallo there,

 

i’ve managed successfully to programm a Lens-Distortion Plugin, using the Skeleton Template as a base.
So far, every function from this Plugin is functioning like it should be. The single problem that I have, is that the Image is like “Pixelated“ on the edges maybe a Subpixel-rendering or antialiasing problem.
This can be seen at example foto down here. 1 is the original image and the 2 foto is the distorted image with my plugin. The subpixeling is really on each corner of the box.

I thought first, that i was rounding the variables, but i’ve checked my algorithmus and am using doubles for the parameters, so it can’t be round.

subsample.jpg
Do you have any Idea, what i am missing ?

 

Thanks in advanced,
Boban

 

 

 

The main function looks like this:

 

static PF_Err

MySimpleGainFunc16(

void    *refcon,

A_long    xL,

A_long    yL,

PF_Pixel16  *inP,

PF_Pixel16  *outP)

{

  PF_Err        err = PF_Err_NONE;

  DistInfo      *giP = reinterpret_cast<DistInfo*>(refcon);

  AEGP_SuiteHandler  suites(giP->in_data.pica_basicP);

  PF_FpLong      tempF = 0;

  PFBarrelCommon    *barrel = NULL;

  PF_Fixed      new_xFi = 0, new_yFi = 0;

  double        offset_x_ = 0, offset_y_ = 0;

 

  double        //GUI PARAMETERN

    c3_ = giP->low,    // Low Order par

    c5_ = giP->high,  // High Order par

    xp_ = (double)((giP->centerX)),  // Lens center X

    yp_ = (double)((giP->centerY)),  // Lens center Y

    in_width_ = giP->orig_width,      // Undistored x giP->footage_width;

    in_height_ = giP->orig_height,      // Undistored y giP->footage_height;

    orig_width_ = giP->orig_width + giP->footage_width,      // Undistored x giP->footage_width;

    orig_height_ = giP->orig_height + giP->footage_height,

    squeeze_ = giP->anaS,  // Ana... Squezze

    invSqueeze_ = 1 / squeeze_,

    f1 = orig_width_ / in_width_,

    f2 = orig_height_ / in_height_;

 

  Point2

    DistortPoint = Point2(1, 1),

    UnDistortPoint = Point2(1, 1),

    C3C5_ = Point2(c3_, c5_),

    outputAbsCent = barrel->calcAbsCent((float)xp_, (int)orig_width_, (float)yp_, (int)orig_height_),

    absCent_ = barrel->calcAbsCent((float)xp_, (int)in_width_, (float)yp_, (int)in_height_);

 

    offset_x_ = absCent_.x - outputAbsCent.x,

    offset_y_ = absCent_.y - outputAbsCent.y;

 

  Point2

    pt_ = Point2(((double)xL_*f1 + offset_x_), ((double)yL_*f2 + offset_y_)),

    norm_ = barrel->calcNorm((int)in_width_, (int)in_height_);

 

      switch (giP->distortion_mode)

        {

        case DM_DISTORT:

          DistortPoint = barrel->PFBarrelCommon::solveDistort(C3C5_, absCent_, squeeze_, invSqueeze_, norm_, pt_);

          break;

        case DM_UNDISTORT:

          DistortPoint = barrel->PFBarrelCommon::solveUndistort(C3C5_, absCent_, squeeze_, invSqueeze_, norm_, pt_);

          break;

        default:

          break;

      }

  new_xFi = (A_long)(DistortPoint.x) << 16;

  new_yFi = (A_long)(DistortPoint.y) << 16;

 

  ERR(suites.Sampling16Suite1()->subpixel_sample16(giP->in_data.effect_ref,

    new_xFi,

    new_yFi,

    &giP->samp_pb,

    outP));

  return err;



Programmatically uncheck PF_Param_CHECKBOX UI element in Premiere Pro

$
0
0

Hi


I'm using the following sample in VS2013:


"..\Adobe_After_Effects_CC_2014_Win_SDK\Examples\UI\Supervisor\Supervisor.cpp"

 

static PF_Err UserChangedParam(...)

{

    // If checkbox is checked, change slider value to 50 and flip checkbox back off

    ....

    params[SUPER_CHECKBOX]->u.bd.value = FALSE;

   

    AEGP_SuiteHandler suites(in_data->pica_basicP);

    ERR(suites.ParamUtilsSuite3()->PF_UpdateParamUI(in_data->effect_ref, SUPER_CHECKBOX, params[SUPER_CHECKBOX]));

    ....

}


Flipping checkbox back off works fine in After Effects but not in Premiere Pro (I'm using Adobe Premiere Pro CC).


Does anyone know how to programmatically uncheck a checked checkbox in Premire Pro?

 

Many thanks

Announcement.

$
0
0

any tips and tricks are welcome. :-D

puzzi03.jpg

iterate

$
0
0

Hi

I am having some problems with the iterate function.

 

I am using the function to iterate over all pixels of my output and draw a wave pattern. However I am sometimes getting horizontal sections that are not rendering. See attached example.

 

I'm finding this really hard to debug as it only happens occasionally. If I clear my cache then the frame rerenders and is fine also if I turn Fast Previews from Adaptive resolution to Off (Final Quality) then the issue goes away. I wondered if it is some optimisation gone bad when scrubbing or incomplete frames being saved to the cache. If I render to a movie file the missing lines are still there.

 

Actually looking again at the attached example I could imagine that the image has been split into 4 horizontal strips to be processed in 4 threads and the rendering has been interrupted before it has completed.

 

Has anyone seen this kind of behaviour before or know how I can fix it?

 

Phil

 

How to replace image on layer use After Effect API

$
0
0

Greetings everyone,

 

I have a one big problem, me need to replace image on layer use After Effect API.

Will create a new footage with my new image:

AEGP_FootageH footageH = NULL;

ERR(suites.FootageSuite5()->AEGP_NewFootage(S_my_id,

   psd_path,

   &key1,

   NULL,

   FALSE,

   NULL,

   &footageH));

 

  AEGP_ItemH layer_itemH = NULL;

  ERR(suites.FootageSuite5()->AEGP_AddFootageToProject(footageH, new_folderH, &layer_itemH));

 

Then I have a footage handler footageH

and handler of my layer with old exists image.

AEGP_ItemH itemH.


Please

How to replace exists image on my layer ?

I not founded nothing in the Google, Documentation and Examples.

API for 3D Camera Tracker?

$
0
0

Is there an API which can invoke 3D Camera Tracker for a composition containing video item? I am open to use any of the architectures - ExtendScript SDK or C++ based plugin SDK.

I browsed through developer guides for both the SDKs but no luck. I am working on a Windows machine, so tools like Quartz Composer isnt an option which are purely mac based.

Is there any other tool say, Pixel Blender, that can help me achieve 3D Camera Tracking?

Viewing all 73444 articles
Browse latest View live


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