Expression control to select a render mode in Particular 2

What type of scripts do you need?

Moderator: byronnash

Post Reply
esbowman
Posts: 10
Joined: February 25th, 2009, 1:34 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. :)

Code: Select all

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
Posts: 10
Joined: February 25th, 2009, 1:34 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:

Code: Select all

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: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

This should do it:

Code: Select all

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