Forum: Poser Python Scripting


Subject: Problem with SetParent

Dimension3D opened this issue on May 30, 2008 · 4 posts


Dimension3D posted Fri, 30 May 2008 at 9:59 PM

When I use the SetParent() method on a prop that is parented to a figure to set a prop (or UNIVERSE) as new parent, it seems to work and the prop shows the correct parent in the hierarchy editor and becomes independent from the figure. However, if I delete the figure, the prop is deleted as well. Unlike when changing the parent in Poser, the prop still belongs to the figure. Calling ItsFigure() still returns the figure, and Actors() of the figure still contains the prop.

Is there any way in Python to get the prop out of the figure?


Dimension 3D - Poser Tools, Poser Props and Morphs, Cinema 4D Plugins, and more

Renderosity Store / D3D Web Site


PhilC posted Sat, 31 May 2008 at 1:20 AM

A work around may be to copy the prop and delete the original. The copy would not be parented to anything.


Dimension3D posted Sat, 31 May 2008 at 2:39 AM

A good idea, but I can't get it to work if the prop has morphs and binary morphs are on. If I save the prop temporary and reload it, a new pmd file is created and referenced, so I would have to keep it permanently. (Similar holds for the menu command "Duplicate", which for some reason references to a temporary PMD file in PoserUndoCache that is deleted when the scene is closed.) If I would rebuild the prop from the geometry and properties of the original prop, the morphs would not reuse the existing PMD file, but are saved with the scene. (Not to mention that this approach is a lot of work.)

The only Poser Python method to deal with PMD files seems to be scene.MorphFiles() that lists all used PMD files, which is pretty useless.
Well, since only binary morphs are a problem and most Poser users have turned them off, I may copy the props anyway.


Dimension 3D - Poser Tools, Poser Props and Morphs, Cinema 4D Plugins, and more

Renderosity Store / D3D Web Site


Dimension3D posted Sat, 31 May 2008 at 5:31 PM

I finally found a simple solution for the problem. Applying the following pose will get the prop out of the figure:

{
  actor $CURRENT
  {
    smartparent UNIVERSE
  }
}


Dimension 3D - Poser Tools, Poser Props and Morphs, Cinema 4D Plugins, and more

Renderosity Store / D3D Web Site