Skip to content

Instantly share code, notes, and snippets.

View csaez's full-sized avatar

Cesar Saez csaez

View GitHub Profile
@csaez
csaez / one_undo.py
Last active October 11, 2015 20:37
Softimage: A python decorator to wrap an execution into 1 undo level.
from functools import wraps
def OneUndo(function):
@wraps(function)
def _decorated(*args, **kwargs):
try:
Application.BeginUndo()
f = function(*args, **kwargs)
finally:
Application.EndUndo()
@csaez
csaez / get_weight.py
Last active October 11, 2015 20:37
Softimage: A fast way to get the weight parameter (on mixer) of a given shape property
from xml.dom.minidom import parseString
from sipyutils import si, siut
siget = lambda sFullName: si().Dictionary.GetObject(sFullName)
def GetWeight(p_oShape):
lData = list()
sConn = siut().DataRepository.GetConnectionStackInfo(p_oShape)
for i in parseString(sConn).getElementsByTagName("object"):
if "Mixer" in i.toxml():