Skip to content

Instantly share code, notes, and snippets.

@ivogrig
ivogrig / SelectionSet.py
Created July 6, 2015 10:03
Modo Selection set
# There is no dedicated methods for the selection sets in the TD SDK as of yet.
# Currently you can only create pickMaps for vertices using the vmaps methods.
import modo
# Create a sphere
lx.eval('script.implicit "Unit Sphere Item"')
mesh = modo.Mesh('Sphere')
@ivogrig
ivogrig / Monitor example
Created June 23, 2015 09:26
Modo Monitor example
import time
import lx
dialog_svc = lx.service.StdDialog()
# Allocate monitor
mon = lx.object.Monitor(dialog_svc.MonitorAllocate('Calculating Center Of Mass ...'))
steps = 50
@ivogrig
ivogrig / CmdSetMeshInstance.py
Created June 10, 2015 14:08
Sets a new source mesh to a mesh instance, by manipulating the 'meshInst' and 'source' graphs.
################################################################################
#
# SetMeshInstance.py
#
# Version: 0.1
#
# Author: Ivo Grigull
#
# Last Update: 10/06/2015
#
@ivogrig
ivogrig / cmdPrintWeights.py
Last active August 29, 2015 14:22
Modo Python API example for skin weight access
# Python API example for skin weight access
# Place this file into an lxserv folder
#
# Creates a command that takes the names of a mesh and a connected joint locator and inverts the weight values
#
# Example command usage:
# example.printJointWeights locator:"Skeleton_Joint (4)" mesh:MyCube
import lx
import lxu