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
zeebit
Veteran
 
Join Date: Dec 2001
Posts: 40
writing a simple toggle?

Hello,

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:

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


i saved it as a perl file and named it "wireframeTGL.pl"
then i typed "@E:\modoStuff\scripts\wireFrameTGL.pl" 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,
-zeebit
 
Old 10-05-2004, 04:57 AM   #2
kursad_pileksuz
çok oturgaçli götürgeç
 
kursad_pileksuz's Avatar
kursad
USA
 
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.
http://portfolio.plecxus.com/
 
Old 10-05-2004, 05:17 AM   #3
zeebit
Veteran
 
Join Date: Dec 2001
Posts: 40
i love your shit kursad, just so you know.
i check your site all the time.
hehe

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.

#perl
if(lxq("viewport.3dView wireframe:?") == "none")
{
lx("viewport.3dView wireframe:\"colored\"");
}
else
{
lx("viewport.3dView wireframe:\"none\"");
}

-zee
 
Old 10-05-2004, 03:42 PM   #4
visualride
PRO
 
visualride's Avatar
david mr.
Senior VFX/Animator
San Ramon, US
 
Join Date: Apr 2004
Posts: 179
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: MSWireframeToggle.pl.

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:

#perl
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:

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


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
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 01:45 AM.


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