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

Saving fixed pixel locations in presets and subsequently comparing those pixels.

$
0
0

Hello world.

 

I am abolutely new to plugin development and have been ploughing through the SDK and sample projects thus far, but I had a few questions about the approach with respect to what I wish to achieve and thought it would be best to pick the brains of everyone here.

 

I need to compare frames from a source video to a sample image which I shall call the target. I found how to do this using the Checkout example as well as the tutorial over at Mactech. However, the problem gets complex where I need to compare only fixed pixels from the source frame to certain fixed pixels in the target image. To give a better insight, I believe I should describe the problem statement a little better.

 

Scenario:

 

A user saves a target image along with the fixed pixels for comparison as a preset. The user also chooses the fixed pixels in a test source frame and saves this as well. The plugin takes the source video and the preset as an input and compares the fixed pixels to the target pixels. By 'compares' I mean some complex math would be performed in the CIE Lab space, but that is a discussion for later, and I'm taking this one step at a time.

 

Can someone please guide me as to how to set up this system to start with?

 

In short:

1. How do I store the x and y's of the fixed pixels in the source test frame and target as 2 presets? Possibly a custom data structure that would be bundled with the image?

2. How do I then access these and iterate only over those fixed pixels in a source frame and target image?

 

I am sorry if these are ridiculous questions, but I've been reading for a while and don't seem to be able to find these answers myself.

 

Thanks,

Chirag


Arbitrary / Sequence Data questions

$
0
0

Hey guys. I have a couple of questions.

 

1. SEQUENCE DATA. I read on this forum that the sequence data is not added to the undo/redo stack. Is that true, or is there any way to do that? I tried many different ways, including making changes inside the undo group, but I failed.

 

2. ARBITRARY PARAMETER. If there's no way to add the sequence data to the undo/redo stack I have a question about the arbitrary parameters, because I don't really get them.

 

2.1 I added an arbitrary parameter like this (is it a correct way to do that?):

    AEFX_CLR_STRUCT(def);

    PF_ADD_ARBITRARY2("Data",

                      0,

                      0,

                      0,

                      PF_PUI_NO_ECW_UI,

                      0,

                      global_data_id,

                      0);

 

2.2 Do I have to add any flags to the global setup to inform my plugin that I use arbitrary parameter? I added this code to my EntryPointFunc:

 

    case PF_Cmd_ARBITRARY_CALLBACK:

                err = HandleArbitrary(in_data,

                                      out_data,

                                      params,

                                      output,

                                      reinterpret_cast<PF_ArbParamsExtra*>(extra));

                break;

but it's never called, that's why I asked about the flags.

 

2.3 Read/write to arbitrary. I created this structure, my arbitrary parameter was created to be an array of chars:

typedef struct

{

    char data[1000];

} arbDataStruct;

 

I write data to the arbitrary parameter like this:

 

    PF_Err err = PF_Err_NONE;

    AEGP_SuiteHandler    suites(in_data->pica_basicP);

 

    PF_Handle arbH = suites.HandleSuite1()->host_new_handle(sizeof(arbDataStruct));

    arbDataStruct *arbData = reinterpret_cast<arbDataStruct*>(PF_LOCK_HANDLE(arbH));

    if (!arbData)

    {

        printf("setArbData out of memory\n");

        err = PF_Err_OUT_OF_MEMORY;

    }

    else strcpy(arbData->data, "lol");

 

    PF_UNLOCK_HANDLE(arbH);

 

and read it like this:

   PF_Err err = PF_Err_NONE;

    AEGP_SuiteHandler    suites(in_data->pica_basicP);

 

    PF_Handle arbH = suites.HandleSuite1()->host_new_handle(sizeof(arbDataStruct));

    arbDataStruct *arbData = reinterpret_cast<arbDataStruct*>(PF_LOCK_HANDLE(arbH));

    if (!arbData)

    {

        printf("getArbData out of memory\n");

        err = PF_Err_OUT_OF_MEMORY;

    }

    PF_UNLOCK_HANDLE(arbH);

 

All I get is junk from the memory...

 

Could you guys help me with that? Thanks in advance!

Dave

Multiple renders slowing my plugin

$
0
0

Hey guys.

I use AE SDK to write a plugin for Premiere. I use my custom renderer to do OpenGL drawings. When I change current frame in Premiere - Render function is called about 30 times (full HD 24fps). Is that normal? I know that Premiere is multiprocessing application but it's just insane - because of that my plugin works really slow - in AE works like a charm. Is there any way to decrease renders number?

PF_PathVertex and AEGP_MaskVertex

$
0
0

Hi!

 

My FX is applied on a layer with 2 Masks;

 

I'm trying to set 2nd Mask's shape according to 1st Mask's shape.

 

I can get vertices values from 1st Mask, but cannot set 2nd Mask's vertices according to them.

(I use: ERR(suites.MaskOutlineSuite2()->AEGP_SetMaskOutlineVertexInfo(mask_Ou tlineH, myIndex, OutVertexP));)

 

I get this error when I try to set the vertices values.

 

'A_Err (AEGP_MaskOutlineValH,AEGP_VertexIndex,const AEGP_MaskVertex *)' : cannot convert parameter 3 from 'PF_PathVertex' to 'const AEGP_MaskVertex *'

 

How can you convert 'PF_PathVertex' to 'const AEGP_MaskVertex *' ?

 

Any help will be really appreciated, cos' I'm really stucked...

 

Thanx

François

 

PS: I modify x and y values of vertices before trying to set 2nd Mask,

but the problem isn't there, my vertices values are still valid (I checked before asking :-) )

Copying OpenGL pixel data

$
0
0

Greetings everyone,

 

I’ll be straight to the point. I striped down the GLator (Effect plugin example) to copy an OpenGL pixel buffer onto a solid like so:

 

static PF_Err Render(PF_InData *in_data, PF_OutData *out_data, PF_ParamDef *params[], PF_LayerDef *output)

{

       /// Render OpenGL stuff here!

 

       PF_Err err = PF_Err_NONE;

       AEGP_SuiteHandler l_suites(in_data->pica_basicP);

       PF_EffectWorld l_world;

       A_long l_width(output->width);

       A_long l_height(output->height);

 

       AEFX_CLR_STRUCT(l_world);

       ERR(l_suites.WorldSuite1()->new_world(in_data->effect_ref,

              l_width, l_height, PF_NewWorldFlag_CLEAR_PIXELS, &l_world));

 

       PF_Pixel8 *l_data = NULL;

       in_data->utils->get_pixel_data8(&l_world, NULL, &l_data);

       glReadPixels(0, 0, l_width, l_height, GL_RGBA, GL_UNSIGNED_BYTE, l_data);

 

       ERR(l_suites.WorldTransformSuite1()->copy_hq(in_data->effect_ref, &l_world, output, NULL, NULL));

 

       ERR(l_suites.WorldSuite1()->dispose_world(in_data->effect_ref, &l_world));

 

       return err;

}

 

 

The frame is rendered but with 2 major hiccups:

 

1 – The Y of the resulting image is flipped upside-down.

2 – The Red and Alpha channels seem to be swap.

 

Now, I do have a good idea how to solve this manually but I would like to avoid extra memory allocation and/or swapping data unnecessarily to solve these issues.

 

1 – Is there any workaround that would flip the image without touching the layer transformations? (the solution must be transparent to users)

2 – Is there is any way to pass the pixel data as RGBA and/or BGRA to avoid manual swizzling?

 

Important: Since we’re so close to get this working properly, I’d like to find solutions that wouldn’t hit performance at all, if possible!

 

Thx,

Debugging first sample (Skeleton) - should AE exit cleanly?

$
0
0

Hi,

 

I am just getting into the SDK, using CS5.5, VC12 on Windows 8. 

 

I have compiled the Skeleton sample, and got it to load in both AE & PremierePro. I can see the code, set breakpoints & step through it etc.

 

PremierePro works cleanly when I debug, while AfterEffects does not; If I close AE while debugging:

- the sample gets called with commands to say Exit

- there are many threads still running

- a number of exceptions are listed in the output window

 

First-chance exception at 0x000007FDBD20811C in AfterFX.exe: Microsoft C++ exception: dvacore::threads::`anonymous namespace'::ThreadedWorkQueue::TerminateThreadException at memory location 0x000000002341FE10.

 

 

'continue' is greyed in the debugger, all I can do is 'break all' or 'stop debugging'. This is not a massive impediment to progress, but a bit worrying as a) I imaging in some respects the AE environment is being left dirty and b) does not bode well for when I actually need to do some proper debugging.

 

 

Is this a common issue? Any suggestions for setting I need to set to allow a clean exit for AE?

 

Thanks for any suggestions.

Pipltool question

$
0
0

Hi,

I am trying to develop a plugin and I use the CS4 sdk and After Effects CS4 9.00.346 (I know it is old, but the trial version of CS6 did not start, and chatting with the help desk was really painful and unsucessfull)

 

My .r file is taken from the Skeleton example and includes the "AE_EffectVers.h" Header.

The pipltool.exe fails with the following error: "Line #6 Undefined Symbol AEFX_API_SUBVERS, line 6" in AE_EffectVers.h.

This line looks like this:

#define AEFX_API_SUBVERS      ' '

 

Did anyone stumble across this error and can provide a solution, please?

What sdk function maps to Layer.applyPreset(); i.e i need to apply a preset to a layer from plugin

$
0
0

Hi,

I am new to writing plugins. I want to implement the script funtion Layer.applyPreset using AEGP_ methods . I can already run the sript using AEGP_ExecuteScript. But was wonderging if there is a native method to do it.

 

Regards,

Victor


Trouble getting compiled samples to run

$
0
0
Hello,

I'm new to the after effects sdk but not to programming or sdk usage in general, but I'm having trouble getting the samples to work.

- I've got Creative Suite 3 production premium
- I've got After Effects cs3 sdk
- compiled using visual studio 2005

Seems to compile ok, but when running nothing seems to happen in most cases. In some cases I do get an error message (such as in easycheese) it returns the following error: "After Effects error: AEGP magic error (5017::10)"

I looked up magic number in the docs and the only reference I could find to it simply said something to the effect of "don't change it".

I've got a working script and an idea for a second project, both of which I'd like to implement using the sdk, but I can't seem to get past this first obstacle. Any help, that anyone could provide would be greatly appreciated.

Serious sequence_data bug in Premiere CS3

$
0
0
My effect has a custom UI and displays data computed when rendering that I store in sequence_data. This works with no problem in After Effects 6, 6.5, 7, and CS3, as well as Premiere Elements and Premiere Pro 1.0, 1.5, and 2.0. But it does not work in Premiere Pro CS3.

I have traced it to the fact that Premiere Pro CS3 has a bug that causes it to not pass the same sequence_data with PF_Cmd_Render as it does with PF_Event_DRAW.

This causes my effect to hang when displaying the custom UI.
I can give you a detailed event sequence if you need it.

Until this bug is fixed, is there any way I can determine I'm running under CS3 to avoid hanging?

AEGP_SetLayerFlag

$
0
0
I'm trying to set layer flag from an AEGP. The flag I'm interested in is Time Remapping.
If I use
ERR(suites.LayerSuite5()->AEGP_SetLayerFlag(current_layerH, AEGP_LayerFlag_TIME_REMAPPING, TRUE));
time remapping is not enabled.

Then I test
ERR(suites.LayerSuite5()->AEGP_SetLayerFlag(current_layerH, AEGP_LayerFlag_TIME_REMAPPING, TRUE));
ERR(suites.LayerSuite5()->AEGP_GetLayerFlags(current_layerH, &layer_flagsP));
if (layer_flagsP & AEGP_LayerFlag_TIME_REMAPPING)
{
suites.UtilitySuite3()->AEGP_ReportInfo(S_my_id, "TR enabled!");
}
the message does not show up.

Other flags such as
ERR(suites.LayerSuite5()->AEGP_SetLayerFlag(current_layerH, AEGP_LayerFlag_SHY, TRUE));
or
ERR(suites.LayerSuite5()->AEGP_SetLayerFlag(current_layerH, AEGP_LayerFlag_COLLAPSE, TRUE));
pose no problem.

I should mention that current_layerH points to a layer that is a comp. I can enable time remapping using
ERR(suites.CommandSuite1()->AEGP_DoCommand(2153));
but I would prefer to avoid it.

Thanks for your help.

How to develop a plugin for After Effects (mac os)

$
0
0

Hi

Apologize my English.

I've a problem. I want to develop a plugin for after effects, but I don't know how I have to do.

I've downloaded the SDK for Mac OS, and i've find there some xbuilder files. This files contains some strange cpp code and it is so cool, but if I press CMD+B to compile, nothing happens. So I select in top-left corner the Mac OS 1.5 SDK and the file .plugin will appear in the build folder.

Now, when I copy that plugin in my after effects plugins folder.. and when I run the program, I can't find the plugin.

 

So, my questions are:

1) How can I start to develop a plugin from zero?

2) What I need to do to make my plugins visible in the plugin drop-down list into the After Effects?

 

Thanks

Sampled Pixel Data is always the same?!?!

$
0
0

I'm trying to build a mosaic-like effect where I sample an area of an image and then fill that area with the sampled color. For some reason ever time I try to sample I get the same color, and I think the color is the first color that it samples. Please help!

how to add dll file in plugin

$
0
0

Hi everybody,

I have a short question concerning the plug-in.
I created a plug-in  using visual studio 2005 for Adobe effect cs4

but i want to add dll on that plugin so,how to add dll in that plugin

 

 

please help me!!!!

Thanks

Is there an event when the comp's color depth/pixel format is changed?

$
0
0

Is there any way I can detect the change in color depth in a composition?
I know I can react differently by calling PF_GetPixelFormat() on render to find out the current bit depth/format, but I was wondering if there is any way to detect and react to the event when a user changes the color depth of the composition manually?
Basically, what I want to do is hide/change parameters in the ECW depending on the bit depth.

Any help appreciated :-)


Why, oh why - question about downsampling ratios

$
0
0

I've been trying to figure this out for quite a while, and I have no freaking idea why this does not work.

 

y = height_percent * in_data->height / 100 + in_data->pre_effect_origin_y * in_data->downsample_y.den / (float) in_data->downsample_y.num;

 

It works perfectly for x. It works perfectly in After Effects, and even works perfectly in Premiere when downsampling is other than full resolution (for 1/2, 1/4 and even 1/16).

 

For full resolution in Premiere Pro it does not work properly. It always adds more, than it should. About 2 times more. When I remove the multiplication for downsampling, it works in full resolution, but does not work in other (understandable).

 

I need one of the 2 things:

 

1. Explanation of how I can make it work for full resolution as well or what I am doing wrong.

2. The exact fraction that Premiere Pro gets for full resolution, so that I can apply a condition that will skip the multiplication if full res. Obviously .num == .den did not work, as it should.

 

I'll be grateful for any help. Thanks.

Bart

Calculations that work in After Effects but not in Premiere Pro

$
0
0

I'm developing another Premiere Pro plugin based on AE effects SDK.

 

The plugin manipulates pixels in a very simple way - based on lift/gamma/gain controls it changes the values as such:

 

colorRGB->blue = PF_POW( colorRGB->blue , gamma) * gain + lift

 

And so on for the red, and green. All in floating point, PF_FpShort. I even tried doing calculations in PF_FpLong, but the results were the same.

 

Later the values can be clipped using MAX and MIN macros.

 

In After Effects everything works perfectly. In Premiere Pro, once certain gamma treshold (less than about 0.5, more than about 1.4) is reached, I start getting weird artifacts. Either green pixels or black squares in random patterns, usually, but not always, corresponding to the darker parts of the image.

 

I have no idea why, and how to correct it.

 

Please help.

 

EDIT: Actually any gamma that is different than 1 results in these weird artifacts, and only in the BGRA_32f mode. BGRA_8u works fine.

Custom dialog window in Premiere Pro

$
0
0

Could you please advice how to create About Dialog(custom dialog) in Adobe Premiere Pro like About Dialog in After Effects. I have searched a lot but could not find the answer. The dialog created via PF_Cmd_DO_DIALOG  is visible in After Effects but is not visible in Premiere Pro.

Thank you.

Setting layer's transform/rotation matrix

$
0
0

Hi All,

I''m working on an AEGP plug-in that needs to keyframe layer's transform. I've got a sequence of 3D rotations stored as quaternions and I'd like to convert it into orientation (or rotation) keyframes. Converting the quaternions to Euler angles is not acceptable in my situation, since due to the multiple possible solutions/angles for the same 'pose', the object flips during animation. The SDK Guide also specifies that Orientation uses quaternion, but I'm not sure how this can help me.

 

Any ideas ?

 

Thanks

 

 

edit: from this thread http://forums.adobe.com/thread/1142672?tstart=30, it looks like what I'm looking for is not possible:

 

(shachar carmi):
neither an effect, nor an AEGP can change the transformation matrix. they can only change the param values.

 

 

Message was edited by: cbmb

Non-technical question about naming conventions used in API

$
0
0

What does the prefix `PF_` stand for in all the function names in the AE SDK?  It's not immediately obvious to me, and was just curious.  I like to have a sense of how the naming conventions came to be when I'm learning new code.

 

Thanks!

Viewing all 73444 articles
Browse latest View live


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