Skip to content

Instantly share code, notes, and snippets.

@tcrowson
tcrowson / ConvertToRedshiftProxy.py
Last active October 2, 2015 19:39
Softimage script for converting a selection to Redshift Proxy, and re-importing it into the scene with some customizations.
# ConvertToRedshiftProxy
#
# - Adds a new command to the context menu for objects in the Scene Explorer: 'Convert to Redshift Proxy'
#
# FEATURES
# - Exports the selected items to a Redshift Proxy, then re-imports the result back into the scene.
# - Optionally maintains parenting, but only to the parent of the first selected item.
# - Appends a suffix (defaults to '_RSPROXY') to the name of the proxy mesh, to distinguish it from other polymeshes.
# - Locks the Construction stack on the proxy mesh to prevent it being frozen by accident.
# - Optionally lets you specify a display mesh for GL previewing.
@tcrowson
tcrowson / morphDuplicate.py
Last active October 1, 2015 14:59
Modo 901 command for duplicating the selected morph map
# Command for duplicating the selected morph.
# Tim Crowson, June 2015
import lx
import lxu
import lxifc
import modo
@tcrowson
tcrowson / simpleModoMonitor.py
Last active August 29, 2015 14:06
Basic Modo Progress Bar
import lx
import time
dialog_svc = lx.service.StdDialog()
mymonitor = lx.object.Monitor(dialog_svc.MonitorAllocate('Some task or other ...'))
mymonitor.Initialize(10)
for x in range(10):
mymonitor.Increment(1)
time.sleep(2)
@tcrowson
tcrowson / modo_getItemsOfType.py
Last active August 29, 2015 13:59
Function that returns all items in the scene of the specified type(s) as a list of Python objects.
# python
'''
This function searches the current Modo scene and returns all items of
the specified type as a list of Python objects.
The function takes one or more arguments as strings or integers, which are the types of items you're after.
To ensure forward compatibility we'll use the symbol for the item type we need.
To see the full list of item type symbols, visit the following URL: