Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions script to know when camera tracker is finished solving ?

  • script to know when camera tracker is finished solving ?

    Posted by Daniel Crooks on September 10, 2015 at 2:02 am

    hi people

    I’ve written a script that sets up multiple comps each with a clip to be 3D camera tracked. This has worked great in the past but now I’m using some quite large 4K clips and the tracker is very resource intensive hence i can’t have them all working away together. So what i really need to do is a have the script setup each comp consecutively but to do this it needs to know when the tracker has finished solving the track for each comp/clip. I cant see any way to do this, and really hoping someone has a cunning workaround…

    cheers../daniel

    Daniel Crooks replied 7 years, 2 months ago 4 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    September 10, 2015 at 3:05 am

    I don’t use the tracker much, but what indication do you get (that it’s finished) when you do it manually?

    Dan

  • Daniel Crooks

    September 10, 2015 at 3:14 am

    hey Dan

    this is the tricky part, it all happens in the background, the only indication that the tracking process has completed is the ‘solving’ banner disappears from the footage in the comp.

  • Miguel De mendoza

    September 10, 2015 at 7:50 am

    Assuming that you cant’t stack the diferent track tasks in a for loop, maybe, you can check if numKeys attribute from one of the keyed properties, of the Motion Traker property, is equal to the clip number of frames. If it’s equal, do the next track.

    Edit: I missread you’re using 3d Camera tracker. If you acces “ADBE 3D Tracker-0011″(by index: 2) property on the camera tracker, the name will be updating while analizing: “2%(frame x of n”). It seems that the info behind the name is hidden, so maybe using a timer to start checking the name of this property until its an empty string or the % is 100 can work.

  • Daniel Crooks

    September 11, 2015 at 12:05 am

    nice idea Miguel, I’ll give it a go and report back…

  • Daniel Crooks

    September 11, 2015 at 3:03 am

    argh…. so close.
    after a lot of phaffing around I finally got the script to register when the tracking had completed (using the status name string) but unfortunately this happens at the end of the first pass, not the end of the final solve. I can’t see any way to work that out. The only change in the UI is the “solving” banner disappearing and the “create camera” button becoming active but I can’t for the life of me work out a way to access either of these events…

  • Daniel Crooks

    September 13, 2015 at 10:03 am

    so my next attempt was to use a timer, basically allow a set amount of time for each comp to finish solving and then queue up the next one. It’s rather inefficient but a lot less so than baby-sitting each comp. I put a line in the timer function which updates the info panel with a basic countdown for each comp being setup. It’s kind of crude but it does the job… on the mac

    …argh. On the PC it all starts fine but then about 5 seconds into the process the countdown stops in the info panel and the resource manager shows no instance of the analysis server running. The script will eventually finish as it should but when i open the resulting projects the layers with the Camera Tracker effect applied have analysed a total of zero frames… so frustrating.

    any ideas ?

    as a reference the delay function i’m using I found here – https://www.wer-weiss-was.de/t/delay-mit-javascript/1143593 – It works fine on the Mac, AE keeps right on trucking but it seems to pause After effects as well on the PC ?

    Ae CC14 and Windows 8.1

    function delay(prmSec)
    {
    prmSec *= 1000;

    var eDate = null;
    var eMsec = 0;

    var sDate = new Date();
    var sMsec = sDate.getTime();

    do {
    eDate = new Date();
    eMsec = eDate.getTime();

    } while ((eMsec-sMsec)
    }

  • Harry Hoag

    February 25, 2019 at 11:53 am

    Hi Daniel, did you get your script working? I’m trying to get something similar working with the face tracker. I need to track a big long sequence of layers, I was thinking I’d set off the next one once the playhead reaches the out point of the current layer.

    I’m fairly confident with expressions but scripting is another level to me would be great to use your script as a starting point if that’s alright?

  • Daniel Crooks

    February 25, 2019 at 10:50 pm

    Hi Harry

    I never did get it to work, there simply wasn’t enough scriptable access to the background processes going on with the tracker. Perhaps things have changed a bit since then ? I’ll have a rummage around and see if I can find the last version of my test script…

    ../daniel

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy