The problem I'm having is even when I set a key on the position of the nulls, they pop back to zero after the mesh has been frozen or compound is deleted.
Manually it works fine, but not in script. Should I be getting and setting the null positions instead?
Code: Select all
# Freeze mesh and skin mesh to _Socket Null
def SkinMesh():
meshName = si.GetValue(mesh.Name)
firstNull = (str(meshName) + '_Socket')
secondNull = (str(meshName) + '_Ball')
si.SaveKey("%s.%s.kine.local.posx,%s.%s.kine.local.posy,%s.%s.kine.local.posz" % (meshName, firstNull, meshName, firstNull, meshName, firstNull))
si.SaveKey("%s.%s.kine.local.posx,%s.%s.kine.local.posy,%s.%s.kine.local.posz" % (meshName, secondNull, meshName, secondNull, meshName, secondNull))
si.DeleteObj("%s.%s.polymsh.MeshAttachers" % (meshName, meshName))
si.ApplyFlexEnv('%s.%s;%s.%s' % (meshName, meshName, meshName, firstNull), '', 2)
