ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Remove all fills in a shape layer?

COW Forums : Adobe After Effects Expressions

Respond to this post   •   Return to posts index   •   Read entire thread

John Colombo
Re: Remove all fills in a shape layer?
on Nov 8, 2016 at 12:26:14 am
Last Edited By John Colombo on Nov 11, 2016 at 8:14:13 am

Give this one a try! I was looking for the same feature to quickly remove fills. With that in mind, I took some snippets from Miguel's code and made it loop through all the selected layers.

This script will toggle the fills without removing them.

Also, holding Alt (or Option) will toggle strokes instead of fills. Watch out for the "<=" in the second for(){} loop, the code box seems to mess it up.


// Define variables
app.beginUndoGroup("Remove Fill on Shape Layer");
var myComp = app.project.activeItem;
var myLayer = myComp.selectedLayers;
var myKeyState = ScriptUI.environment.keyboardState;

try {

for (var i=0;i<myLayer.length;i++){

if (myLayer[i] instanceof ShapeLayer){

//alert("This is a shape");
var contents = myLayer[i].property("ADBE Root Vectors Group");

for(s = 1; s <= contents.numProperties ; s++){
var shape ="Contents");
if (myKeyState.altKey == true){
if("ADBE Vector Graphic - Stroke").active == false){"ADBE Vector Graphic - Stroke").enabled = true;
}else{"ADBE Vector Graphic - Stroke").enabled = false}
if("ADBE Vector Graphic - Fill").active == false){"ADBE Vector Graphic - Fill").enabled = true;
}else{"ADBE Vector Graphic - Fill").enabled = false;}

continue //skip non-shape layers
alert(err.line + "n" + err.toString());

John Colombo
Lead Creator
1Resonant Creation

Posts IndexRead Thread 

Current Message Thread:

© 2019 All Rights Reserved