After Effect SDK memory managing

Hello, guys!
I'm new at AE SDK, so..
I have, for example, such in sequence memory handle:
struct
     char* a1;
     char* a2;
} MyData;
During sequence setup, i ask host to allocate memory for it:
    PF_Handle    seq_dataH =    suites.HandleSuite1()->host_new_handle(sizeof(MyData));
    if (seq_dataH){
        MyData    *myData = static_cast<MyData*>(suites.HandleSuite1()->host_lock_handle(seq_dataH));
        if (seqP){
            PF_Handle a1_handle    =    suites.HandleSuite1()->host_new_handle(255);
            PF_Handle a2_handle    =    suites.HandleSuite1()->host_new_handle(255);
            myData->a1 = static_cast<char*>(suites.HandleSuite1()->host_lock_handle(a1_handle));
            myData->a2 = static_cast<char*>(suites.HandleSuite1()->host_lock_handle(a2_handle));
            out_data->sequence_data = seq_dataH;
The question is: how can i release memory for MyData.a1 and MyData.a during SequeceSetdown if i have not appropriate PF_handle's at this moment (i have only sequence_data)? Is next code release ALL my sequence memory (including a1 and a2)
     suites.HandleSuite1()->host_dispose_handle(in_data->sequence_data)
In general i want to ask if should i keep all memory handles for locking, unlocking, disposing, resizing etc...
Thx.

er...
none of that strikes me as correct... at least in some respects.
the sequence data is used for two purposes:
1. storing data that lasts session long for this particular instance of your effect.
2. storing data with the project, that will be retrieved on the next session, again, for this particular instance.
so from what i gather from your code (and i may be wrong), it works for the first reason and not the second.
you define your data structure like so:
struct
     char* a1;
     char* a2;
} MyData;
that means that your data is 2 pointers.
NOT the content of these points, but the pointers THEMSELVES.
so when the project is saved and re-loaded, you'll have two pointers that point to a no longer valid piece of memory.
if you defined:
struct
     char a1[256];
     char a2[256];
} MyData;
and then:
out_data->sequence_data = PF_NEW_HANDLE(sizeof(MyData));
then you would now have a handle that stores the content of two 256 char arrays, and not just pointer to such arrays.
if you do it this way, the content of the two arrays will be stored with the project, and retrieved on the next session.
what you did is not wrong, it just works for a different purpose.
and another thing:
there is the handle_suite, and the memory_suite.
these should be used for different things. (though they can be interchangeable)
the handle suite is used for handles provided to you by AE. (i.e. the global_data, sequence_data and frame_data)
these handles are locked and unlocked for you, whenever AE is calling your plug-in.
the memory suite is used to manage pieces of memory that are not the 3 handles given by AE.
that allocated memory is up to you lock, unlock, move and free.
consider this mixed solution:
struct
     char a1[256];
     char a2[256];
     char* a3;
     AEGP_MemHandle a3H;
} MyData;
out_data->sequence_data = PF_NEW_HANDLE(sizeof(MyData));//allocating the memory
MyData *myData;//creating a local instance of the structure to work with
myData = *(MyData**)out_data->sequence_data;//connecting the local structure to the global handle.
so now the sequence_data handle points to a structure of two ready to use arrays (a1, a2), and one pointer that points to nothing (a3), and a mem handle, to be used soon.
to associate a chunk of memory to the a3 pointer you should use the memory suite.
ERR(suites.MemorySuite1()->AEGP_NewMemHandle( NULL,
                                                                                "a string to be displayed in case of an error",
                                                                                666, //size of chuck in bytes
                                                                                AEGP_MemFlag_CLEAR,//use this flag to get a zeroed out chunk
                                                                                &myData->a3H));
ERR(suites.MemorySuite1()->AEGP_LockMemHandle(myData->a3H, reinterpret_cast<void**>(&myData->a3)));
this is it.
a3 is now the proud owner of 666 bytes.
all of which will be available until the a3H handle is freed.
it is now up to you to free that memory.
you could do that at any time but most likely you'd want to free it during sequence_setdown
so first you should free a3H. why? because it's handle is stored with with the sequence_data handle, and if you free the sequence_data handle first, you won't have that a3H handle available to free it.
if(myData->a3H)
{ ERR2(suites.MemorySuite1()->AEGP_UnlockMemHandle(myData->a3H));
  ERR2(suites.MemorySuite1()->AEGP_FreeMemHandle(myData->a3H)); }
and now you can dispose of the sequence_data:
PF_DISPOSE_HANDLE(in_data->sequence_data);
that's it.
that last thing you should do is lookup PF_Cmd_SEQUENCE_FLATTEN on the SDK guide.
apart from that, we've made a round trip.

Similar Messages

  • After effect SDK and PHP

    Hello,
    I'm a newbie in After effect.
    I would like to know if it's possible to generate a video with the after effect SDK after sending parameters by a PHP script ?
    Thank you very much.

    hi timmxware777!
    welcome to the forum, where the people are good, and the advice is also! (most of the time)
    what you're asking about is very much possible, and you can lookup a few threads that have discussed this here in the past.
    HOWEVER, i would very much reccommend that you do that task using the javascript API and not the SDK, as it wuokd be much much simpler to pull off.
    if you ever need one of the very few advantages that c++ offers over js for this task, then migrate your code when you need to.
    you'll save yourself a TON of hurt. (really)

  • After Effect CS6 GPU alert MBP 9,2 mid 2012, How to Fix After Effect CS6 GPU manager Alert in MBP 9,2 mid 2012

         Hi,
    First of all, let me thank everybody who takes the time helping me with this issue.
    My name is José. I work on a 13" MacBook Pro (MBP 9,2 mid 2012) with Mac OS X 10.9.5 (13F34). It has a 2,5GHz Intel core i5 Processor. 4GB of RAM Memory, and an Intel HD Graphics 4000 1024 MB.
    I've installed the Adobe CS6 and I'm having trouble with After Effects. It just won't open. Every time I try to run the app it crashes and the "GPU manager" alert pops up. I had installed and ran Photoshop and Illustrator successfully but After Effects crashes every time. I've even downloaded and installed all the updates from the Adobe support and still got the alert message. I installed 11.0.1, 11.0.2, 11.0.3 and 11.0.4 updates but non of them seems to fix the problem.
    Please, hope someone could help me.
       Thanks!!
    Hola,
    Primero que nada, Gracias a todo aquel que se tome la molestia de ayudarme.
    Mi nombre es José. Tengo un MacBool Pro de 13" (MBP 9,2 mid 2012) con Mac OS X 10.9.5 (13F34). Tiene un procesador intel core i5 de 2,5GHz. Mamoria Ram de 4GB y tarjeta gráfica Intel HD4000.
    Instale la suite de Adobe CS6 pero estoy teniendo problemas con After Effects. Simplemente no abre al aplicación. Cada vez que lo intento se cierra antes de arrancar y aparece el mensaje de alerta de "GPU manager." Instalé con éxito Photoshop e Illustrator y ambos corren sin problemas. Descargué las actualizaciones de la pág de Adobe 11.0.1-2-3-4 y nada parece solucionar el problema.
    Por favor. Espero alguien puede ayudarme.
    Gracias!!

    Buenas, otra vez. Terminé resolviendo mi problema instalando el AE CC. que no es lo que quería en principio pero al final lo que me importa es poder disfrutar del programa. el único problema es que gracias a la tarjeta gráfica que trae mi modelo de MacBook, no podré disfrutar de la opción de trabajar los gráficos en GPU sino únicamente en CPU. ya que para trabajar en GPU necesito el complemento CUDA que mi tarjeta no lo puede utilizar. igual seguiré buscando respuestas a mi caso por la web y otros foros.
    Hello again. I ended up installing AE CC to fix my problem. although that was not what I was looking for but at the end all that matter is to enjoy the software. The only unsolving issue is that I won't be able to enjoy the option of working graphics in GPU mode due to my graphic card. It needs CUDA and intel doesn't support it. I'll keep on looking for answers to my trouble with AE CS6 in the web. 

  • Help with after effects cc application manager error

    ok i have a issue when i install adobe after effects cc it comes up with cant start trial application manager is damaged or corrupted and i downloaded adobe aplication manger 8 and it gives me this error
    does anyone have any ideas as i lost on what to do now
    thanks in advance elfen

    After checking we performed the test Next:
              Remove all fonts except the original.
              Test opening After Effects project => OK
              Then we submitted the most used by the graphics progessivement fonts.
    The problems is many Fonts, Thanks for your help Will  
    Cdlt

  • IPhone SDK Memory Management

    Hi,
    I have following code:
    (void) DismissWelcomeMessage: (UIAlertView *) view
    [view dismissWithClickedButtonIndex:0 animated:YES];
    (void) ShowWelcomeMessage
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Blah" message:@"Blah Blah" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [self performSelector:@selector (DismissWelcomeMessage:) withObject: alert afterDelay: WELCOMEMESSAGEDELAY];
    [alert release];
    ShowWelcomeMessage is called first.
    Why DissmissWelcomeMessage works fine and does not crash even though alert object is released?
    Is it because Dismiss function uses copy of the object passed on stack as a parameter to function? But even then would not it be just a copy of the pointer pointed to the now deallocated object?
    Or [alert release] just decriment reference counting and does not really do the same as delete in C++?

    [[alert release]] just decrements the release count. dealloc is called on alert, like on any object, when its reference count raise 0.
    The message [self performSelector:@selector (DismissWelcomeMessage:) withObject: alert afterDelay: WELCOMEMESSAGEDELAY]; queues an event which retains both self and alert. The Event Manager will release both after sending the message (after the delay).
    The comments below traces the retain count of alert
    (void) ShowWelcomeMessage {
    UIAlertView *alert = [UIAlertView alloc] initWithTitle:@"Blah" message:@"Blah Blah" delegate:self
    cancelButtonTitle:@"OK" otherButtonTitles:nil; // retain count = 1
    alert show;
    self performSelector:@selector (DismissWelcomeMessage:) withObject: alert
    afterDelay: WELCOMEMESSAGEDELAY; // retain count = 2
    alert release; // retain count = 1
    An advice: don't use uppercase method name. Only Class names should be uppercased
    (void) DismissWelcomeMessage: (UIAlertView *) view // should be "dismissWelcomeMessage"
    (void) ShowWelcomeMessage // should be "showWelcomeMessage"

  • Win 8.1 Lock Up After 5 min, "Memory Management" or "Cache Error"

    Systems blue screens every few minutes. MS offered a variety of error messages, now is uniformly "Memory Mangement". Chrome shows a Cache Error.
    Any ideas?

    Hello again TexasBooster,
    It is good to hear from you again!
    To contact our technical support, please call at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region.
    http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    I hope this helps!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • After Effects SDK 6 Skeleton Example Pixel load

    Hello,
    i'm new here and i'm new with the sdk 6 for AE.
    I tryed a lot of code to get all pixel from a frame.
    I want create a tonemaping plugin. I have a drago tonemapper base on C and i tryed to use the skeleton example from the sdk.
    My question is.
    How can i store all the pixel from a frame?
    I tryed something like this:
    scene = (SCENE*) malloc(sizeOf(SCENE)*width*height);
    scene is a struct with three floats, r g b.
    This dosen't work for me
    So and then is saw ATLAS:
    http://www.3dcg.net/software/atlas/
    It's a tonemapping plugin for AE. So i tryed to understand how it works.
    Next problem was, that i can not compile the atlas source code without errors.
    So i tryed to copy line by line.
    Now i can compile it without a error but AE crashed. And i don't know why.
    Can some body help me?
    I need only a fast and easy way to storage the pixel to use it for the drago tonmapping code. I use visual studio.
    Thank's a lot and sorry for my bad english
    greetz drewiss

    Hi Toby,
    in the noise sdk example, they iterate over the pixel and make a rendom noise.
    They do this (not only):
    if (niP){
                        tempF           = rand() % PF_MAX_CHAN8;
                        tempF          *= (niP->valF / SLIDER_MAX);
                        outP->alpha                    =          inP->alpha;
                        outP->red                    =          MIN(PF_MAX_CHAN8, inP->red + (A_u_char) tempF);
                        outP->green                    =          MIN(PF_MAX_CHAN8, inP->green + (A_u_char) tempF);
                        outP->blue                    =          MIN(PF_MAX_CHAN8, inP->blue + (A_u_char) tempF);
    But they didn't store the pixel, they get one do something and set the pixel.
    My problem is to store the pixel outside a iteration.
    Something like that...
    1.) Grab all the pixel with a iteration(?)
    2.) Call the tonemapping method
    3.) Set the new pixel to the output with a iteration(?)
    It this way possible?
    Thanks a lot!

  • After Effects memory HOG issues.

    I need help with RAM issues with After Effects.
    I open task manager Performance and just watch every bit of my 16 gig add up to a peak and stay there. Thus making it litterally impossible to work any further without a complete reboot of After Effects. Please advise anyone.
    Thanks
    Bill

    As La Ronde said start from the beginning... Which version of AE are you using?  CS6 has been configured to be more respetful of the RAM it uses whereas CS5 would stomp on any other available RAM without asking.  This CS6 change in RAM allocation has made it so users often get an error message that says AE needs 2 or more frames for playback, meaning there's not enough RAM to do a RAM Preview of just two frames.  If this is the case you can try going to Edit - Purge and clear the memory.  If that still doesn't work you might be forced to reboot.
    I'd also suggest going to After Effects - Preferences - Memory and Multiprocessing and playing with the settings there to see if it effects AE's overall performance.

  • Writing plug-in for After Effects

    I wish to write a character generator kind of a plug-in for After Effects.
    We have written similar plug-in for premiere which used to be created using the Import option in Adobe Premiere Pro.We managed to import our format and that was put on timeline, and then supplied content using our engine, when imImportImage callback was called.
    In PremeirPro there was only one entry point.
    What I got from reading the After effects SDK help was that there shall one entry point if we wish to write an effect.But we dont wish to write an effect but an importer.
    Will it be a AEGP plug-in?
    How should we go about it? Can we have a sample plug-in of such type, wherein a custom file format is implemented?
    regards
    Jasleen Kaur

    there are two sample projects in the sdk that would be of interest to you.
    1. IO (deals with importing and exporting of custom file types)
    2. FBIO (the same as the above, but deals with frame sequences and not with movies)
    there is one thing you should consider when doing this as an import plug-in:
    as opposed to premier, that seeks the original file every time to display it, AE caches frames.
    so even if you change the source, AE will not necessarily show that, until the "footage" is re loaded or AE starts recycling ram.
    you can change the preferences of AE so that it doesn't cache anything, but then you seriously impair AE's performance.

  • How to create an after effects plugin using c++?

    I've gotten to the point of downloading the after effects sdk. Although I am still lost and other than here, there are very little places where they give you proper information, if any at all, on how to develop after effects plugins using c++.

    我也在找同样的答案,求高手指点

  • After Effects CS6 Error

    When I render using h.264 I get the following error at the very end of the render: "After Effects can't continue. An output module has stopped responding. The file may be damaged or corrupt." I am rendering video game footage in .mp4 format, and I have completed countless renders using the same type of clips and the same settings in the past. My computer is a 6-Core AMD Phenom 2 with 8 GB DDR-3 RAM, 750 GB HDD, and an ATI Radeon HD 4250 graphics card, and I am running Windows 7 Ultimate 64-Bit. All drivers are up to date, the latest version of quicktime is installed, and all important windows updates are installed as well.
    Things I have tried already:
    Rendering to an external hard drive - failed.
    Changing how often after effects purges memory during the render - failed.
    Move all files over from my PC (where I do all the editing) to my Mac and render from there - same error message.
    Uninstall and reinstall Quicktime - failed.
    Import project as opposed to opening it - failed.
    What I also find odd is that when I render in parts, it works fine. If I render in two halves everything goes normally, which indicates that it isn't a problem with the clips I'm editing. I also tried rendering in Quicktime format using h.264 compression as opposed to just straight h.264, and that worked fine, which leads me to believe it's not a problem with quicktime. I haven't changed anything regarding new plugins or different footage than I've ever used in the past, and this error just started happening.
    Here is a screenshot of my render settings in case you need them, and if it makes any difference, the comp is about 4 minutes long and around 200 layers.
    http://gyazo.com/b53469649ef2622630491fe2f17d2e33
    I would appreciate any help I can get. Thanks so much!
    - Tyler

    Thank you for the speedy reply Dave.
    It's formatted for windows, but I only rendered onto that as a test to see if the issue was how much space I have on my built in HDD. Typically I just render onto that.

  • Adobe After Effects Disk Cache folder is massive!!!

    Hi. My mac computer is starting to get out of free space so I use omnidisk to do some cleaning on my computer and I notice that there a folder in user/library/preferences/adobe/after effect/11.0/Adobe After Effects Disk Cache - user's MacBook Pro.noindex/.... that has lots of different folders, named with numbers, that has hundreds if not thousands of files that goes from 100kb up to 9mb! The total space taken by these files are 49gb!!!
    I did some fast research in here: http://helpx.adobe.com/after-effects/using/memory-storage.html#caches_ram_cache_disk_cache _and_media_cache   and it says that after effects store some render data in the computer (i think )... but I'm really not going to open any of the old after effects files so my question is... can i delete that folder??? or is it vital for the program?
    By the way my computer has 750gb and 16gb of ram sooo yeah any help will be appreciated...

    Welcome to disk cache. You can set the disk cache size in the preferences. On my laptop I keep it at 6GB.  If you are using it you should be emptying it on a regular basis.

  • Frames in After Effects 5.5

    Umgang mit Frames im After Effects 5.5 SDK

    Gibt es im After Effects SDK 5.5 eine Funktion, die es ermöglicht auf ein bestimmtes Frame innerhalb der time line zu zu greifen??
    Beispiel: Mein Plug-in rendert gerade den Frame 8 von 20 Frames und innerhalb der Render Routine möchte ich nun auf Frame Nummer 7 und 6 zugreifen...
    Vielen Dank

  • What does "After Effects error: Not enough memory to initialize PSL. ( 83 :: 8 )" mean?

    So, about a week ago I did a fresh install of 64-bit Windows 7 Ultimate on a new PC, and subscribed to the Adobe Creative Cloud, installing After Effects CS6 and Photoshop CS6 from the Adobe Application Manager, then doing all updates (and I just checked right now at 10:35PM on July 26th, I have the latest versions of everything).
    After Effects was working completely normal, then just now, I tried to import a Photoshop .psd and I got the error message:
    After Effects error: Not enough memory to initialize PSL.
    ( 83 :: 8 )
    Then After Effects crashed. So now it opens up normally, but when I try to import a .psd or open an After Effects project saved from an earlier version of After Effects (CS3 to CS5) I get the same error and a crash, every single time.
    Searching the forums, I see people talking about this error when importing .psds into CS5, and they say that getting the latest updates solved the issue for them (which obviously can't help me). I'm running all legit software on a brand new computer with 32 GB of RAM which has passed all my physical stress tests so I know it's not hardware related.
    The one thing I saw people suggest is to hold down Ctrl-Alt-Shift when starting the program. When I do this, Windows asks if I want to allow After Effects to make changes to the system, and when I say yes, I can import .psds and open the older AE files. When I close After Effects and reopen it without holding down the Ctrl-Alt-Shift keys, it goes right back to crashing.
    Obviously the smart-*** answer is "then hold down Ctrl-Alt-Shift, dummy", and I'll do that for now, but is there any clue what the problem is?
    I feel like kind of a chump because I decided to stop using my student versions of Adobe software (I haven't been a student for about four years) and pay the full price for the cloud membership and the latest creative suite, and it's full of bugs.

    Now, I get the same ( 83 :: 8 ) error listed above, followed by a new dialog window that reads:
    After Effects error: Crash in progress. Last logged message was: <4488> <DynamicLink> <5> C:\Program Files\Adobe\Adobe Premiere Pro CS6\Adobe Premiere Pro.exe
    Then, when I click OK, I get:
    After Effects can't continue: sorry, After Effects has crashed. For After Effects Help and Support, go to http://www.adobe.com/go/learn_ae_support. If you still can't resolve the issue, please contact Adobe Technical Support (2).
    ( 0 :: 42 )
    Clicking OK to that gives me a chance to save the latest project, then the standard Windows 7 crash dialog window opens, the one that gives me the choice of "Check online for a solution and close the program" or just "Close the program" and lets me View problem details, which are:
    Problem signature:
      Problem Event Name:          APPCRASH
      Application Name:          AfterFX.exe
      Application Version:          11.0.0.378
      Application Timestamp:          4f6d63ab
      Fault Module Name:          StackHash_a85b
      Fault Module Version:          6.1.7601.17725
      Fault Module Timestamp:          4ec4aa8e
      Exception Code:          c0000374
      Exception Offset:          00000000000c40f2
      OS Version:          6.1.7601.2.1.0.256.1
      Locale ID:          1033
      Additional Information 1:          a85b
      Additional Information 2:          a85ba096cc6b6acabe6eaf35bf34dc60
      Additional Information 3:          f862
      Additional Information 4:          f86227a9dfa15a47cdb6c94bb0d08360

  • Memory problem with after effects... help!

    hello,
    i am having a strange issue where my pc will lock up after i minimize After Effects and try to access the file (quicktime, wmv, etc...) i just created. i am new to AE but i'm sure this isn't normal.
    any help here would be greatly appreciated.
    bilbob7624

    Mmh, if it gives you virtual memory errors, you have too many system processes running and your RAM is full. Not directly related to AE, but it explains the delays. What happens is, that any additional program you launch on such a crammed system forces other memory pages to be moved into the swap file so that RAM becomes available, making things slow in terms of user feedback. it also sometimes effectively disables file associations (it's a timeout in Windows' internal messaging system). Do you by any chance use Render Multiple Frames Simultanously? If so, try to render without it. Other than that there is not much you can do but sift through task manager and your Services control panel and see, which applications and tools consume al lthe resources, then try to disable unnecessary stuff. This would in particular apply to the millions of tools that place themselves in the system tray like virus scanners, update checkers, messengers, other widgets. Also close down other programs during rendering. Even a simple thing like a web browser can consume more than 120 MB of RAM (Firefox with a few extensions).
    Mylenium

Maybe you are looking for

  • Problem with spot channels when importing PSD into AI CS3

    tried the Windows forum, and adobe tech support in The Netherlands. Hopefully someone here can help. b Problem description: I make spot colour separations of full colour artwork by using the index separation method in Photoshop. This creates several

  • Adding second 5508 Wireless Controller, how to best configure for load balancing and redundancy?

    We recently purchased a second 5508 wireless controller (both licensed for 100+ AP's).  What is the easiest way to configure and add the second controller so I can split the load between the 2 controllers and provide failover capability?  I do not wa

  • Adobe Fixes Critical Problem, Keeps Fix from Some Users

    Before explaining my situation, I'll ask my question for the community up front: Is there a way for a single retail-licence holder like myself to get this patch or otherwise fix the text entry box focus problem? (Don't post stolen versions of the pat

  • IPhone Sync stuck at step 2: Backup.. After updating itunes to 10.6.1

    I have a iPhone 4 for over a year now and have never had ne problems. But after the last update of itunes to v10.6.1.7 each time I sync my phone with my pc the sync process hangs on step 2: backup. I have read a lot of forums and have tried everythin

  • HDD won't open when clicked on

    Hi there, Something strange has just happened with my computer. I was just loading some MP3s from a folder on my HDD into iTunes, when all of a sudden I couldn't open the folder titled 'Music' from where the MP3s came. This is not the same folder as