Skip to content

Instantly share code, notes, and snippets.

@darkvertex darkvertex/
Last active Dec 16, 2015

What would you like to do?
gator for multiple objects
xsi = Application
selected = xsi.Selection
sourceMesh = xsi.PickObject("Pick source (enveloped) mesh", "Pick source (enveloped) mesh")("PickedElement")
if sourceMesh:
freezeMe = []
for targetMesh in selected:
if targetMesh.Envelopes.Count > 0:
gatorOp = xsi.ApplyGenOp("Gator", "", targetMesh.FullName+";"+sourceMesh.FullName, 3, "siPersistentOperation", "siKeepGenOpInputs")(0)
srcEnv = sourceMesh.Envelopes(0)
srcEnvProp = (p.Target2 for p in srcEnv.InputPorts if p.Target2.Type == "envweights").next()
env = xsi.TransferClusterPropertiesAcrossGenOp(targetMesh.FullName+"."+targetMesh.Type+".TransferAttributes", targetMesh, srcEnvProp, "Envelope_Weights")
xsi.LogMessage("Gatored %s's envelope to ---> %s" % (sourceMesh.FullName, selected.GetAsText()), 4)
# Middleclick for continuous picking, left click for single.
# Offer to purge unused deformers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.