ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Creating a 'Shy'(hidden) layer through script?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alan MogerCreating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 4:10:37 pm

Hey, I'm fairly new to scripting and I've scoured the web for this answer and can't find it, it's probably something so simple that no-one's needed to put it out there anywhere, I've found in the After Effects Script manual the closest thing being:

"Layer shy attribute
app.project.item(index).layer(index).shy
Description
When true, the layer is “shy,” meaning that it is hidden in the Layer panel if the composition’s “Hide all shy
layers” option is toggled on."


when paired with:

CompItem hideShyLayers attribute
app.project.item(index).hideShyLayers
Description
When true, only layers with shy set to false are shown in the Timeline panel. When false, all layers are visible,
including those whose shy value is true. Corresponds to the value of the Hide All Shy Layers button in the
Composition panel.


Which is completely not working for me.
Anyway, here's the script so far.
Thanks in advance!

{
app.beginUndoGroup("Hidden Script");

// Selected Composition
var comp = app.project.activeItem;
// Selected Layers
var slctd_layer = comp.selectedLayers;

// Create new Solid
var new_layer = comp.layers.addSolid([0,0,0], "Background", comp.width,comp.height,comp.pixelAspect,comp.duration).trackMatteType = TrackMatteType.ALPHA_INVERTED;
;
// Create the letterbox Solid
var hidden_solid= comp.layers.addSolid([0,0,0], "Hidden", 1920, 817, comp.pixelAspect,comp.duration);
// if so move the new Layer on top of the selected one
if ( slctd_layer[0] != null){
//alert (slctd_layer[0].index);
new_layer.moveBefore(slctd_layer[0]);

app.endUndoGroup();
}

}


Return to posts index

Dave LaRondeRe: Creating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 6:15:42 pm

Sounds like an interesting intellectual exercise.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Walter SoykaRe: Creating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 6:50:50 pm

You're trying to make the "Hidden Solid" layer shy?

hidden_solid.shy = true;
comp.hideShyLayers = true;


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Alan MogerRe: Creating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 8:13:23 pm

That worked for my next question so thank you for that. Although, I mustn't have phrased myself correctly, I mean the "hidden layer" needs to be non-visible (the eye icon on the left of it not showing) so that the alpha matte layer below can be seen?


Return to posts index

Walter SoykaRe: Creating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 8:15:51 pm

Ah, that's not what "shy" means. Shy layers are hidden in the UI when the comp shy switch is enabled.

The property you're asking is about is "enabled."

hidden_solid.enabled = false;

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Alan MogerRe: Creating a 'Shy'(hidden) layer through script?
by on May 7, 2015 at 8:17:13 pm

That is absolutely perfect, thank you very much. I was toying around with the wrong property- that being 'Visible' silly me.


Return to posts index

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