Modo Scripts
(401) Item List Utilities
Posted by on Thursday, July 02, 2009 (GST)
mm_ItemUtils v1.000
 
 
Last Update: 01/07/09
 
 
What is it?
 
A collection of commands/utilities added to the item list context menu to aid in dealing with multiple items while mechanical rigging. The utilities provided are:
 
Item list (new item) menu
  • Create Named Locators - creates the specified number of locators. A naming scheme can be specified and they can optionally be parented to a group locator.
Item list, item right click menu
  • Show\Hide Modifiers - Select a hierarchy and tell it to hide (or unhide) all the modifiers so you don't see the little line connections for DPs and constraints and all that. (hide as in the little eye icon)
  • Add Named Locators - Similar to the above 'Create Named Locators' but adds the specified number of locators to an existing heirachy.
  • Create and Match - create a new locator and match it's position to the currently selected item(s).
  • Rename Selected Items - rename the selected items according to a naming scheme
  • Rename Heirarchy - rename and/or add a prefix and/or suffix to the members of a heirarchy
  • Duplicate Multi -  duplicates an item and optionally it's child heirarchy and/or modifiers a specified number of times.
 
Installation:
 
Choose 'Run Script' from the 'System' menu (Shift-F5)
 
 
 
 
Navigate to where you've unzipped the zip file and double click on 'install.py'
 
 
 
 
 
In the next dialog, you need to navigate back to the same directory so that the install script can find the files it needs to install.
 
 
 
 
If the install is successfull, a dialog should pop up.
 
 
 
 
Restart modo.
 
 
 
Usage/command description:
 
 
Create Named Locators - You'll find this by clicking on the (new item) entry in the item list:



Clicking the menu item brings up the following pop-up:


Add To Group Locator - Adds the locators to a containing group locator. The group locator's name is set in 'Base Name' (which is also the base name for the locators). If a group locator with that name already exists the locators will be added to that, otherwise a new group locator will be created with that name.

Separator - this is the separator character or string that separates the base name from the numeric extension (it's probably best to avoid a single space character as a separator).

Padding Digits - number of padding digits to use for the numeric extension.
Number - Number of locators to create.
Base Name - base name for the locators.

Screen grab below is the result from the settings in the image above:



If you decide that you need more locators with the same naming convention, run the command again with the same settings and the number of locators you want to create. The following image shows a further 4 locators added to the previous 8:


 
 
 
 
Add Named Locators - Available from the item right click context menu in the item list. The command works when you click on a group locator or on a child of a group locator, it doesn't work if you click on an item other than a group locator in the root of the item list.



The command brings up the following dialog, settings are basically the same as for the previous command.



As with 'Create Named Locators', running the command again will allow you to add more locators, keeping the number series intact:



Screen grab below shows result of adding locators to an existing group locator with a different base name set for the locators:

 
 
 
 
Create and Match - Also available from the right click context menu in the item list. Creates the specified number of locators and matches their position, rotation and or scale to the currently selected item. Locators can be created either at the same levl of the cyrrently selected item in a heirarchy or at the root of the item list.


 

Rename Selected - Also available from the right click context menu in the item list. Shift or CTRL click the items you want to rename.



Brings up the folllowing pop-up:



Full Rename - Performs a full rename using the basename, separator and padding digits. Renumbers starting at 1

Rename Base - Replaces the items' base name leaving current numbering intact.

Renumber - leaves the basename intact and renumbers the items *in the order they were selected*. You can either CTRL click to select in the sequence you want or move the items around in the item list then shift click the block.

Separator - same as previously
Padding - same as previously
Base Name - same as previously


 
 

Rename Heirarchy - Another quick update, added the ability to add a prefix and/or suffix to the members of a heirarchy. I'm considering this a bit experimental because getting it to behave intelligently with what could be items with differing naming structures is pretty tricky. The menu item is called 'Rename Heirarchy and appears in the item list context menu like the others:

*caution, as stated above, I'm currently considering this command/utility somewhat experimental*



So what does it do? It'll rename adding a prefix, suffix or both to the child members of a heirarchy according to some simple rules:

The items to be renamed need to have the same naming 'structure', for example:

name_suffix or
prifix_name or
name_ext or
prefix_name_suffix_ext etc

options:

No Prefix - items to be renamed do not currently have a prefix
Add/Replace a prefix - Adds a prefix to items or replaces the current prefix
Leave Prefix - items already have a prefix and it should be left intact

The above options are mutually exclusive, only one can be in effect at a time

No Suffix - items to be renamed do not currently have a suffix
Add/Replace a Suffix - Adds a suffix to items or replaces the current suffixLeave Prefix - items already have a prefix and it should be left intact

The above 3 options are also mutually exclusive

Replace Base name - replace the base item name
Separator - the character or string used as a separator for items that already have a prefix or suffix.

The script automatically detects whether the items it's operating on have a numeric extension and adapts accordingly.

I think the best thing to d is have a play with it to get a feel for how it works. It should do most of what Rich intended I think, as long as all the items have the same structure but there if they are mixed it could be a bit quirky.

 
 
 
Duplicate Multi - Also available from the right click context menu in the item list.



Brings up the folllowing pop-up:



Use Source Name - duplicates will use the name (or base name) of the source item.

Create Group - Creates a new group to hold the source item and the duplicates. If 'Use source Name' is set the group will have the same name or base name as the souirce item, otherwise a new group will be created with the name set in the 'Base Name' entry box

Separator - same as previous commands
Padding Digits - same as previous commands
Base Name - same as previous commands

Use start Value - If set will start numbering the source item and duplicates using the value in the box below (Start Value). If 'Use Start Value' is not set, the script will examine the source object's name to determine if it's already part of a numbered sequence. If it is, then the duplicates will be numbered starting from the end of that sequence. If it isn't (ie the source object doesn't already have a numeric extension) then numbering will start from 1, the source item will be renamed to be number 1 and the duplicates will be numbered from 2 onwards.

Instances - Duplicates will be instances

Heirarchy - source item's child heirachy will be duplicated

Modofiers - OK, that's a typo :) it'll be 'Modifiers' in your version. Modifiers attached to the source or it's children, if there's a heirarchy and the heirarchy flag is set, will also be duplicated.

Number of Duplicates - have a guess :)

Screen grabs below show a heirachy with modifiers duplicated 5 times as instances:





Enjoy :)