Spot check in autograf with variable timeline
-
Hi,
This is more of an AE question, but is it possible to tie composition markers to a frame in each composition on our template’s timeline? The compositions on the timeline vary in length with each job we process. We’d like to use spot checking to look at a specific frame in each composition, but because they can vary in length with data, I don’t see how I can place composition markers that will change position based on whether a composition changes in length. Thanks for any suggestions.
Pete
-
After doing a bit of experimentation, I believe you could probably achieve something similar to what you’re describing using an After Effects ExtendScript in conjunction with Templater’s Event Script Function. There’s a function in ExtendScript named
markerValue
(reference here) that I think will be most useful in this scenario.Using
setValueAtTime
, I was able to create a new composition marker using a variety of variables (time, layer position, etc.). Here’s the end result of my experimentation:var myTarget = "Comp1"; var myMarker = new MarkerValue("Marker Comment"); var myComp; for (var i = 1; i <= app.project.numItems; i ++) { if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === myTarget)) { myComp = app.project.item(i); break; } } var markerTime = myComp.layer("test").inPoint; myComp.markerProperty.removeKey(1); myComp.markerProperty.setValueAtTime(markerTime, myMarker);
This script should look for a comp named “Comp1” and a layer called “test”. Once it finds both of those, it should create a new Marker with the comment “Marker Comment” at the
inPoint
of the “test” layer.Just to walk through the logic here, the “
myComp
” section is getting the index value of “Comp1”. The “markerTime
” variable is finding theinPoint
of the “test” layer, and the “removeKey
” section is removing the existing Comp Marker before creating the new one with the “setValueAtTime
” option.A few quick notes. This script is very basic and will fail if it can’t find an existing Comp Marker to remove. It’s also only set up to delete a single Comp Marker. If you’d like to add more stability to the function, check out this post on Stack Overflow for a discussion on setting up a loop to identify and remove Comp Markers by name.
Finally, it should be noted that if you’d like to set the Marker by time rather than the position of another layer, the “
markerTime
” variable can be swapped with an integer representing the time where you’d like the variable to be placed.Hopefully, this is enough to get you moving in the right direction, but if you have any questions, just let us know.
Thanks!
-
Hi Jeff. This is great info! At the moment ExtendScripts are a bit of a mystery on this end - what do we need setup on our render system(s) to be able to run an ExtendScript?
Pete
-
It can depend quite a bit on how your systems are configured, but I’ll try and outline the basics here. To run Event Scripts, the first thing you’ll need is a copy of Templater Bot. Event Scripts are only available on this version of Templater, so if you’re using Pro or Rig, this won’t be an option.
Once you’ve got Bot set up, head to the Templater Preferences window and click on “Setup ExtendScripts”. From there, you should get a box that will allow you to choose which Templater event you’d like to use to trigger the Event Script.
When I tested the script outlined above, I registered it on the “After layers update” event under “Layer Processing”. This instructs the script to run after any data versioning and Time Sculpting have been applied to the project.
If you’re running Templater via CLI, you’ll want to specify the script you’d like to run in the
templater-options.json
file on the appropriate Event. In this case, you’d want to add it to the “post_cmd_update
” event.Those are the basics, but more information can be found in this article from our support website. Additionally, we have some example scripts on our GitHub Page located here.
If you run into any hurdles or if we can answer any questions, just let us know!
Thanks!