Getting After Effects to work locally in a global world

While I was creating the end board templates for our eBotswana promos at e.tv, I had a problem that when I wanted to move a layer using numerical values in the time line, it would use global not local co-ordinates. The layers I wanted to modify were at an angle in 3D space, so the movement went in the wrong direction, as you can see below.

I needed the ability to change single axes in local space, specifically along the local x co-ordinates of the layer. If I could do that, then any manual changes while designing would be accurate and not affect the y or z position of the layer. Any animation or expressions would then also be easier to set up. Lastly, it would be easier to understand for my colleagues, who would be coming to the project with fresh eyes.

So I wrote a short expression in the position of the layer. I used a '3D point' effect to allow me to have an input to offset the current position.

The result was an animated layer that I could control very accurately via the 3D point control effect in the layers local space.

Here is the code if you want to use it in your projects.

/* Create variables */
var pos = thisComp.layer("Text placement 00").transform.position; /* current position of layer */
var offset = effect("Offset")("3D Point"); /* 3D point effect on layer */
/* Do the math */
lpos = fromWorldVec(pos); /* converting layer position from world to local space */
newpos = toWorldVec((lpos+offset)); /* adding converted local co-ordinates and offset. Then converting back to world space */
/* Result */
[newpos[0], newpos[1], newpos[2]] /* final result pluged back into postion values of layer */

Getting designers to be organised...not that impossible

I needed to devise a method  in which to unify the way my motion graphics team worked. Everyone had their own folder structure and system of naming their files. I needed to create order from the chaos.

So I designed a 'project creator' in Apple Script. I really liked the way I could have this utility up in the top corner of the screen, where it is easy for the designer to click on it.

It asks the user a simple set of questions. What is the project called? What channel is it for? Is it a promo, imaging project or a toolkit?

The result is a folder structure that is created on the users work drive, with a consistent naming scheme and all the relevant folders that are needed. The project folder is always prefixed with the date of creation. It helps to organise the project chronologically and to find old projects months after you have finished with it.

I found Apple Script to be quite a different language to code in comparison to other languages. It has a unique syntax that is supposedly easier for humans to read. I am not convinced of that, but I still loved using it and because of it being so closely tied to the operating system, it makes it very powerful. It reminds me of using AREXX on my Amiga computers back in the nineties. Now that was a fantastic computer and the scripting integration was top notch, but that is a story for another day.

Below is the script I made. It is my first time in Apple Script, so you experienced coders out there might have a few things to say, and I do welcome all comments.

-- setting the variables

set theProject to ""
set theChannel to ""
set theType to ""
set theTypePrime to "00_Created Toolkits"
set toolkitType to ""
set theIcon to 0
set theDate to current date
set theDay to ""
set theMonth to ""
set theYear to ""
set theProjectname to ""
set theDisk to "WASD"
set Synology to "Synology"
set etvtoolkitPreset to "Toolkit:03 Toolkits_e.tv:14e_022_TE:14e_022_TE_V06.aep"
set etvprimePreset to "Synology:00 Toolkit Templates:Endboards Template:20150319_TE_Template_V04.aep"
set combosPreset to "Synology:00 Toolkit Templates:Combos_Template:Combos_Template.aep"
set nextupPreset to "Synology:00 Toolkit Templates:Next Up Template:Next Up Template V06.aep"
set strapPreset to "Synology:00 Toolkit Templates:Straps_Template:Strap Template_V01.aep"
set mctoolkitPreset to "Toolkit:03 Toolkits_Multichannel:021_MC_Topical Endboards_V12:021_Topical Endboards_V13.aep"
set ebtoolkitPreset to "Toolkit:03 Toolkits_eBotswana:eB_022_TE_Flattened HD_V02:eB_022_TE_Flattened HD_V02.aep"
set etvtoolkitFile to "14e_022_TE_V06.aep"
set etvprimeFile to "20150319_TE_Template_V04.aep"
set mctoolkitFile to "021_Topical Endboards_V13.aep"
set ebtoolkitFile to "eB_022_TE_Flattened HD_V02.aep"
set combosFile to "Combos_Template.aep"
set nextupFile to "Next Up Template V06.aep"
set strapFile to "Strap Template_V01.aep"
set newPath to ""
set newName to ""

-- converting the date into a usable string

if day of theDate < 10 then
set the theDay to "0" & day of theDate
else
set theDay to day of theDate
end if

if ((month of theDate) * 1) < 10 then
set the theMonth to "0" & (month of theDate) * 1
else
set theMonth to (month of theDate) * 1
end if

if ((year of theDate) * 1) > 10 then
set the theYear to (year of theDate) * 1 as string
else
set theYear to (year of theDate) * 1 as string
end if

-- asking the questions

display dialog "What is the project name?" default answer theProject with icon theIcon
set theProject to text returned of result

choose from list {"Multichannel", "e.tv", "eKasi+", "eMovies+", "eAfrica+", "eToonz+", "BeatLab", "OpenView HD", "eNCA", "eAfrica", "eBotswana", "eGhana", "Miscellaneous"} with prompt "What channel is this for?"
set theChannel to result as text

display dialog "Is this a promo, toolkit or an imaging project?" buttons {"promo", "imaging", "toolkits"}
if button returned of result = "promo" then
set theType to "Promos" as text
else if button returned of result = "imaging" then
set theType to "Channel Imaging" as text
else
set theType to "00_Created Toolkits" as text
end if

if theType = "00_Created Toolkits" then
set toolkitType to choose from list {"nextup", "combo", "endboard daytime", "endboard primetime", "strap"} with prompt "Is this toolkit a nextup, combo or an endboard?"
if toolkitType contains "nextup" then
set theType to "00_Created Next ups" as text
else if toolkitType contains "combo" then
set theType to "00_Created combos" as text
else if toolkitType contains "endboard daytime" then
set theType to "00_Created Toolkits" as text
else if toolkitType contains "endboard primetime" then
set theType to "00_Created Toolkits Prime" as text
else if toolkitType contains "strap" then
set theType to "00_Created Straps" as text
end if
end if
-- creating the full project name and make folders for Imaging

if theType = "Channel Imaging" then
set theProjectname to theYear & theMonth & theDay & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk theDisk) then
make new folder of disk theDisk with properties {name:theType}
end if
end tell

tell application "Finder"
if not (exists folder theChannel of folder theType of disk theDisk) then
make new folder at folder theType of disk theDisk with properties {name:theChannel}
end if
(*-- set the colour of the folder
if theChannel = "e.tv" then
set label index of result to 2
else if theChannel = "eKasi+" then
set label index of result to 6
else if theChannel = "eMovies+" then
set label index of result to 5
else if theChannel = "eAfrica+" then
set label index of result to 1
else if theChannel = "eNCA" then
set label index of result to 4
else if theChannel = "eToonz+" then
set label index of result to 3
end if
*)
end tell

tell application "Finder"
make new folder at folder theChannel of folder theType of disk theDisk with properties {name:theProjectname}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"01 Documents"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"02 Reference"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"03 External Elements"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"04 Internal Elements"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"05 Photoshop"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"06 Illustrator"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"07 After Effects"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"08 Cinema 4D"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"09 Flash"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"10 Premiere"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"11 Test Renders"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"12 Approvals"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"13 Process Renders"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"14 Final Renders"}
make new folder at folder theProjectname of folder theChannel of folder theType of disk theDisk with properties {name:"15 Trash"}

end tell

-- creating the full project name and make folders for Toolkits daytime

else if theType = "00_Created Toolkits" then
set theProjectname to theYear & theMonth & theDay & "_TE_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk Synology) then
make new folder of disk Synology with properties {name:theType}
end if
end tell

tell application "Finder"
make new folder at folder theType of disk Synology with properties {name:theProjectname}
-- set the colour of the folder
if theChannel = "e.tv" then
set label index of result to 2
else if theChannel = "eKasi+" then
set label index of result to 6
else if theChannel = "eMovies+" then
set label index of result to 5
else if theChannel = "eAfrica+" then
set label index of result to 1
else if theChannel = "eNCA" then
set label index of result to 4
else if theChannel = "eToonz+" then
set label index of result to 3
else if theChannel = "BeatLab" then
set label index of result to 7
end if
make new folder at folder theProjectname of folder theType of disk Synology with properties {name:"Finals"}
if theChannel = "e.tv" then
copy file etvtoolkitPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & etvtoolkitFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
else if theChannel = "eBotswana" then
copy file ebtoolkitPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & ebtoolkitFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
else
copy file mctoolkitPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & mctoolkitFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
end if

end tell

-- creating the full project name and make folders for Toolkits primetime

else if theType = "00_Created Toolkits Prime" then
set theProjectname to theYear & theMonth & theDay & "_EB_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theTypePrime of disk Synology) then
make new folder of disk Synology with properties {name:theTypePrime}
end if
end tell

tell application "Finder"
make new folder at folder theTypePrime of disk Synology with properties {name:theProjectname}
set label index of result to 5
make new folder at folder theProjectname of folder theTypePrime of disk Synology with properties {name:"Finals"}
copy file etvprimePreset to folder theProjectname of folder theTypePrime of disk Synology
set newPath to Synology & ":" & theTypePrime & ":" & theProjectname & ":" & etvprimeFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName


end tell


-- creating the full project name and make folders for Nextups

else if theType = "00_Created Next ups" then
set theProjectname to theYear & theMonth & theDay & "_NU_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk Synology) then
make new folder of disk Synology with properties {name:theType}
end if
end tell

tell application "Finder"
make new folder at folder theType of disk Synology with properties {name:theProjectname}
make new folder at folder theProjectname of folder theType of disk Synology with properties {name:"Finals"}
copy file nextupPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & nextupFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
end tell



-- creating the full project name and make folders for Combos

else if theType = "00_Created combos" then
set theProjectname to theYear & theMonth & theDay & "_CB_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk Synology) then
make new folder of disk Synology with properties {name:theType}
end if
end tell

tell application "Finder"
make new folder at folder theType of disk Synology with properties {name:theProjectname}
make new folder at folder theProjectname of folder theType of disk Synology with properties {name:"Finals"}
copy file combosPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & combosFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
end tell


-- creating the full project name and make folders for Straps

else if theType = "00_Created Straps" then
set theProjectname to theYear & theMonth & theDay & "_ST_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk Synology) then
make new folder of disk Synology with properties {name:theType}
end if
end tell

tell application "Finder"
make new folder at folder theType of disk Synology with properties {name:theProjectname}
make new folder at folder theProjectname of folder theType of disk Synology with properties {name:"Finals"}
copy file strapPreset to folder theProjectname of folder theType of disk Synology
set newPath to Synology & ":" & theType & ":" & theProjectname & ":" & strapFile
set newName to theProjectname & ".aep"
set the name of file newPath to newName
end tell



-- creating the full project name and make folders for Promos

else if theType = "Promos" then
set theProjectname to theYear & theMonth & theDay & "_" & theChannel & "_" & theProject
tell application "Finder"
if not (exists folder theType of disk theDisk) then
make new folder of disk theDisk with properties {name:theType}
end if
end tell

tell application "Finder"
make new folder at folder theType of disk theDisk with properties {name:theProjectname}
(*-- set the colour of the folder
if theChannel = "e.tv" then
set label index of result to 2
else if theChannel = "eKasi+" then
set label index of result to 6
else if theChannel = "eMovies+" then
set label index of result to 5
else if theChannel = "eAfrica+" then
set label index of result to 1
else if theChannel = "eNCA" then
set label index of result to 4
else if theChannel = "eToonz+" then
set label index of result to 3
end if
*)

make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"01 Documents"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"02 Reference"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"03 External Elements"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"04 Internal Elements"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"05 Photoshop"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"06 Illustrator"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"07 After Effects"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"08 Cinema 4D"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"09 Flash"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"10 Premiere"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"11 Test Renders"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"12 Approvals"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"13 Process Renders"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"14 Final Renders"}
make new folder at folder theProjectname of folder theType of disk theDisk with properties {name:"15 Trash"}

end tell
end if

Putting a bug to air - Orad style

Part of the huge change that is going on at e.tv is our on air graphics system. We invested in 6 Orad 3DPlay systems (Now part of Avid). For those of you who don't know what these systems are, here is a quick primer. 3DPlay is a real time graphics play out device that can be controlled either via automated events coming from the schedule of the channel or manually for live events. So elements like bugs, straps, age restrictions, etc are all controlled via this system. Its power comes from being able to create relationships between your different graphic elements so that you can have a synergy and intelligence in layout and animation on screen.

The 3D Play interface with actions defined for the FCC crew.

The 3D Play interface with actions defined for the FCC crew.

For e.tv, this system is part of a huge upgrade to our workflows, with a lot of the small repetitive work being done via the automated systems. This will allow us to focus on bigger, more elaborate aspects of the channels identity and promotion.

I was charged to get the system up and running with the engineering, FCC and scheduling teams.

So after two great training sessions with the Orad team I set to work. My first objective was to get the current on air toolkit for all 5 channels running on the new system before we started to implement new dynamic elements. At the same time I did a tidy up of the toolkit so that the viewer navigation was a little more elegant.

The bugs are set up to move to either the top left or right of the screen. They are the anchor of the entire on-screen experience. All other elements will come from there. So the age restrictions, straps, tags etc will move and animate relative to where the bug is. When the bug is triggered to come off, it first checks to see if the age restrictions are still on screen and pulls those off first before taking itself off air.

I have found that I have revisited these templates for the bugs a couple of times already, as I find better ways of implementing them the more I learn about the system. I suspect this will happen again in the future.