Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   expression problem with a visibility toggle (https://simplymaya.com/forum/showthread.php?t=15894)

lori_hunter 15-03-2005 07:53 AM

expression problem with a visibility toggle
 
hi guys

i've created 2 new boolean attributes (called hiRes and loRes) for my subdiv root mesh and connected them to the Visibility attribute of my subdiv shape and poly-proxy cage (respectively).

It's working fine - now i can enter 1 or 0 in the channel box to turn them on or off.

The problem is i want to create a toggle so that when 1 is on, the other is off (hidden). I tried writing this expression but something's wrong. when i execute, it goes through without any errors, but i can't change the attribute value in the channel box (the field has turned purple).

this is what i wrote:

if (polyToSubd1.hiRes=on)
polyToSubd1.loRes=off;
else
polyToSubd1.loRes=on;

can anyone help? sorry am an expression / scripting novice and i know next to nothing about these things! :)

thanks
Lori

lori_hunter 16-03-2005 12:28 AM

never mind found the problem:

first line should read if (polyToSubd1.hiRes==on)

thanks for reading!

:)


All times are GMT. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018