Share your Macros and Layouts


probably some of you have created some nice macros already.
so maybe you would like to share them :slight_smile:

so let me start with a very very small one i created (just opened this thread to collect all those cool tools you created ;))

it works like the “pshift” plugin in lightwave … it extrudes a polygon selection with a value of 0 and switches back to selection mode.

cheers chris


This script sets the pivot point to the last selected vertex. Just copy and paste it to a file. Make sure “#!perl” is the first line.

my @verx = lxq(“query layerservice verts ? selected”);
my $idx = lxq(“query layerservice vert.index ? @verx[$#verx]”);
my @pos = lxq(“query layerservice vert.pos ? $idx”);
lx(“tool.set pivot.move on”);
lx(“tool.setAttr pivot.move posX $pos[0]”);
lx(“tool.setAttr pivot.move posY $pos[1]”);
lx(“tool.setAttr pivot.move posZ $pos[2]”);
lx(“tool.set pivot.move off”);





eric , can u tell me how to make this usefull script to work as a menu button plz?

  • Put that script in a file called

  • Open the Form Editor from the System Menu

  • Find a form you want to put the button in; you’ll probably want to put it in the Main Menu, or one of the modo Tools sub-forms.

  • Right-click on (new control) and select Command from the menu

  • Enter this as the command definition, modified for where the file actually is on your machine. The @ symbol is used to run scripts:


You can click-pause-click on the new control’s row to give it a better label.

– Joe


thanx eric for this script, actually it was one my requested scripts to c , i want to c that it’s ok, but need to have more function, like:
-if u select a vertex, the pivot will b this vertex
-if u select an edge, the pivot is the midle of the center of the edge
-if u select a polygon, the pivot is the center of the bouding box of this polygon
-if u apply it with no selection, the pivot is the center of the bounding box of the layer mesh


Well, fine then:

This one is a bit too big paste into the message body. Right click to save that to disk.

– Joe



the link is not working


Stupid web server not letting you download .pl files from it…

I zipped it and fixed the link; try it now:[/URL

– Joe



I tried to post a reply to this thread a moment ago but the system locked up and I don’t know if it ever went thru.

Anyway, I cut and pasted the command into a .pl file and preceded the file name in the command with the @ symbol but when I ran the command I got a Run Script Implicit message box with the error message "Unknown Script ‘C:\Program…’

Any suggestions?



Yeah, just put it in your main modo directory, and take off the absolute path just put in

@name of script


oki, now the link is working, but once again, reporting:

-the edge mode is not working, if u select an edge and fire the pivot, it will not centre the pivot to it’s centre, the centre is going to the layer mesh bounding box.

suggestion :any possibility to make the pivot stick to the mesh, like if we define the 3rd corner of a rectangle as the pivot, and once we moved this vertex, the pivot is no more this vertex, now it’s in the original place, can we link the pivot translation to the new defined one, so always we can find it at the same defined place?


Two possible reasons. First, the first line of the script MUST contain the line “#!perl”. No blank lines above it. Second, if the perl plugin has not loaded. Any plugin the extras directory should load automatially, but you can try it manually by hitting shift-P and adding it. it is called intrperl.lx.


I’ve added a couple of new pie menus… they’re designed to keep you out of the viewport popup menu:

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…



If there are spaces in the filename, wrap it in quotes or curly braces, like:

@"d:\Some Path\My"

And the stuff Eric and Dion said.

– Joe


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?


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\

Heres the script itself:

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


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…

The other is even simpler but I still use it often. It simply opens a Command History window.

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.


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: