FORUMS: list search recent posts

script to know when camera tracker is finished solving ?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Crooks
script to know when camera tracker is finished solving ?
on Sep 10, 2015 at 2:02:51 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


Return to posts index

Dan Ebberts
Re: script to know when camera tracker is finished solving ?
on Sep 10, 2015 at 3:05:02 am

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

Dan



Return to posts index

Daniel Crooks
Re: script to know when camera tracker is finished solving ?
on Sep 10, 2015 at 3:14:25 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.


Return to posts index


Miguel de Mendoza
Re: script to know when camera tracker is finished solving ?
on Sep 10, 2015 at 7:50:53 am
Last Edited By Miguel de Mendoza on Sep 10, 2015 at 9:37:12 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.


Return to posts index

Daniel Crooks
Re: script to know when camera tracker is finished solving ?
on Sep 11, 2015 at 12:05:05 am

nice idea Miguel, I'll give it a go and report back...


Return to posts index

Daniel Crooks
Re: script to know when camera tracker is finished solving ?
on Sep 11, 2015 at 3:03:33 am
Last Edited By Daniel Crooks on Sep 11, 2015 at 5:16:32 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...


Return to posts index


Daniel Crooks
Re: script to know when camera tracker is finished solving ?
on Sep 13, 2015 at 10:03:37 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 - http://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)
}


Return to posts index

Harry Hoag
Re: script to know when camera tracker is finished solving ?
on Feb 25, 2019 at 11:53:45 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?


Return to posts index

Daniel Crooks
Re: script to know when camera tracker is finished solving ?
on Feb 25, 2019 at 10:50:04 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]