Expressions/Scripts/Presets

Moderator: byronnash

 
esbowman
Topic Author
Posts: 10
Joined: Wed Feb 25, 2009 1:34 pm

Expression control to select a render mode in Particular 2

Sat Jul 16, 2011 7:44 pm

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. :)

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?
 
esbowman
Topic Author
Posts: 10
Joined: Wed Feb 25, 2009 1:34 pm

Re: Expression control to select a render mode in Particular

Sat Jul 16, 2011 7:55 pm

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:

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


Checkbox would be a bit more refined, but this will work for now.
 
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: Thu Jun 17, 2004 9:27 am
Location: New York City, NY
Contact:

Re: Expression control to select a render mode in Particular

Fri Jul 22, 2011 7:50 am

This should do it:

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

-Lloyd

Who is online

Users browsing this forum: No registered users and 2 guests