Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

get comp name and apply expression using it.

Guest
Apr 07, 2011 Apr 07, 2011

Hey Guys,

So basically, I've created a Vignette script using cc spotlight.  The only problem is, in order to link some expression between comps, I had to rename the main comp the vignette is being applied to.

Is there a way to get the name of a comp (the current item) and place it inside of an expression?

Here is a link to my script. It should make more sense when you check it out.

http://rapidshare.com/files/456403457/VB_Vignette3.jsx

Thanks for your help.

-Tyler

TOPICS
Scripting
3.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2011 Apr 07, 2011

If you have access to the comp object, you should be able to just drop its name into the expression string, like this:

var myExpr = 'comp("' + myComp.name + '").layer("layer name")......etc.

Or am I missing something?

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 07, 2011 Apr 07, 2011

Yeah, that's the problem......

I need to get the name of the "active item" (a comp in this case) and use that name inside of an expression.

Any thoughts?

Thanks!

(Dan you're awesome!, love three d corner pin;)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2011 Apr 07, 2011

If you're sure the active item is a comp, it should just be activeItem.name

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 07, 2011 Apr 07, 2011

Yeah, I figured out how to get the name of the comp, but getting that name inside of an expression is what is giving me trouble.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2011 Apr 07, 2011
LATEST

Are you saying you want the expression to resolve the name of the active item when it runs? That won't work.

If what you're trying to do is have the script resolve the name at the time the script runs and build that into the expression, then you'd do it the way I posted previously.

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines