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

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!


User interface for AEGP

$
0
0

Hi,

 

after using Scriptui and Extended Script for a while, I was planning to dive into the SDK now to speed up certain things that feel a bit sluggish using the scripting language. However - and I may be missing the obvious here - I am at a bit of a loss where user interfaces are concerned. How would I go about creating a panel with user inputs (similar to a ScriptUI panel) in combination with an AEGP? Am I right that the only way would be to create the UI using the ExecuteScript command and javascript? If so, how do the two of them communicate with each other? (can I catch events from the ScriptUI?).

 

Thanks

Michael

AE Transition Extensions transition duration

$
0
0

Hi,

 

is it possible to change the transition duration of AE Transition Extensions based plugins in Premiere through a default PF_ParamDef, or are there already any other means to change it (except via timeline)?

 

Is it planned to add UI controls or functions to the AE Transition Extensions to allow transition handling closer to Premiere SDK based transitions?

 

Regards,

Philipp

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

Using Qt in a AEGP plugin. QWidget can't get after effects as parent window

$
0
0

Hey guys,

     I'm trying to use the qt framework to create a user interface for my AEGP plugin. And I'm running into some problems.

     First, I tried to pass the main HWND into a QWidget, but the QWidget can't seem to recognize it as a parent window. My code looks like this,

    

A_Err err = A_Err_NONE;
AEGP_SuiteHandler suites(basicSuiteP);
HWND handle;
ERR(suites.UtilitySuite5()->AEGP_GetMainHWND(&handle));
qt tt(handle);
tt.show();

qt is a child class inherit from QDialog with a custom constructor

qt::qt(HWND hWand) :QDialog()
{  create((WId)hWand);  setModal(true);
}

The qt window did show up, but it can't block user's interaction with after effects' main window. When a QDialog pops up, it will block user's interaction with its parent window until it's closed. But it doesn't seem to work with after effects.

 

And, I'm wondering, is it possible to add a QWidget to after effects' native panel? For now, my qt window is floating as a separate window. can I  just add my qt widgets into a after effects panel so it can dock into after effects' main window?

PF_ADD_POINT with PF_ParamFlag_SUPERVISE flag set doesn't get PF_Cmd_USER_CHANGED_PARAM events in Premiere when dragged

$
0
0

Has anyone else run into this?

 

Problem Description:  An AE plugin with a point parameter defined by PF_ADD_POINT with PF_ParamFlag_SUPERVISE flag set doesn't get PF_Cmd_USER_CHANGED_PARAM events when the point is dragged in the Program window. But it does get PF_Cmd_USER_CHANGED_PARAM events when the point coordinates are changed in the Effect UI.

 

Steps to Reproduce: Make a small change to the CCU example in the After Effects SDK.

1) Modify the CENTER_DISK_ID def.flags in the Params_Setup function by setting

       def.flags = PF_ParamFlag_SUPERVISE;

just before the call to PF_ADD_POINT

2) Insert a code fragment to handle the PF_Cmd_USER_CHANGED_PARAM event in EntryPointFunc

  case PF_Cmd_USER_CHANGED_PARAM:

  err = PF_Err_NONE;

  break;

3) Set a breakpoint at the line err = PF_Err_NONE;

4) Apply the effect to a layer in Premiere Pro (CS6, CC, or CC2014)

5) Select the effect in the effects window so that the point appears in the Program monitor window

6) Drag the point

 

Actual Result:  The break point is not hit because the PF_Cmd_USER_CHANGED_PARAM  event never occurs.

 

Expected Result: The break point should be hit. The PF_Cmd_USER_CHANGED_PARAM event should occur as it does when the point coordinates are changed in the effect UI

 

Any Workarounds: There is no workaround. My effect must be notified that the point has been changed.

GLator for dummies (and from dummy...)

$
0
0

Hi every one!

 

I open this post to summarize what I've been grabing here and there about the GLator sample. It's been discussed a lot already, but it still drives a lot of people nuts!

If you have any usefull info about it, please share! And may be one day we'll all have a proper OpenGL structure to work with...

 

Finally, here is a complete working version of GLator:

 

So let's take it point by point:

 

First of all, one shoud start from the CC example as it's more stable. If you build for lower versions and some suites are not available, just change the suites number.

 

For simplicity's sake, I have (and probably will) edited this post.

 

 

1_Window / context:

 

The GLator example doesn't set context's size, and it crashes when the size of the picture is over 1024x1024, when user purge the cache...

To solve this, one has to remove the AESDK_OpenGL_InitResources() function from GlobalSetup(), and paste it in Render() call. Now in render call, one can set width and height like this:

 

First use SetPluginContext()

 

Then

 

if( (error_desc = AESDK_OpenGL_InitResources(S_GLator_EffectCommonData, Width, Height)) != AESDK_OpenGL_OK)

  {

  PF_SPRINTF(out_data->return_msg, ReportError(error_desc).c_str());

  CHECK(PF_Err_INTERNAL_STRUCT_DAMAGED);

  }

 

Then, all the functions using S_GLator_EffectCommonData.mRenderBufferWidthSu and S_GLator_EffectCommonData.mRenderBufferHeightSu should be replaced by width and height.

 

And then switch back to AE with SetHostContext()

 

EDIT: once the context has been switched back to AE, I used to delete the plugin context and window like so (windows code):

wglDeleteContext( S_GLator_EffectCommonData.mHRC );

DestroyWindow( S_GLator_EffectCommonData.mHWnd);

 

It's working in CS5 and CS5.5, but mess everything up starting from CS6! So let opengl do the cleaning...

 

IMPORTANT EDIT: what's written above does work, but something important is missing: the use of AESDK_OpenGL_Startup() and AESDK_OpenGL_Shutdown()

 

In the sample, AESDK_OpenGL_Startup() is set during GlobalSetup, while AESDK_OpenGL_Shutdown() is called during SequenceSetdown. This is a mistake! One should add a GlobalSetdown function and move the AESDK_OpenGL_Shutdown() from SequenceSetdown to GlobalSetdown. Otherwise, the plugin will seem to work fine, but won't be able to render if a new project is opened. It would work again if you close and re-open AE. The reason is GlobalSetup (and so AESDK_OpenGL_Startup()) will be called only once per AE session, and SequenceSetdown (and so AESDK_OpenGL_Shutdown()) will be called everytime a project is closed.

 

2_AE to OpenGL camera

 

Use the code in the Resizer sample (getting camera matrix) as a base.

 

Then I see 2 options:

 

A_The matrix conversion:

 

You can find more details in this thread (the whole code's a bit long): Help with AE camera matrix >> Opengl Matrix? | Adobe Community

and this one https://forums.adobe.com/thread/1357716

 

convert the output matrix from AEGP_GetLayerToWorldXform() to column-order and serializing it in a float array.

On the OpenGL side, use the following snippet before drawing:

 

Thanks to Tobias Fleischer (reduxFX) for sharing his code:

 

void my_gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)

{

  GLdouble xmin, xmax, ymin, ymax;

 

  ymax = zNear * tan(fovy * 3.14159265358979323 / 360.0);

  ymin = -ymax;

  xmin = ymin * aspect;

  xmax = ymax * aspect;

 

 

  glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);

}


then


{

    ...

    glMatrixMode(GL_PROJECTION);

    glLoadIdentity();

    my_gluPerspective(45.0, (GLdouble)widthL / heightL, 0.1, 1000.0 );

    glViewport(0, 0, (int)(dataP->w[0]), (int)(dataP->h[0]));

    glMatrixMode(GL_MODELVIEW);

    glLoadIdentity();   

    glClearDepth(1.0f);                           

    glEnable(GL_DEPTH_TEST);                       

    glDepthFunc(GL_LEQUAL);                           

    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    dataP->glMatrix[12] -= widthL*0.5f;

    dataP->glMatrix[13] -= heightL*0.5f;

    glLoadMatrixf(dataP->glMatrix);

    ...

}


With this code, we're almost there. I must say I still had troubles to get the proper perspective distortion when I tried to include it in my own OpenGL process. But I'm far from being an opengl expert!

 

So I finally tried to develop my own camera conversion:

 

B_the gluLookAt() option:

 

I grab the camera matrix the same way. Then I define:

 

A_longWidth, Height, FullWidth, FullHeight;

 

Width = outputP->width;
Height = outputP->height;
FullWidth = Width*in_data->downsample_x.den;
FullHeight = Height*in_data->downsample_y.den;

 

//Define th Fov

float Fov = 2.0 * PF_DEGREE_PER_RAD * atan(FullHeight / (2.0 * camDataD.zoom));

 

  gluPerspective( Fov, (GLdouble)Width / Height, 10.0, 10000.0 );

 

  glViewport( 0, 0, Width, Height);

  glMatrixMode( GL_MODELVIEW );

  glLoadIdentity();

 

  point3 target;

  float distCam = distance3D(    camDataD.matrix.mat[3][0] - FullWidth*.5,

                                              camDataD.matrix.mat[3][1] - FullHeight*.5,

                                              camDataD.matrix.mat[3][2]);

 

 

  target.x = camDataD.matrix.mat[2][0] * distCam + camDataD.matrix.mat[3][0];

  target.y = camDataD.matrix.mat[2][1] * distCam + camDataD.matrix.mat[3][1];

  target.z = camDataD.matrix.mat[2][2] * distCam + camDataD.matrix.mat[3][2];

 

A_Matrix4invMat = camDataD.matrix;

 

 

ScaleMatrix4(&invMat, 1.0,1.0,-1.0);
invMat = invertMatrix4(invMat);

 

 

point3orientation_vector = {0,1,0};

 

 

orientation_vector.x = invMat.mat[0][1];
orientation_vector.y = invMat.mat[1][1];
orientation_vector.z = invMat.mat[2][1];

 

 

normalize( &orientation_vector);

 

 

gluLookAt(camDataD.matrix.mat[3][0],
camDataD.matrix.mat[3][1],
-camDataD.matrix.mat[3][2],
target.x,
target.y,
-target.z,
orientation_vector.x,
orientation_vector.y,

orientation_vector.z);


If like me you're more used to AE than OpenGL, then this method is more intuitive. The lookAt function acts just like an after effects camera, showing a world using the same coordinates than AE world. Then grabing lights or other layers becomes "easy" as developping can be...

 

This part caused me the biggest headaches, so if you want to use it, you owe me a beer!

 

 

 

3_Using GLator to render polygons.

 

I've tried rendering polygons and hit a wall: antialiasing. Though you can still use glEnable(GL_LINE_SMOOTH); for antialiased lines, GL_POLYGON_SMOOTH is now deprecated. It means antialiasing has to be done another way. I couldn't figure it out, but see 2 options: MultiSampling, or post-process AA through Shader. If someone successfully used MultiSampling, I'm curious to see how.

 

EDIT: another option is superSampling (write to a bigger buffer, and resize it to layer's size). Though it's a bit of an overkill, openGL speed makes it a not so bad option...

 

4_Using Shaders:

 

In the sample, in order to use Shaders, one has to define

#define USE_SHADERS 1

I personnally took the option to add a checkbox parameter and embed the shader functions in a "if (params[USE_SHADER]->u.bd.value) {}" statement.

 

To use the shaders properly, one should replace "GL_TEXTURE_2D" by "GL_TEXTURE_RECTANGLE_ARB", and in the Shaders, "sampler2D" by "sampler2DRect" and "texture2D" by "texture2DRect".

This tip comes from Gutsblow in this thread: GLator Quirks..Help needed!

 

Anyway, I must say, though the shaders compile fine and are actually used by my plugin, I can't see it act on the final render... I probably set the functions in a wrong place, so any help will be appreciated...

 

Edit: in fact, the shaders work just fine! My knowledge of shaders was too close to the ground to see it was actually working...

 

Actually, the "GL_TEXTURE_2D" to "GL_TEXTURE_RECTANGLE_ARB" switch is not only for shaders and should be done anyway to avoid troubles.

 

 

5_Red and Alpha channels swap

 

When using OpenGL colors, Red and Alpha channels will be swapped.

One shoud use glReadPixels() with GL_ABGR_EXT instead of GL_RGBA, only colors will be swapped, and alpha operations (blending and so on...) will be OK. If you swap the BLUE/RED colors before rendering, it should work without losing speed.


This depends on what you ask OpenGL to render: textures or polygons.



I write this post as answered, but if any of you have any tip to share and make it better / stronger, please share!


Cheers,

François

Create Puppet Pin programmatically

$
0
0

Hi all,

 

I'd like to ask whether is it possible to create puppet pins programmatically...

 

I have tried to copy stream structure ("ADBE FreePin3", "ADBE FreePin3 Mesh", "ADBE FreePin3 PosPin Position", ...) of manually created pins with

corresponding values, but when I create streams this way they are disabled (AEGP_DynStreamFlag_DISABLED - and greyed out in UI).

 

I suppose that the vertex index "ADBE FreePin3 PosPin Vtx Index" is just an index to the array stored internally as arbitrary data so the mesh and pins must be created somehow before setting these values.

 

I've found this thread where they try to do the same thing using scripting (also without success  )Create Puppet Pin on existing mesh via scripting

 

I have some ideas about how this could be done using SDK, but all of them involve diving in very dark waters..

- call the EffectSuite::AEGP_EffectCallGeneric method with fake mouse click events (PF_Cmd_EVENT) or some direct PF_Cmd_COMPLETELY_GENERAL commands if the FreePin effect supports it

- use "FreePin Suite" - which is not a part of public SDK but can be aquired using AquireSuite... - but as it's not public I suppose it operates with memory which is not so safe to touch even if I managed to get/create proper header file for this suite

 

Maybe there is a simple elegant way of creating these pins which I completely overlooked, so I would be really thankful for any suggestions

 

Thanks a lot!

 

Martin


Possible to call / load an external DLL in GlobalSetup()?

$
0
0

Hi Again

 

So, I'm needing to use a DLL provided to me by a third party.  I need to call a function from it in GlobalSetup().  I've linked the DLL (x64) correctly as Visual Studio is building the .aex just fine.  However, when I go to debug and apply the effect to a solid, for exampe, AE tells me:

 

After Effects error: plugin "testplug.aex" could not be loaded (126).

(48 :: 46)

 

Then, I click 'OK', and when I apply the effect again it gives me the following error:

 

After Effects error: invalid filter

(25 :: 3)

 

From my experience this usually means that After Effects cannot find some kind of DLL, but I might be wrong.   When this error comes up, I do see the following in Visual Studio's debug output:

 

First-chance exception at 0x00007FF8BB0D871C in AfterFX.exe: Microsoft C++ exception: long at memory location 0x000000000083AE78.

First-chance exception at 0x00007FF8BB0D871C in AfterFX.exe: Microsoft C++ exception: long at memory location 0x000000000083AFAC.

First-chance exception at 0x00007FF8BB0D871C in AfterFX.exe: Microsoft C++ exception: long at memory location 0x000000000083B610.

 

I doubt that means anything, but just thought I would share that info in case it does.

 

I've pinned down the problem to the first line of code that calls a function from the third-party DLL.  When I comment out that line, everything is okay, but when I uncomment it, I get the errors above.  So, my question is if there is anything I can further to do debug the DLL issue.  The DLL was just shipped with an SDK, so I don't have access to the source.

 

If there is any insight you all can offer, I would be most appreciative.

 

Thanks and best,
Arie

A_Time values

$
0
0

Hello,

There  is no documentation about A_time, and I would like to know how it works.

All samples get keyframes values by AEGP_GetKeyframeTime function with a result like :

A_Time timePT = {94208, 25600}; // 3 sec 17

94208 is the value : How is formula to get this value. ?

25600 is the scale : How is formula to get this value. and how it works ?

I'm working on a keyframer,

I want to insert keyframes at 1.2 sec on a timeline of a solid for example, the composition is based on 25 fps.

How I get the right values (value and scale) for A_Time

 

I use

    ERR(suites.KeyframeSuite3()->AEGP_InsertKeyframe(position_streamH,

                                                     AEGP_LTimeMode_LayerTime,

                                                     &timePT,

                                                     &new_indexL));

Cheers

Jim

СС2015 - Modal dialog is waiting for response.

$
0
0

Hi All,

 

I've this script error on CC AE 2015 while it runs flawlessly on AE 2014.

Just a simple script that reads the blend mode, and it executed after AEGP_IsScriptingAvailable called.

 

Any ideas what may cause this one?

world vs layer

$
0
0

I'm taking the fxphd course to get me starting and it's helping a lot in understanding how things work.  But I have a couple of concept questions.

 

1. what's the difference between a layer and a world?  The instructor said that the sdk calls a layer a world.  But in 3d math and opengl I think of world as something else.  And I see functions like GetLayerToWorldXform and I see the docs talking about layers.  So it makes me think that either I misunderstood him or he was simplifying things or was incorrect.

 

2. If I wanted to replicate the transform plugin and make an effect that can position and scale layers (but not apply any pixel effects), would that plugin only need to change a matrix or would it need to render pixels? Maybe it's in the docs and I don't know what to search for, but I can't seem to find an explanation of how to do this.

 

This is my thinking.. let's say I had a plugin that filled the layer/solid/whatever with a checkerboard.  I don't think moving this solid around in space or scaling it does anything to how that plugin is rendering that checkerboard.  It still gets rendered at render size first.  And then the layer position, rotation and scale, etc are transforming that layer as a last step during compositing.  Can I have a layer that either doesn't have a cmd_render or doesn't do anything in it?  Can I checkout the transformation matrix, change it and check it back in?

Unable to open resource file

$
0
0

Somehow in my development efforts I did something that makes After Effects put up a message when it starts saying "Unable to open resource file SmartyPants.plugin 3::54".  I have been struggling with effects based on SmartyPants and even tried at one point to build an older version of SmartyPants.  I can just click OK and After Effects carries on, but since I am starting it over and over again during the day, I'd like to get rid of the message.  I have used Finder to remove every file on my computer with SmartyPants in its name and I have uninstalled and reinstalled After Effects.  I still get the message.

 

Does anyone know what is causing this message and how I can stop it?

Shader effect

$
0
0

Hi there, and sorry for the noob question, but I couldn't find a clear answer elsewhere.

Just wanted to be pointed in the right direction.

 

I have a pretty good experience coding GLSL, HLSL and OGSFX shaders, and a bit of compute, and wanted to make a plugin to help me and my team compose rendered scenes. But never coded anything in after effects besides ExtendScript.

 

It would be basically a deferred shading using pre rendered AOVS as inputs, like position, normal, albedo, uv maps etc... So it would do some quick retexturing, additional lighting, SSAO, depth of field etc.

 

I am a bit confused about what to use. I know there is the GPU effect rendering, but is GLator the way to go in this case?

 

Also do you guys recommend any courses for coding for after effects on windows?

 

Thanks a lot for your time!

Rendering Sound from an AEGP

$
0
0

I'm using AE 2018 on a Mac. I have an AEGP and I'm trying to render the sound of the active composition. I'm using AEGP_RenderNewItemSoundData of the render suite but it always return a A_Err_GENERIC error when I try to get the samples. i've tried different suites, different comps and different settings but I'm always running into this.

The SDK mentions that there was a bug in 13.5 when calling this method from the UI thread (which I am) but that it's been fixed since. If I'm not mistaken I can't get to the AE render threads from an AEGP so I don't really see another method of rendering sound. Am I missing something? Am I doing something wrong? I'd appreciate any help!


How to enable Fast Previews while rendering?

$
0
0

Hi,

     Is there a way to enable Fast Previews option (Adaptive resolution) when the user tries to change custom effect parameters? I want the rendering to be fast.

 

Thanks,

Dheeraj.

Apply my effect plugin only once

$
0
0

How can I prevent an effect plugin from being applied on a layer?

I would like my plugin to do nothing if activated a second time on a layer.

Thx

how can i run an extention(html5 panel) from c++ plugin file

$
0
0

hi. i am new in after effects. i tried to run an extention(html5 panel) from a plugin c++ code...

is it possible? if not possible how can i run jsx file instead of extention?

Reload plugins without restarting AE CC

$
0
0

Is is possible to reload effect plugins in After Effects CC without restarting the whole application?

 

I am developing a new effect and would like to be able to load a new build of the effect without have to constantly Quit and restart After Effects.

Expanding Text Layer Size

$
0
0

It has been a while since I have asked a question so bare with me as I have been taking a break from AE development for a while

 

Below are two images that show the standard blur effect in After Effects

 

http://i.imgur.com/WGhsbUF.jpg

 

http://i.imgur.com/CGI3EkY.jpg

 

Notice how the blur effect is going outside the boundries of the layer the effect is being applied to (text layer).  My starting question is how this type of functionality can be achieved in a SmartFX plugin.  I have been messing with the max_result_rect, etc in the PreRender call trying to expand the area I am working with but have not been having much luck.  So before sinking too much more time into this I figured I would pose the question in case one of the other developers on here have looked into this before

 

Thank you in advance!

Viewing all 73444 articles
Browse latest View live


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