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

Develop a simple After Effects plugin in C# ?

$
0
0

Hello,

 

I would like to create a simple After Effects Plugin using C#.  The plugin will have a small screen with a couple simple controls . This plugin will run in After Effects on a Windows machine.

 

I am new to Adobe After Effects .

 

Can you point me to a SDK , tutorials etc ?

 

Thanks a ton,

Peter


Troubleshooting Plug-ins

$
0
0

I have created a plug-in and tested it sucessfully on my computers, both Mac and PC, 32 and 64-bit, and everything has worked fine. However, when I put the plug-in my website for download, one user has told me they got an error:

 

AFter Effects error: plug-in \"C:\\Program Files\\Adobe\\Adobe After Effects CS5\\Support Files\\Plug-ins\\BatchFrame\\

De_Compose\" could not be loaded (126).
(48::46)

I am not sure how to go about troubleshooting this error. I am new to creating plug-ins and I don't know what steps I should take. I have not heard of any problems from any others who have downloaded this plug-in, however, only a small number of people have downloaded the plug-in, so I may not be hearing about problems that may occur.

What should I do to make sure that users do not recieve errors? If it helps, my plug-in can be downloaded here: http://www.batchframe.com/extras/download/de_compose.zip

Thanks for any help,

Jesse Toula

Memory management issues

$
0
0

Hi All.I have a question regarding dynamic allocation in the SDK.I write a plugin which uses some code which allocates memory on  a heap with malloc.It crashes right after that.And inspecting the pointers to the AE data which I need to memcpy into that memory I see their are all reset.I have seen different examples where only SDK specific routines are used to allocate/deallocate the memory.Does it mean that C/C++ standard methods to work with memory cannot be used within the plugins?

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

Help with AE camera matrix >> Opengl Matrix?

$
0
0

I've been toying with the SDK for a few weeks now, I'm finally getting somewhere, but I've gotten to a point that I can't figure out. I'm trying to use the After Effects camera data to move around in my opengl scene. Here is the code I have

 

First I get the Camera Matrix.

 

 

-------------

//Variables...
    A_Matrix4            camMatrix;
   
    GLfloat                glMatrix[4][4];

    GLfloat                glMatInverted[16];

 

    GLfloat                glMatrix2[16];

 

 

...
    A_FpLong planeDist;


     ERR(suites.PFInterfaceSuite1()->AEGP_ConvertEffectToCompTime(in_data->effect_ref,
                                                                     in_data->current_time,
                                                                     in_data->time_scale,
                                                                     &comp_timeT));
       
     ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectCamera(in_data->effect_ref,
                                                             &comp_timeT,
                                                             &camera_layerH));


    ERR(suites.CameraSuite2()->AEGP_GetDefaultCameraDistanceToImagePlane (compH, &planeDist));
   
    ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectCameraMatrix( in_data->effect_ref,
                                                                &comp_timeT,
                                                                &matrix,
                                                                &planeDist,
                                                               (A_short*)in_data->width,
                                                               (A_short*)in_data->height));

 

 

.. Here's where it's most likely going wrong.. ..

 

            // AE Matrix
            /*
            
             0   1  2  3
             4   5  6  7
             8   9 10 11
             12 13 14 15
            
             OGL Matrix
            
             0    4    8    12
             1    5    9    13
             2    6    10    14
             3    7    11    15
             */

 

// First I convert to the opengl matrix format

 

            for (x = 0; x < 4; x++)
            {
                glMatrix[x][0] = matrix.mat[0][x];
                glMatrix[x][1] = matrix.mat[1][x];
                glMatrix[x][2] = matrix.mat[2][x];
                glMatrix[x][3] = matrix.mat[3][x];   
            }

//  Then I convert the matrix into a 1-d array of floats

                   
            int count=0;
            for (x = 0; x < 4; x++) // rows
            {
                glMatrix2[count]     = glMatrix[0][x];
                glMatrix2[count++] = glMatrix[1][x];
                glMatrix2[count++] = glMatrix[2][x];
                glMatrix2[count++] = glMatrix[3][x];   
               
                count++;  
            }

 

-------------

// I then invert the matrix using a function I borrowed from Mesa3d, it is at the bottom of this post for reference.

 

gluInvertMatrix ( glMatrix2, glMatInverted );

 

-------------

 

 

-------------

And then down in my drawing routine, when setting up my GL scene, I use the following

-------------


            //set the matrix modes
            glMatrixMode( GL_PROJECTION );
            glLoadIdentity();
           
            gluPerspective( 45.0, (GLdouble)widthL / heightL, 0.1, 100.0 );
           
            // Set up the frame-buffer object just like a window.
            glViewport( 0, 0, widthL, heightL );
            glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
            glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
           
            //spin using slider [TODO] as slider control
            glMatrixMode( GL_MODELVIEW );
            glLoadIdentity();
           
            glLoadMatrixf( glMatInverted ); // <---- I am loading in the matrix that I created from the ae camera here.

 

 

-------------

 

When I don't include the LoadMatrix call, everything is visible, but when I do, I see nothing, so my assumption is I am way off in my calculations somewhere, I'm hoping someone familiar with this can spot my obvious error.

 

I am debugging this and logging my matrix before and after conversion, and it is definately working, I don't *think* i'm losing data anywhere... Any help is greatly appreciated.

 

-Chris

 

 

 

 

 

 

 

-------------

 

 

bool gluInvertMatrix(GLfloat m[16], GLfloat invOut[16])
{
    GLfloat inv[16], det;
    int i;
   
    inv[0] =   m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15]
    + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10];
    inv[4] =  -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15]
    - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10];
    inv[8] =   m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15]
    + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9];
    inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14]
    - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9];
    inv[1] =  -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15]
    - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10];
    inv[5] =   m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15]
    + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10];
    inv[9] =  -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15]
    - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9];
    inv[13] =  m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14]
    + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9];
    inv[2] =   m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15]
    + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6];
    inv[6] =  -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15]
    - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6];
    inv[10] =  m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15]
    + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5];
    inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14]
    - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5];
    inv[3] =  -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11]
    - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6];
    inv[7] =   m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11]
    + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6];
    inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11]
    - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5];
    inv[15] =  m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10]
    + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5];
   
    det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12];
    if (det == 0)
        return false;
   
    det = 1.0 / det;
   
    for (i = 0; i < 16; i++)
        invOut[i] = inv[i] * det;
   
    return true;
}

Drag and drop support in plugin

$
0
0

Hello,

 

I was going through Panelator sample plugin code and saw that they are creating dockable panel using OS Controls. I was just trying to check if i can add code for handling any drag and drop on that panel. So i modified the code in that like this..

 

PanelatorUI_Plat::PanelatorUI_Plat(SPBasicSuite* spbP, AEGP_PanelH panelH,
                            AEGP_PlatformViewRef platformWindowRef,
                            AEGP_PanelFunctions1* outFunctionTable) : PanelatorUI( spbP, panelH, platformWindowRef, outFunctionTable)
{

 

    WindowRef hostWindow;
   
    hostWindow = (WindowRef) HIViewGetWindow(platformWindowRef);
   
    Boolean t = true;
    OSStatus status = SetAutomaticControlDragTrackingEnabledForWindow(hostWindow, t);
    static const EventTypeSpec  kDrawEventSpec[] = {    { kEventClassControl,  kEventControlDraw },
                                                        { kEventClassControl, kEventControlDragEnter },
                                                        { kEventClassControl, kEventControlDragWithin },
                                                        { kEventClassControl, kEventControlDragLeave },
                                                        { kEventClassControl, kEventControlDragReceive }
                                                    };
       OSErr    err = InstallEventHandler (GetControlEventTarget ( i_refH), // 6
                                        NewEventHandlerUPP (S_EventHandler),
                                        5,
                                        kDrawEventSpec,
                                        (void *) this,
                                        NULL);

 

}

 

and in the EventHandler func i'm checking if the eventKind is kEventControlDragEnter. My problem is what ever component i drag on the panel, it is not sending kEventControlDragEnter event to EventHandler func. Can please anyone tell me why it control doesn't come to EventHandler func.

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

VS/VC++ Struct Member Alignment (set to 4)?

$
0
0

I would like to ask why Struct Member Alignement is set to 4 instead to Default (or 8 on x64)?

(in Visual Studio 2008 - Project properties ( -> Configuration  properties) -> C/C++ -> Code Generation -> Struct Member  Alignment)

 

There were runtime problems after linking with an external library (default alignment); so it might be better to change the skeleton template in SDK.

 

For example in After Effects CS5 SDK for windows in:

 

after_effects_cs5_sdk_win\Adobe After Effects CS5 Win SDK\Examples\template\Skeleton\win\Skeleton.vcproj

 

look for:

 

StructMemberAlignment="3"

 

and set it to 0 (default) or at least to 4 (64bit alignment)

 

StructMemberAlignment="0"

 

or

 

StructMemberAlignment="4"

 

 

greets

m


After Effects error : layer does not have a source.

$
0
0

Hi All,

          I add a Text layer and then add my custom fill  effect to it. Then I call AdvItemSuite1()->PF_ForceRerender(in_data, &(params[0]->u.ld)) from AEGP for all the layers. But only for Text layer, AE pops up a dialog displaying the following error :

 

After Effects error : layer does not have a source.

(26::335)

 

Why is this happening? What other call can I use to rerender all the layers?

 

Thanks & Regards,

Dheeraj

how to create a effect stream like "CC Particle World" does?

$
0
0

Hi all,

 

I found that in effect "CC Particle World", it includes a stream named Scrubbers that is cool and different from the stream that SDK metioned.

Seems much more complicated to do this, does anyone know how to create a stream like that?

pic.png

Anchor Point on Layer Parameter?

$
0
0

This seems so basic, what am I overlooking?

 

In my Effect plug-in, you can access layer parameters. I'd like to position them relative to their anchor point (rather than the center, or the top left, or other guess).

 

I only see accessors from the AEGP_StreamSuite4, but I've never been clear if these were usable from an effect. If so, how do you convert a PF_Layer to a AEGP_LayerH?

 

Anyway. Can my Effect plug-in get a layer's anchor point?

 

Thanks!

How to mask circular or cylindrical 3D text with geometry & material options?

$
0
0

Hello, guys, I am back to trying to rotate that text around that planet in After Effects CS6.

 

I am making one basic assumption — please correct me if I am wrong. (I'm sure you will !) I understand that I cannot have two 3D objects (or in this case, two 2D objects with 3d effects applied) in the same "scene" (as it is called in Photoshop.) In other words, I cannot have the planet and the orbiting text in the same layer, so that the planet naturally masks out the back side of the orbiting text. I am limited to having the planet on one layer and the text on another, correct?

 

My goal: to make some shiny, reflective, extruded text, make it goaround in a circle with the text on the back side of the circle masked out so that the orbiting text appears to be disappearing behind the planet.

 

OK, given that the above assumption is correct, I can see two ways to do this, but (so far as I can tell) each method seems to have its advantages and disadvantages:

 

1. I can apply the CC Cylinder effect to my text.

 

PROS:

- This effect has a very handy option to render the full cyclinder or just the outside or inside. I chose outside as I want the text to appear to rotate across the front of the planet.

- I can add a mask to hide some of the remaining visible text when needed.

- Some built-in lighting controls.

 

CON:

- No material options so I cannot add an environment layer to get those cool reflections that are really going to impress the client. (Yes, I am using the Ray-Traced 3D Renderer.)

 

 

2. I can apply the 3D Rotate Around Circle Animation Preset to my text.

 

PRO:

- I have material and geometry options to make the cool reflections.

 

CON:

- No "Render Outside" option and I understand you cannot add a mask to a Ray-Traced Layer. (Correct?) I suppose I could render those 6 seconds to video and then mask that footage layer, but when the front text is right in front of the back text, it would be a really complex mask to have to make.

 

Here is what I am talking about:

http://www.youtube.com/watch?v=Y9FcD-bx-sg&feature=plcp

 

That boring flat white text that looks like it was cut out of paper is what I am trying to replace with something snazzier.

Any ideas, suggestions? Is there some other way to achieve this goal that i just don't know about yet?

 

I am using the latest version of After Effects CS6 on a 27" iMac, running OSX7.4.

 

Thanks!
--Carol

 

Carol Gunn
Gunn Graphics
Austin, TX 78741
512-385-8818
www.gunngraphics.biz
www.linkedin.com/in/carolgunn

Are plugins cross-platform?

$
0
0

Are plugins developed for after effects compatible accross both Mac and Windows, or does one need to take into consideration the platform their using when developing a plugin?

GPU accelerated AE/Premiere Pro plugin development?

$
0
0

Hello All,

 

I'm the developer of a prototype video processing algorithm that is currently a standalone .NET executable.

 

I want to create an After Effects or Premiere Pro compatible plugin version of this algorithm.

 

My questions:

 

1) Should I use the After Effects SDK, or the Premiere Pro SDK to develop this plugin? Does an After Effects plugin run in Premiere Pro as well? Or, conversely, does a Premiere Pro plugin work in After Effects?

 

2) Can an After Effects or Premiere Pro Plugin tap into the power of the GPU? Do I need to learn CUDA/OpenCL for this, or does the Adobe SDK include its own GPU functions?

 

3) Which SDK makes it easier to create a multithreading-capable plugin, so that my plugin uses all CPU cores on a machine?

 

4) Is there a way to get a free developer version of After Effects/Premiere Pro, or do I have to buy the full price products to develop plugins for them?

 

 

Thanks for any help/answers!

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.


Effect's index

$
0
0

Hi!

 

I have a problem to get an Effect's index. I tried to solve my problem by getting the Effect's name, and it works fine, except if user gives that name twice, so I'm still stucked...

How can you return the Effect's index, usable by Script? For example, my effect is the second effect applied on my layer, how can I get this "2" index?

 

I figured out how to get layer's index, comp's unique_ID, but see no reference for effect's index into the SDK documentation...

 

I also tried to iterate with AEGP_GetLayerNumEffects and compare effect_refH, but it doesn't work...

 

Does anyone know a way?

 

Thanx,

François

 

------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -------------

 

I found a work around, by changing the name of my effect, calling it by script with the new name, then re-give the old name, but there must be something more simple...

 

Any idea?

 

Thanx

SDK Tutorial?

$
0
0

Greetings everyone,

 

I'm going through the SDK documentation pdf and I'm wondering if there is a walkthrough with the examples somewhere or it’s a “figure it out yourself” type of thing?

 

Thx,

Tracking mask path vertices?

$
0
0

Hi all

 

I've tried many ways to track vertex coordinates of a path(beign it mask or shape path). And the only solution i've found until now was making scripts, which works well, but is not ideal, since running a script everytime a modification is done on the path is not workflow-friendly, specially when making 2D shape animation, where you are always making tiny adjustments on the path and RAM-previewing it like 10 times in 2 minutes, to feel the flow of the motion.

 

The other way, that was almost perfect for me, was trying to take the vertices data through expressions, but when you get the shape object from the expression, example: thisComp.layer("some-solid").mask("my mask").maskPath.value ...... the value inside after effects becomes an empty [object Object], and in Extendscript Tool, that same object is a [object Shape] with all the information in it. I guess Adobe took off that particular object from expression for perfomance reasons, but i'm not sure.

 

So, i became aware of things like PathDataSuite and PF_PathVertex from the SDK, which is exaclty what i was looking for, but i was wondering how would be the best way to ouput that data through Effects, to be accessible by expressions, and then, inside After Effects, with expressions, i decide what to do with the path data given by the plugin. But, looking at all the other existing plugins, i realized that the only properties that are accessible by expressions, are things like point, rotation, sliders, dropdown menus, etc....

 

My question is: How can i output path data through an Effect's property, reachable by expressions. Could be something similar to "Source Text" property, with a string in array format, like [ verticesArray , inTangentsArray ,outTangentsArray ].

 

Example of 1 segment: [ [ [0,0] , [10,0] ] , [ [-10,-10] , [10,10] ] , [ [10,10] , [-9,0] ] ]

 

And then, on the position property of a null, i could write the expression: effect("My Effect")("Path data")[0][0]; to get the first vertex position data, and then, doesn't matter where i put that vertex, the null will always follow it's position(relatively).

 

Finally, in the SDK i was looking for something like PF_ADD_PARAM that could act as if it was PF_ADD_TEXT If you know what i mean.

 

Any ideas?

 

P.S. if you made it through here, thank you for reading all this.

Image / Logo in Parameter

$
0
0

This might be a fairly naive question, but I've fumbled through putting together my first plugin through these forums, the sdk and sheer brute force at times ... however one thing I noticed on Keylight that I can only assume is not part of the out of the box params is shown in the following screenshot.  I was wondering if anyone has looked into doing this type of thing before, and if so how you went about doing it.  I have just have been wondering about this for a while and figured I would ask as I am almost done with my plugin.

Capture.PNG

can popup mfc dialog from plugin in PF_Cmd_DO_DIALOG?

$
0
0

how to popup mfc dialog from plugin in PF_Cmd_DO_DIALOG command?

 

there are too many parameter to adjust,

 

so what to use popup dialog to show the solo parameters.

 

is there any way?

Viewing all 73444 articles
Browse latest View live


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