Skip to content

Instantly share code, notes, and snippets.

@csaez
Last active October 11, 2015 20:37
Show Gist options
  • Save csaez/3915734 to your computer and use it in GitHub Desktop.
Save csaez/3915734 to your computer and use it in GitHub Desktop.
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():
lData.append(i.toxml())
if not len(lData):
return None
sData = lData[0][8:-9].replace(".actionclip", "")
if siget(sData):
return siget("%s.actionclip.weight" % sData)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment