Forum Replies Created
-
Chaz, you are welcome! While myself I landed into Extendscript with previous programming experience & knowledge, the courses from David Torno were amazing to begin with:
https://www.provideocoalition.com/after-effects-extendscript-training-complete-series/
He covers the basics of JS too, which could be pretty much enough to get your feet wet. And from there – the sky is the limit. Good luck !
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Chaz, here it is, tested, works as expected. With pure honesty – it doesn’t seem you know what programming logic is about, strongly suggest going through fundamentals before trying to modify any code. It will be simpler, and a lot more beneficial learning curve. Good luck !
for (var i = 1; i <= app.project.numItems; i++){
var curItem = app.project.item(i);
if (curItem.typeName == "Composition") {
ColoriseByType(curItem); // Run the function
}
}function ColoriseByType(comp) {
app.beginUndoGroup("Colorize By Type"); // Begin undo group
var layers = comp.selectedLayers; // Get selected layers
var colors = {
'none': 0, 'red': 1, 'yellow': 2, 'offwhite': 3, 'pink': 4, 'lavender': 5, 'peach': 6, 'audition': 7, 'blue': 8,
'green': 9, 'purple': 10, 'orange': 11, 'brown': 12, 'fuchsia': 13, 'cyan': 14, 'sandstone': 15, 'darkgreen': 16
}; // Label colors
var adjustmentlayer = colors['fuchsia'];
var avlayer = colors['cyan'];
var audiolayer = colors['audition'];
var cameralayer = colors['purple'];
var complayer = colors['sandstone'];
var guidelayer = colors['darkgreen'];
var lightlayer = colors['yellow'];
var nulllayer = colors['green'];
var shapelayer = colors['orange'];
var solidlayer = colors['blue'];
var textlayer = colors['red'];
if (layers != 0) { // If there is layer selection
for (var i = 0; i < layers.length; i++) { // Loop through layers
if (layers[i] instanceof AVLayer) {
layers[i].label = avlayer; // If avlayer
if (!layers[i].hasVideo) { layers[i].label = audiolayer; } // If audio layer
if (layers[i].source.mainSource instanceof SolidSource) { layers[i].label = solidlayer; } // If solid layer
if (layers[i].nullLayer == true) { layers[i].label = nulllayer; } // If null layer
if (layers[i].adjustmentLayer == true) { layers[i].label = adjustmentlayer; } // If adjustment layer
if (layers[i].source instanceof CompItem) { layers[i].label = complayer; } // If composition layer
}
if (layers[i] instanceof ShapeLayer) { layers[i].label = shapelayer; } // If shape layer
if (layers[i] instanceof TextLayer) { layers[i].label = textlayer; } // If text layer
if (layers[i] instanceof CameraLayer) { layers[i].label = cameralayer; } // If camera layer
if (layers[i] instanceof LightLayer) { layers[i].label = lightlayer; } // If light layer
if (layers[i].guideLayer) { layers[i].label = guidelayer; } // If guide layer
}
} else { // If there is no layer selection
for (var i = 1; i <= comp.layers.length; i++) { // Iterate through layers
if (comp.layer(i) instanceof AVLayer) {
comp.layer(i).label = avlayer; // If AVLayer
if (!comp.layer(i).hasVideo) { comp.layer(i).label = audiolayer; } // If audio layer
if (comp.layer(i).source.mainSource instanceof SolidSource) { comp.layer(i).label = solidlayer; } // If solid layer
if (comp.layer(i).nullLayer == true) { comp.layer(i).label = nulllayer; } // If null layer
if (comp.layer(i).adjustmentLayer == true) { comp.layer(i).label = adjustmentlayer; } // If adjustment layer
if (comp.layer(i).source instanceof CompItem) { comp.layer(i).label = complayer; } // If composition layer
}
if (comp.layer(i) instanceof ShapeLayer) { comp.layer(i).label = shapelayer; } // If shape layer
if (comp.layer(i) instanceof TextLayer) { comp.layer(i).label = textlayer; } // If text layer
if (comp.layer(i) instanceof CameraLayer) { comp.layer(i).label = cameralayer; } // If camera layer
if (comp.layer(i) instanceof LightLayer) { comp.layer(i).label = lightlayer; } // If light layer
if (comp.layer(i).guideLayer) { comp.layer(i).label = guidelayer; } // If guide layer
}
}
app.endUndoGroup(); // End undo group
}Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Here are few things you need to make, assuming all from previous post is done as described:
1. Change
function ColoriseByType()tofunction ColoriseByType(comp)
2. Deletevar comp = app.project.activeItem; // Get active compositionYou need to cover the basics on how functions works and how variables are passed/retrieved by different objects, within global/local scopes.
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Hey Chaz, there are few ways to make it to work, but the most simplest for you would be:
1. Instead of var comp = app.project.activeItem; you need to loop through project items (outside of ColoriseByType function)
for (var i = 1; i <= app.project.numItems; i++)2. Then, add conditioning:
var curItem = app.project.item(i);
if(curItem.typeName == "Composition"){
}3. If above condition true, run your function with the following line:
ColoriseByType(curItem)Since you are learning, I am purposefully not making it as a direct actionable code 😉
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Tomas Bumbulevičius
January 30, 2020 at 3:37 pm in reply to: Import a file + a couple more steps scriptDeanna, for this script to work you need to have composition in After Effects opened, and active, before running a script.
Alternatively, if this does not help, please share error you are getting and someone will be definitely able to help you out.
Cheers!
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Tomas Bumbulevičius
January 21, 2020 at 10:54 am in reply to: Importing illustrator files into after effects.Adobe few days ago released 17.0.2 update for AE – https://helpx.adobe.com/after-effects/kb/fixed-issues.html
Definitely suggest to upgrade ! The higher number of ‘X’es’ in the version 17.0.X , the more chances they get rid of malfunctions (:
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Tomas Bumbulevičius
January 21, 2020 at 10:49 am in reply to: Difficulty animating a line along motion pathHey Gabe, thanks for a clarification.
While I am not certain whether animation itself was made dynamically or manually with CC Particles, here is my take on this, to achieve it through shape layer instead.
1. Selection tracking data of position.
2. Copy it.
3. Create a shape layer.
4. Apply a single path to it with a pen tool.
5. Select path in layer stack and paste position data.
6. What you will get, is a path that matches position (might need to tweak its origin of placement)From this point, you could apply Trim paths and animate the line as it goes (yeah, manual stuff out there). BUT if you are going to do this in a loop, then it would be a matter of duplicating the line and increasing the stroke width.
Is this is something that might work for your case, or not at all?
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Tomas Bumbulevičius
January 20, 2020 at 8:12 am in reply to: counting bars and notes with expressions from a known bpmHey Sam, what might be the possibilities, that this execution uses external data, with all notions of params?
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Hey Steve, the best proven way for me personally to learn a new software – start with the basics. With that . said, fundamentals are crucial, thus for this reason I would recommend taking courses on Lynda or alternative – Cinema 4D Essentials.
This will give your feet wet in general, and you will build up a good understanding. From which, looking tutorials online is sufficient. Otherwise, you will be building specific skillsets here and there – but not a whole pack of knowledge systematically.
Hope this helps to find a more reliable path to catch on to !
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview -
Tomas Bumbulevičius
January 20, 2020 at 7:58 am in reply to: Importing illustrator files into after effects.Hey Marieke, make sure none of the following occurs:
1. When editing the file, it is not opened in .pdf or alternative.
2. When making changes, make sure you haven’t opened in ‘quickview’ look.These were two things I noticed in the past, which hindered files updates in Illustrator, While it might be not necessarily the case in this situation, worth checking it.
On a different end – knowing which versions of CC you are using could be helpful for others too.
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer – Dynamic Text Boxes Template with a Live Preview
Social Media Profiles