Skip to content

Instantly share code, notes, and snippets.

@csaez
Last active August 29, 2015 13:59
Show Gist options
  • Save csaez/10483494 to your computer and use it in GitHub Desktop.
Save csaez/10483494 to your computer and use it in GitHub Desktop.
Softimage: list input/output connections
import xml.etree.ElementTree as ET
from win32com.client import Dispatch
si = Dispatch("XSI.Application")
siut = Dispatch("XSI.Utils")
def listConnections(obj, conn_type="out"):
data = siut.DataRepository.GetConnectionStackInfo(obj)
return [c.find("object").text for c in ET.fromstring(data)
if c.find("object") is not None and c.find("type").text == conn_type]
# TEST
si.NewScene(None, False)
a = si.ActiveSceneRoot.AddNull()
b = si.ActiveSceneRoot.AddNull()
b.posx.Value = 5
a.Parameters("Size").AddExpression(b.Parameters("Size").FullName)
print a.FullName, listConnection(a.ActivePrimitive, "in")
print b.FullName, listConnections(b.ActivePrimitive, "out")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment