Skip to content

Instantly share code, notes, and snippets.

@mattcox
mattcox / IsItAMask.py
Last active Dec 17, 2015
IsItAMask - Modo Python API example to show if the selected item is a texture layer mask or not.
View IsItAMask.py
import lx
import lxu.select
scn_svc = lx.service.Scene()
def IsItAMask(item):
if scn_svc.ItemTypeName(scn_svc.ItemTypeSuper(item.Type())) == lx.symbol.sITYPE_TEXTURELAYER:
scene = item.Context()
graph = lx.object.ItemGraph(scene.GraphLookup(lx.symbol.sGRAPH_SHADELOC))
if graph.RevCount(item) > 0:
@mattcox
mattcox / matchXfrm.cpp
Last active Jul 12, 2018
Match Transform Command for Luxology Modo.
View matchXfrm.cpp
/*
matchXfrm.cpp
Sample plugin to demonstrate a simple command that matches
position, rotation and scale between multiple selected items.
This command operates slightly differently to the built in
match.position, rotation, scale commands. The built in commands
will average out the transform if multiple items are selected,
@mattcox
mattcox / eval_matrixChannel.cpp
Last active Jul 12, 2018
This snippet is to demonstrate how to write to a matrix channel in modo from an eval modifier. This is the correct way to write to a matrix. This does assume that you have set the matrix channel you want to drive as a channel for the modifier, using eval.AddChan(item_loc, LXsICHAN_XFRMCORE_WPOSMATRIX, LXfECHAN_WRITE); in your modifier constructo…
View eval_matrixChannel.cpp
/*
This snippet is to demonstrate how to write to a matrix channel
in modo from an eval modifier. This is the correct way to write
to a matrix. This does assume that you have set the matrix channel
you want to drive as a channel for the modifier, using something like:
eval.AddChan(item_loc, LXsICHAN_XFRMCORE_WPOSMATRIX, LXfECHAN_WRITE);
in your modifier constructor. This method will drive the matrix
channel directly, so instead of using the local channels to calculate
the world SRT, it'll use the values the modifier provides it with.
*/