Forum: Poser Python Scripting


Subject: An old problem with parenting props is still here in Poser 10.

Anthony Appleyard opened this issue on Jan 15, 2014 · 24 posts


Anthony Appleyard posted Wed, 02 April 2014 at 2:33 AM

This is a go at making it into a Python routine:-

def parentprop(ac,par):
    scene = poser.Scene()
    if ac.IsProp():
        scene.SelectActor(ac)
        propin=ac.InternalName()
        propen=ac.Name()
        parin=par.InternalName()
        paren=par.Name()
        print "parenting",propen,"(",propin,") to ",paren,"(",parin,")"
        libaddr=poser.Libraries()[0]
        fileaddr=libaddr+"RuntimeLibrariesPosezxcvbnm.pz2"
        print "writing temporary pose file to ",fileaddr
        pose=open(fileaddr,"w")
        pose.write("{ntactor $CURRENTnt{nttsmartparent "+parin+"nt}n}n")
        pose.close()
        scn.LoadLibraryPose(fileaddr)
        print "re-parented"
    else:
        print "FAILED:", propin," is not a prop"