Share your Macros and Layouts

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
  09 September 2004
i got a question on scripting toggle keys.( unless theres an easier way to do this. )

lets say that i want to make a single command that toggles wireframe on. and off.
the script would work something like

if wire "off"
then wire "on"

if wire "on"
then wire "off"

something like that. but i dont know any of the scripting languages to do this. so an example would rock how to make the if/then statements in either perl or xml, or whatever?
 
  09 September 2004
Quote: lets say that i want to make a single command that toggles wireframe on. and off.
the script would work something like
Theres actually a script that comes with modo that does this. Its located in Modo\resrc\MSWireframeToggle.pl

Heres the script itself:

#perl
my $cages, $guides;
$wire = lxq("viewport.3dView wireframe:?");
if ($wire) {
$wire = 0;
}
else {
$wire = 2;
}
lx("viewport.3dView wireframe:$wire");
 
  09 September 2004
Here are a couple of macros I find useful.

The first is for fixing symmetry. You select the half of your model that you don't like and run the macro. The macro deletes the selected half and mirrors what's left. Simple but quite useful. Of course if you have special vmaps on the selected half you don't want to use this because it will kill them...
http://www.podagraph.com/scripts/mo..._mirrorHalf.lxm

The other is even simpler but I still use it often. It simply opens a Command History window.
http://www.podagraph.com/scripts/mo...storyWindow.lxm

You can run these by hitting F6 and selecting the file or you can assign it to a hotkey by opening the Key Editor (F2) and adding an @ followed by the script name including full path next to the Key of your choice. If you already ran a script once you can also just open the Command History Window and RMB on the script on the History tab. modo will present you with an option to Map To Key.

Hope someone finds these useful.
 
  09 September 2004
Ok, I can figure out how to create a button but linking it to a file is not working. It looks like you use the c: for the PC, what do you use for the MAC?

command: @scriptName/MacintoshHD/ ...... / ....... ?

The mirror script looks very helpful!
 
  09 September 2004
Originally Posted by Xacto: Ok, I can figure out how to create a button but linking it to a file is not working. It looks like you use the c: for the PC, what do you use for the MAC?

command: @scriptName/MacintoshHD/ ...... / ....... ?

The mirror script looks very helpful!


more like this:

@/Users/home/scriptName.pl
__________________
-Eric
 
  09 September 2004
Quick tip for windows users, if you put the script that you want to run in the same directory as your modo.exe file, you can just type @scriptname.pl in the command line, button definition etc... and it will find it (as opposed to putting the entire path c:\program files\etc...)
__________________
QA Manager
Luxology, LLC
 
  09 September 2004
Ok, I am still getting "Unknown script "/Users/...../scriptName.pl

1) Do you have to put your harddrive name before /Users?

2) What format do you have to save file script as: simpletext, generic text, or generic OS X text file?
 
  09 September 2004
Originally Posted by Xacto: Ok, I am still getting "Unknown script "/Users/...../scriptName.pl

1) Do you have to put your harddrive name before /Users?

2) What format do you have to save file script as: simpletext, generic text, or generic OS X text file?


It MUST be regular text, and it MUST have "#!perl" as the first line in the file.
__________________
-Eric
 
  09 September 2004
In a Mac if you try to run an script within a folder with a space in its name it will not run.

@/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm (do not work)

@/Users/lluistar/Lux_Scripts/poda_mirrorHalf.lxm (work)

Salut,
Lluis
 
  09 September 2004
Sorry about all these questions....

It looks like I was able to make it work, however if I try to load it from my "Documents" folder inside a folder called "Modo Scripts" it tells me that it can not find the script. Is it limited to only three levels down? Can you have spaces in the folders(/"Modo Scripts")?

Here is the command that DOES work:
@/Users/home/scriptName.pl

Here is the command that does NOT work:
@/Users/home/Documents/Modo Scripts/scriptName.pl

Last edited by Xacto : 09 September 2004 at 03:16 AM.
 
  09 September 2004
Originally Posted by lluistar: In a Mac if you try to run an script within a folder with a space in its name it will not run.

@/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm (do not work)

@/Users/lluistar/Lux_Scripts/poda_mirrorHalf.lxm (work)


It will if you put it in quotes or curly braces:

@"/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm"
@{/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm}

Spaces mark the beginning of the argument string that is passed to scripts.

-- Joe
 
  09 September 2004
Rob, you rule. I'm surprised modo doesn't have more of these by default. Maby it does and I just haven't gotten there yet. I'm going to be making a lot of pie meues (for selection, convert select, loop/ring/grow/ etc, transformations, deform ,etc..) Alt-space, and Ctrl-Tab are kinda wierd key combos by default - kind of interupts w/ the navigation keys (if you're thumb is on 'alt' you have to curl your index finger around to hit space, not very natural...) I like Maya's marking menues a lot and these are just as good it seems.

I want to map bridge and connect along with slice and....oops, no bridge and connect ; )

-Greg



Originally Posted by rob baldwin: I've added a couple of new pie menus... they're designed to keep you out of the viewport popup menu:

http://www.studio-orb.com/modo/viewport_shading.CFG
http://www.studio-orb.com/modo/viewport_wires.CFG


Add them by going into your Menus->File->Config Import-> (select the files, you can even select and imprt both at the same time!)

Then, in your Form Editor(F3), you'll see two new forms at the bottom, and you can drag them into the Pie Menus category.

To assign them to keys, go to your Key Editor(F2), and pick Commands, then, in the pop-up menu, pick Popover Forms. You'll see Pie Menus halfway down, expand it, then double click on the menu that you want to assign a key to.

(If you didn't move the two menu configs into Pie Menus in the Forms Editor, shame on you, but they should still be listed at the bottom of the Popover Forms list in the Key Editor. I think that in modo configs, it's a good habit to put things where they belong!)

I've added them to the Ctrl-` and the Ctrl-1 keys, respectively, and whew, they're neato. No more three-level-deep picking of wireframe options...

enjoy!
-rob
 
  09 September 2004
EdgeLoop extender for eye sockets

edgeloopextend.lxm
only works in front viewport, select 1 single outer edge or loop
leaves the stretch tool active to do some small tweaks.
also will center the geometry first before extending to keep things even.
Feel free to tweak and improve were needed

#LXMacro#
tool.set "actr.selectauto" "on"
select.typeFrom "polygon;edge;vertex;item" [1]
vert.center "all"
select.edgeLoop "base" [0]
tool.set "edge.extend" "on"
#Command Block Begin: ToolAdjustment
tool.setAttr "center.select" "cenX" [0 m]
tool.setAttr "center.select" "cenY" [0 m]
tool.setAttr "center.select" "cenZ" [0 m]
tool.setAttr "axis.auto" "axisX" [0.0 %]
tool.setAttr "axis.auto" "axisY" [-100.0 %]
tool.setAttr "axis.auto" "axisZ" [0.0 %]
tool.setAttr "axis.auto" "axis" [1]
tool.setAttr "axis.auto" "upX" [0.0 %]
tool.setAttr "axis.auto" "upY" [0.0 %]
tool.setAttr "axis.auto" "upZ" [100.0 %]
tool.setAttr "edge.extend" "segs" [1]
tool.setAttr "edge.extend" "offX" [0 m]
tool.setAttr "edge.extend" "offY" [0 m]
tool.setAttr "edge.extend" "offZ" [0 m]
#Command Block End: ToolAdjustment
tool.doApply
tool.set "xfrm.stretch" "on"
#Command Block Begin: ToolAdjustment
tool.setAttr "center.select" "cenX" [0 m]
tool.setAttr "center.select" "cenY" [0 m]
tool.setAttr "center.select" "cenZ" [0 m]
tool.setAttr "axis.auto" "axisX" [0.0 %]
tool.setAttr "axis.auto" "axisY" [0.0 %]
tool.setAttr "axis.auto" "axisZ" [100.0 %]
tool.setAttr "axis.auto" "axis" [2]
tool.setAttr "axis.auto" "upX" [0.0 %]
tool.setAttr "axis.auto" "upY" [100.0 %]
tool.setAttr "axis.auto" "upZ" [0.0 %]
tool.setAttr "xfrm.stretch" "factX" [100.0 %]
tool.setAttr "xfrm.stretch" "factY" [100.0 %]
tool.setAttr "xfrm.stretch" "factZ" [100.0 %]
#Command Block End: ToolAdjustment
#Command Block Begin: ToolAdjustment
tool.setAttr "xfrm.stretch" "factY" [125.0 %]
tool.setAttr "xfrm.stretch" "factX" [125.0 %]
#Command Block End: ToolAdjustment
tool.doApply
 
  09 September 2004
Originally Posted by lluistar: In a Mac if you try to run an script within a folder with a space in its name it will not run.

@/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm (do not work)

@/Users/lluistar/Lux_Scripts/poda_mirrorHalf.lxm (work)

Salut,
Lluis

I doubt it's mac related, it will be the same on almost all OSes.
When you call a command line that has space in the path you generally must enquote it.

"@/Users/lluistar/Lux Scripts/poda_mirrorHalf.lxm"

Should works.
 
reply share thread



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 02:08 AM.


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