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, 15 January 2014 at 9:33 AM

 

In my Poser 10 I set up a scene containing the Casual Man (named "man"), and a box and a ball and a cone and a cylinder (not parented to him). I then ran a Poser Python script containing these statements:-


chest = scn.Actor("Chest")
box = scn.Actor("box")
ball = scn.Actor("ball")
cone = scn.Actor("cone")
cylinder = scn.Actor("cylinder")
box.SetParent(chest,0,0)
ball.SetParent(chest,0,1)
cone.SetParent(chest,1,0)
cylinder.SetParent(chest,1,1)


This parented the 4 props to the man, and when I moved the man, the props moved with him. OK so far. But:-

If I parent a prop to a character using Poser, the prop disappears when I delete the character, and when I save the character to library, the prop saves to library along with him, and the parentage is stated in a "parent" statement in the prop's actor AND in an addChild statement.

If I parent a prop to a character using setParent() in Python, even now in Poser 10, the prop does not disappear when (using Poser directly) I delete the character, and when (using Poser directly) I save the character to library, the prop does not save to library along with him; if I save the result to a .pz3 file and examine it with a text editor, I find that the prop parented by Python does not appear in an addChild statement, but its actor contains a correct "parent" statement. That is, parenting by Python only does part of the job of parenting.

This bug has hampered my Poser Python programming since as soon as Poser (not the "Pro" versions) has had Python, and I am surprised to find it still present in Poser 10.

(Python gets it right when parenting a character to a character.)

Please how can I make Poser or Python finish the job of parenting a prop to a character?