CGTalk > Software > The Foundry Modo
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 10-05-2004, 03:57 AM   #1
Join Date: Dec 2001
Posts: 40
writing a simple toggle?


I am used to mel, and have no experience in perl, unfortunately.
i was wondering if anyone can help me out in writing a simple toggle that i can then bind to a key.
something like a wireframe toggle.
i just want to be able to switch from no wire to colored.
this is what i wrote, but it doesn't work, hehe:

if((viewport.3dView wireframe:?) == "none")
{viewport.3dView wireframe:"colored";}
{viewport.3dView wireframe:"none";}

i saved it as a perl file and named it ""
then i typed "@E:\modoStuff\scripts\" into the cmd line.
it said it was a success in the results, but nothing happens, and i am not quite sure how to use lxout and stuff yet.

thanks for your time,
Old 10-05-2004, 04:57 AM   #2
çok oturgaçli götürgeç
kursad_pileksuz's Avatar
Join Date: Sep 2004
Posts: 612
why do not you just use a single command line and assign to a shortcut?. i have assigned many shortcuts to different view functions, like enabling vertices, wireframe etc. just run the viewport properties and enable something and track it from command line, i am guessing that you knew this but just in case
ben bir çok oturgaçli götürgecim.
Old 10-05-2004, 05:17 AM   #3
Join Date: Dec 2001
Posts: 40
i love your shit kursad, just so you know.
i check your site all the time.

i wanted to have a single button that can toggle the functionality as opposed to having to make a button for on and a button for off.

armaduck in #luxology on efnet helped me make this modo compliant.

if(lxq("viewport.3dView wireframe:?") == "none")
lx("viewport.3dView wireframe:\"colored\"");
lx("viewport.3dView wireframe:\"none\"");

Old 10-05-2004, 03:42 PM   #4
visualride's Avatar
david mr.
Senior VFX/Animator
San Ramon, US
Join Date: Apr 2004
Posts: 182
If you look in your resource directory (on my computer it is in: C:\Documents and Settings\Me\Application Data\Luxology\modo\resrc) you will find:

This does just what you want. There are a few options that I like to toggle off and on, so I assigned them to a pie menu. Search in here about pie menu's, because someone (I forget who) wrote very descriptive steps on how to set them up. Here's the contents of the wireframe toggle perl program:

my $cages, $guides;
$wire = lxq("viewport.3dView wireframe:?");
if ($wire) {
$wire = 0;
else {
$wire = 2;
lx("viewport.3dView wireframe:$wire");

Now I have a question for all the perl gurus that might view this. I was trying to create my own toggle for changing select style from lasso to rectangle. Here is what I got:

my $selStyle;
$selStyle = lxq("select.lassoStyle:?");
if ($selStyle) {
$selStyle = 0;
else {
$selStyle = 1;

I'm new to perl. Anyone know how I may debug this? Anyone know how I might be able to step through this code line by line and see the value of the variables?

Anyways, I hope this is what you needed zeebit. Good luck.
Old 01-19-2006, 11:00 AM   #5
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:49 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.