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:25 AM

Oops. It should be:-

import poser
import string
import os
import sys
scn = poser.Scene()
acts=scn.Actors()
figs=scn.Figures()
ac=scn.CurrentActor()
propin=ac.InternalName()
propen=ac.Name()
if ac.IsProp():
    par=ac.Parent()
    parin=par.InternalName()
    paren=par.Name()
    print paren,"(",parin,") is parent of ",propen,"(",propin,"), now trying to parent it fully properly"
    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"
poser.ProcessCommand(1559)
scn.DrawAll();