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

SmartFX Rects and extents

$
0
0

I'm currently making an effect plugin that works similar to the "blur" effect in which it is capable of checking out a larger area of the underlying layer than immediately encapsulated by the effect bounds. An example of this is seen with some of the "blur" effects being able to checkout pixels that are larger than the width of the original layer seen below:

 

wzivSS7.gif

 

Here the blur effect is applied to an adjustment layer, and it is able to "blur" and retrieve pixels outside of the original layer bounds. At some point in its SmartFX routines, it is using the blurriness value to anticipate that it is to grab pixels outside of the layer's immediate width and height.

 

What I am uncertain about is how I would manage to grab these "expanded" pixels and recreate them in full-sized output-world?

Currently I figure the SmartPreRender code would look something like this to, to tell after effects that I want to take the bounds of the entire layer, plus an additional "width":

...
Intensity.x = Intensity.y = (some value)
Intensity.x *= in_data->downsample_x.num / static_cast<glm::float32_t>(in_data->downsample_x.den);
Intensity.y *= in_data->downsample_y.num / static_cast<glm::float32_t>(in_data->downsample_y.den);

PF_RenderRequest ExpandedRequest = Request;
ExpandedRequest.rect.left -= Intensity.x;
ExpandedRequest.rect.right += Intensity.x;
ExpandedRequest.rect.top -= Intensity.y;
ExpandedRequest.rect.bottom += Intensity.y;


ExpandedRequest.field = PF_Field_FRAME;
ExpandedRequest.preserve_rgb_of_zero_alpha = true;
ExpandedRequest.channel_mask = PF_ChannelMask_ARGB;

// Checkout input layer
PF_CheckoutResult Result;
err = extra->cb->checkout_layer(     in_data->effect_ref,     ParamID::Input,     ParamID::Input,     &ExpandedRequest,     in_data->current_time,     in_data->time_step,     in_data->time_scale,     &Result
);


Result.result_rect.left -= Intensity.x;
Result.result_rect.right += Intensity.x;
Result.result_rect.top -= Intensity.y;
Result.result_rect.bottom += Intensity.y;


// Trim to request rectangle
Result.result_rect.top = glm::max(Result.result_rect.top,Request.rect.top);
Result.result_rect.bottom = glm::min(Result.result_rect.bottom, Request.rect.bottom);
Result.result_rect.left = glm::max(Result.result_rect.left, Request.rect.left);
Result.result_rect.right = glm::min(Result.result_rect.right, Request.rect.right);

Output->flags = PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;
Output->result_rect = Request.rect;
Output->max_result_rect = Request.rect;

But after doing this, if I am even doing it correctly, how would I properly re-position the checked out input into the output effects world? Is there a better way to calculate this kind of offset? What I am actually doing in the effect is using a multi-threaded iterator which samples from the input multiple times and produces one output pixel, similar to a blur effect on an adjustment that would be able to sample extra pixels of the layers below it and farther than the immediately overlapping region.

To simplify the situation, what if I was simply copying the immediately overlapping "chunk" into the full-sized output effects world?

// Checkout Input and Output
PF_LayerDef* Input;
PF_LayerDef* Output;

err = extra->cb->checkout_layer_pixels(     in_data->effect_ref,     ParamID::Input,     &Input
);

err = extra->cb->checkout_output(     in_data->effect_ref,     &Output
);
...
// Fill output effect-world with blank pixels, etc etc
...
// Intersection of input clipped by output rect
PF_Rect OutputWindow = Input->extent_hint;
OutputWindow.top = glm::max(OutputWindow.top, Output->extent_hint.top);
OutputWindow.left = glm::max(OutputWindow.left, Output->extent_hint.left);
OutputWindow.bottom = glm::min(OutputWindow.bottom, Output->extent_hint.bottom);
OutputWindow.right = glm::min(OutputWindow.right, Output->extent_hint.right);


// Region of input that we're actually using??
PF_Rect InputWindow = Input->extent_hint;
InputWindow.left = Input->origin_x;
InputWindow.top = Input->origin_y;
// Not sure how to properly re-calculate this

suites.WorldTransformSuite1()->copy_hq(     in_data->effect_ref,     Input,     Output,     &InputWindow,     &OutputWindow
);

How to edit AF files without open After Effects application

$
0
0

Hello, guys.

 

I am trying to edit aep files without opening After Effects application? ,by CMD command or SDK whatever...

My concern is that I open aep files without opening After Effects application.

and then run some jsx scripts then save and close the files. And after that, I render them out.

The whole process what I need is not to open the application.

Is there anyone knows this task?

 

Thanks.

checkout different layer

$
0
0

     hi,everyone!

     I'm now facing a problem about checkout different layer data. I have read the example project "checkout",and I can get frames of a video in different time using PF_CHECKOUT_PARAM. In this example, I also see a function PF_CheckoutLayerChannel which can get the data PF_ChannelChunk chunk, but I know little of PF_ChannelChunk from the After_Effects_SDK_Guide, so as the datatype PF_ChannelRef and PF_ChannelDesc. What I want to do is input two different videos in AE and get the correspondding frames of them seperately, How can I do it ?

     Any suggestions are welcome!

     Thank you!

composite_rect (and general compositing question.)

$
0
0

I have finally gotten over the major humps for my plugin, and I've run into something which I suspect is "expected behavior" and I would like to read up on it.

the problem is: I have no search terms for it.

 

in a nutshell, my plugin takes a source layer, and comps it in straight lines between three points (see image)

the plugin uses the composite_rect call.

 

as you can see in the picture, if one of my points goes outside of the rect of the layer, the composites loop around from right to left, and left to right.

I "think" it works like that if you go up, but it causes a memory error if you down below the rect resulting in an immediate crash.

I remember once seeing some discussion about drawing outside of the frame of your (is this an ImageWorld? i don't even know) but I cannot remember where I saw that, or if I'm just thinking wishfully.

ideally, I would like to NOT see this behavior (and stop the bug), and Still have my composite go offscreen (in the picture, it would go right off the screen to the right, but not come in on the left) Hopefully theres some discussion or guidance somewhere, or search terms Someone knows.

I'd rather stop walking down blind alleys.

 

Screen Shot 2015-11-10 at 1.57.47 pm.png

How to draw simple forms in PF_EFFECTWORLD / PF_LAYERDEF

$
0
0

Hi, AE community!

 

Maybe my question is a little bit strange, but I'll try

Is there (in SDK) a methods to create visual forms like circle or oval, line, maybe something like a point with color and feather?

 

What I want to get:

Read data (color, position) from source layer/composition and create small forms with the same brightness and the same position in new world, then blend it with output.

 

Available solutions I see:

1. Using suites, like a

Suites.FillMatteSuite2()->fill()

      with a circle form in arguments. Fill() receive a PF_Rect, I know, but maybe it have a similar solution not declared in SDK_Guide?

 

2. Using DrawBot with arcs or similar paths with fill.

    I found different practices in examples "ColorGrid" and "CCU", but using DrawBot confuses me, because in my project used flag PF_OutFlag_NON_PARAM_VARY and I must call Render function every time to calculate particles position and move them. With DrawBot (as I understand from Guide) I must use DrawBot only in Draw Event. Or maybe this is whole wrong way and DrawBot don't created for tasks like my.

 

3. Using iterate suites.

    In example projects I found complex loops with iterate input world and draw pixels in special for circle area (If I understood it). In other words, I can create array with (special for my task) pixel coordinate system, create points for particles in this array, then loop over this array and move to the same in output world. Ok, if this right way, then I must use math for calculate ovals, or circles, then calculate feathers or aliasing for this forms. The problem clearly requires computing power

 

 

Maybe all this solutions is wrong and I can use another way to solve my task? Maybe there are some functions to draw different forms and I missed them in SDK Guide? I'm afraid to reinvent a wheel, because so far obtained only square

 

Anyway, thanks for any advise or way to solve my problem!

Question About Function

$
0
0

Dear After Effects community, I'm doing something wrong. I started with the skeleton example and changed it to do what I thought I wanted it to do, however it's not working. I changed the "MySimpleGainFunc8" and "MySimpleGainFunc16" to look like this:

 

MySimpleGainFunc16 (

  void  *refcon,

  A_long  xL,

  A_long  yL,

  PF_Pixel16  *inP,

  PF_Pixel16  *outP)

{

  PF_Err  err = PF_Err_NONE;

 

    PF_FpLong  tempR = 0;

    PF_FpLong   tempG   = 0;

    PF_FpLong   tempB   = 0;

 

    outP->alpha  = inP->alpha;

    outP->red  = inP->red + tempR * 0.5;

    outP->green  = inP->green  +  tempG * 0.5;

    outP->blue  = inP->blue  +  tempB * 0.5;

    tempR = inP->red + tempR * 0.5;

    tempG = inP->green  +  tempG * 0.5;

    tempB = inP->blue  +  tempB * 0.5;

 

  return err;

}

 

Now, what I want to happen, is for each frame, the color of each pixel in the previous frame would be averaged with the color of each respective pixel in the current frame. The function I have set up right now does not seem to be working properly. When I apply the effect to a composition, nothing happens at all. Can someone please help me to try to figure out where I'm going wrong. Thanks in advance!

Get Pixel Value from Layer Parameter and Arbitrary XY Coordinates

$
0
0

So this is driving me crazy. I've searched the forums and found a few promising leads, but nothing seems to work.

 

I am inside a float iterator for the current layer (suites.IterateFloatSuite1()->iterate_origin()).

I have passed my layer parameter into it, as a PF_LayerDef.

 

How do I get a pixel value from it?

 

What I want to do is something like this:

out =  getPixelValue(id->layer.data, xCoord, yCoord);

 

Am I simply approaching this in the wrong way?

Any help would be amazingly appreciated.

 

Thanks.

How to properly use a .dylib in a plugin on OSX?

$
0
0

Hello All,

So after using the much appreciated help here on the forums, I was successful at loading a third-party DLL that I needed to use in my plugin on Windows.  Now, I'm moving onto OSX and have a .dylib file that is effectively the equivalent of the DLL in OSX.  My question is how do I properly load the .dylib on OSX for my plugin to work within AE?

 

Many thanks for your time and help!


Best,
Arie


string.append() crash

$
0
0

Hi!

 

I have a popup parameter representing the effects stack.

I update it during PF_Cmd_UPDATE_PARAMS_UI.

 

I update it with a std::string set to "(none)", then for each effect, I append "|" + the effect's name.

 

It usually works fine but I sometimes get a crash.

I check all possible AE errors with if (err = PF_ABORT(in_data)) {} and return without problems.

But when it comes to appending the std::string, I crash.

 

So here's my question: how can I check if it throws an error when it's not a PF_Err function?

 

I tried this way, but still crashes:

 

try{

  names.append(effect_nameAC);

  }catch( std::bad_alloc& ba){

  err = PF_Err_OUT_OF_MEMORY;//also tried with PF_Err_INVALID_INDEX

  ERR2(suites.StreamSuite4()->AEGP_DisposeStream( stream));

  ERR2(suites.StreamSuite4()->AEGP_DisposeStream( parStream));

  ERR2(suites.EffectSuite3()->AEGP_DisposeEffect( fxH));

  ERR2(suites.EffectSuite3()->AEGP_DisposeEffect( effect_refH));

  return err;

  }

 

Thanx,

François

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?

motion blur is not correct on fast rotation

$
0
0

Hi, All.

How are you?

 

I'd like to create a plugin for motion blur.

 

PF_Err transform_world (
     PF_InData *in_data,
     PF_Quality quality,
     PF_ModeFlags m_flags,
     PF_Field field,
     const PF_EffectWorld *src_world,
     const PF_CompositeMode *comp_mode,
     const PF_MaskWorld *mask_world0,
     const PF_FloatMatrix *matrices,
     A_long num_matrices,
     Boolean src2dst_matrix,
     const PF_Rect *dest_rect,
     PF_EffectWorld *dst_world);

 

I used this function with two matrices. ( matrices[0] ( previous matrix) , matrices[1] (current matrix) )

It is working correctly if it is slow rotation.

But It is not working if it is fast rotation.

 

----------------- Original -----------------

--------------- Slow Rotation --------------------

it is working correctly.

 

---------- Fast Rotation -----------------

it is not working

 

 

Particle's size  is limited when it is fast rotation.

How can I solve this problem?

 

Thanks.

Anthonie.

Get Focal Length of the camera?

$
0
0

I am trying to figure out a way to get the focal length of the camera. It is mentioned in the CS4 documentation but no such call is available in the SDK. I just need to find the field of view of the camera and thats the only way i could figure out. Any ideas? Thanks.

How to show progress during a long Render call

$
0
0

My effect computes values from all frames in a layer much like Warp Stabilizer does. I set a flag and do this when necessary in my Render function. The user controls when to analyze by clicking a button in the effect UI.

 

It can take from a few seconds to over a minute depending on the layer, so I need to show progress to the user.

 

In After Effects I can use the progress bar, and put text in the info panel from within the Render proc; but I'd like to find a better way to show progress.

Indicidentally, neither of these two thing seem to works in Premiere Pro.

 

Warp Stabilizer shows progress to the left of the Analyze button in its effects window, but I can's seem to do this from within Render.

 

Any ideas?

How to Get and Set Item Metadata

$
0
0

Has anyone had success with accessing and setting metadata for After Effects folders?

 

In Premiere Pro using ExtendScript I'd access an item's metadata with .getProjectMetadata(); and add to the metadata with app.project.addPropertyToProjectMetadataSchema(), but the only attributes/methods I can seem to find for AE is the app.project.xmpPacket.

 

Any thoughts are appreciated.

 

Thanks,

 

Justin

Library use in AE (STL, Open CV...)

$
0
0

Hello everyone,

A problem I m thinking  about for long time ago: how to use an external libray in AE.

For example STl or OpenCV

Those library have a memory allocation management. So it will concurence with AE one, and AE wont be able to manage the "not enough memory" error.

In the STL you can provide your own allocator. But in OpenCV... you cant.

 

In the SDK it s writtent that

Since After Effects will be using all available memory, it’s important that your plug-in not compete with the application, or performance will suffer and OS memory errors may occur.

 

But if there is not enough memory, AE should be able to detect it... whoever allocated the memory.

 

Anyways, if anyone ever tried that, I would be happy to get some informations on the trouble they went through.

 

 

Regards.


After Effects crash when calling ProjSuite5()->AEGP_OpenProjectFromPath

$
0
0

I'm running 12.2

 

I have code that opens a project.

The only time this code doesn't make after effects crash is in the ImportFile command method; however, I'm trying to run a server ontop of my plugin so I can control after effects remotely.

AEGP_ProjectH projH = NULL;

AEGP_SuiteHandler suites(S_sp_basic_suiteP);

A_UTF16Char templatePath[AEGP_MAX_PROJ_NAME_SIZE];

const wchar_t* wide_templatePath = L"C:\\Projects\\TT1.aep";

copyConvertStringLiteralIntoUTF16(wide_templatePath, templatePath);

ERR(suites.ProjSuite5()->AEGP_OpenProjectFromPath(templatePath, &projH));

 

 

I click debug and hook into visual studio and it's saying.

 

Unhandled exception at 0x000000003201B840 (Projector.aex) in AfterFX.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.

 

 

I've even tried registering into the IdleHook and it still crashes.. Any ideas?

Getting Started, looking for tutorial

$
0
0
Hello!

I'm a computer science student and I'm trying to get started in programming plugins for After Effects CS3. I have lots of experience in developing java projects, especialy plugins and filters for image processing software. But my c knowledge is ... let's say ... little ;-) But I'm working on that.

So I was surfing the web and looking for books to get any guidance on how to develop a after effects plugin. Unfortunately i didn't find much information except for Adobe's API documentation and this forum.

The Documentation is pretty good I guess. But for a beginner it's kind of an desaster. It is just to much information at once.

Building the skeleton project succesed, but i get a lot of files and none of them is an *.aex . I'm using Visual Studio 2005. The full installation with all the stuff I probably don't need, but I wasn't sure. Do I need to change something in the programs settings?

So... to finnaly come to the point...

Can anybody help me? Do you know any good books I might use? Any nice guides on some websites? Any thing?

A step by step tutorial on creating a plugin would be perfect.

I'm not a newbie, I'm a good programmer but I just need some help getting started ;-)

Thanks a lot
Peter

getting "Unable to run script at line 1: syntax error" error?

$
0
0
Hi,

I want to run a script using the AEGP_ExecuteScript() function. but I got an error "Unable to run script at line 1: syntax error". what could be the rea son for this? shall I inlcude anything extra info in my project?

Below is the code ...

char scriptPath[] = "F:\\Documents and Settings\\akshays\\Desktop \\Active Shutter.jsx";

A_Boolean platform_encodingB = 'B';
AEGP_MemHandle outResultPH0;
AEGP_MemHandle outErrorStringPH0;

utilitySuite5->AEGP_ExecuteScript( pluginID, scriptPath, platform_encodingB, &outResultPH0, &outErrorStringPH0 );

please help me.

Thanks
Manjunath

AEGP / EggP? Parse aep file or use SDK?

$
0
0
I am trying get all of the text layers (their text) out of an After Effects Project (7.0). I have the 7.0 SDK and I see how I might access a selected layer, but I don't see how I can get All of the text layers. So this put me onto just parsing the .aep file and seeing if I could just grab all the TextObjects from within it.

It appears that a .aep is encoded as a .eggP,(Assuming that is where we get: AEGP).

Anyway could anyone point me in the right direction.. Maybe the SDK can get all Text Objects's Text, if not how might I go about parsing the .aep file to grab them?

In the meantime I have written an after effects script that will extract all of the text layers.. Perhaps that is as good as it gets. Figured I would ask anyway.

Thanks!

Reload plugin after building...

$
0
0

Would like to enquire about "SLICK DEBUGGING TRICKS" in After Effects SDK Guide (in pdf) for AE CS5 (version 10). Perhaps somebody is successful following the steps!?

I see a few problems as follows:

 

1) AE application keeps a file lock on Filter plugins (or plug-ins)

 

even if one could overwrite an effect plugin when AE process is running...

 

2) Purge All (in menu Purge -> All or Ctrl - Alt - key '/' on the numpad) does not reload the plugin; in fact this is being called in the following order:

    PF_Cmd_FRAME_SETUP,
    PF_Cmd_RENDER,
    PF_Cmd_FRAME_SETDOWN,

no request for PF_Cmd_GLOBAL_SETUP or PF_Cmd_GLOBAL_SETDOWN is made. also this thread already mentions it: http://forums.adobe.com/click.jspa?searchID=3907456&objectType=2&objectID=1798812

 

 

3) VS does not allow Edit & Continue or x64, and CS5 seems to be x64 only - how could you make use of this functionality? or documentation does not seem to be updated completely for SDK for CS5?

 

Greetings

 

mike

Viewing all 73444 articles
Browse latest View live


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