FORUMS: list search recent posts

Get Transform-settings on selected layer in comp.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacob Danell
Get Transform-settings on selected layer in comp.
on Jul 20, 2013 at 8:14:37 pm

Hi! I'm trying to extract information from a selecte precomp in the timeline.
Right now the script looks like this:


var activeItem = app.project.activeItem; //Selected Item
var selectedLayer = activeItem.selectedLayers[0]; //Selected Layer
var maincompHeight = selectedLayer.height; //Maincomps height
var maincompWidth = selectedLayer.width; //Maincomps width

/*Alert-test*/
alert (selectedLayer.duration);


so I easy can see if it's working.
I can get height and width without any problems but I need to get the duration, pixelaspect and framerate but I'm not possible to do it with my script at the moment. I only get "undefined".


Return to posts index


Dan Ebberts
Re: Get Transform-settings on selected layer in comp.
on Jul 20, 2013 at 9:17:17 pm

Try this:

selectedLayer.source.duration


Dan



Return to posts index

Jacob Danell
Re: Get Transform-settings on selected layer in comp.
on Jul 20, 2013 at 9:19:11 pm

Perfect! How could I miss it. Thank you!


Return to posts index

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