AE ENHANCERS

Expressions/Scripts/Presets
It is currently Sun Nov 23, 2014 12:05 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Expression control to select a render mode in Particular 2
PostPosted: Sat Jul 16, 2011 7:44 pm 
Offline

Joined: Wed Feb 25, 2009 1:34 pm
Posts: 10
Hi guys. I've tried an if else statement but I'm a noob and have no clue what I'm doing here.

Problem

I have multiple layers in my comp using the Particular effect. All layers have their emitters parented to a null for ease of animating. Due to render issues I need to often times set the render mode for all 5-6 layers to Motion Preview instead of Full Render. I want to simply add a checkbox to the null layer that if true = motion preview on, if false = motion preview off (or full render on).

What I've tried...please don't laugh. :)

Code:
if(thisComp.layer("null for laser streak").effect("motion preview")("Checkbox")==true){
thisComp.layer("particular 2").effect("Particular")("Render Mode")=1;
}else{
thisComp.layer("particular 2").effect("Particular")("Render Mode")=0;}


I get the error: After Effects warning: Can't appear on the left hand side of an assignment, because it is read-only. Expression disabled. Error occurred at line 2. Comp: 'Comp 01', Layer:6 ('particular 2'), Property: 'Render Mode'.

Any suggestions?


Top
 Profile  
 
 Post subject: Re: Expression control to select a render mode in Particular
PostPosted: Sat Jul 16, 2011 7:55 pm 
Offline

Joined: Wed Feb 25, 2009 1:34 pm
Posts: 10
Answered my own question. I was overthinking it. I'd still like to know how to tie this to a checkbox instead but if i just use a slider and pick a value of 1 it selects the "Motion Preview" option, and if I go to 2 or above it is "Full Render". Simple enough and the code is just:

Code:
thisComp.layer("null for laser streak").effect("Slider Control")("Slider")


Checkbox would be a bit more refined, but this will work for now.


Top
 Profile  
 
 Post subject: Re: Expression control to select a render mode in Particular
PostPosted: Fri Jul 22, 2011 7:50 am 
Offline
Enhancement master
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 460
Location: New York City, NY
This should do it:

Code:
(thisComp.layer("null for laser streak").effect("motion preview")("Checkbox").value) ? 1 : 2

-Lloyd

_________________
http://aescripts.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group