Forum: Poser - OFFICIAL


Subject: Pyton Program to Set Parent

basicwiz opened this issue on Apr 14, 2009 ยท 11 posts


lesbentley posted Wed, 15 April 2009 at 8:34 AM

If for some reason my previous suggestion is not suited to your intent, and you do need to apply parenting after the props have been loaded. You can use a text editor to construct a simple cm2 (camera) file to do the parenting. The cm2 would then be saved to a camera folder. The type of parenting will be smart-parenting. Here is an example of a cm2 file to apply parenting:

{

version
        {
        number 3
        }

actor obj1_1
        {
        smartparent UNIVERSE
        }
actor obj2_1
        {
        smartparent obj1_1
        }
actor obj3_1
        {
        smartparent obj2_1
        }
}

In the above example the parent of "obj1_1" is "UNIVERSE", but it could just as easily be some other prop, or a body part, e.g. "hip". Be aware that when a prop is smart-parented, it will inherit the translations and rotations of its parent, in addition to any translations and rotations that may already have.

Also note that Poser appends an underscore and number to a prop when it is loaded. So if you wanted to parent three instances of "obj1", the syntax would be:

{

version
        {
        number 3
        }

actor obj1_<span style="color:rgb(255,0,0);">1</span>
        {
        smartparent UNIVERSE
        }
actor obj1_<span style="color:rgb(0,255,0);">2</span>
        {
        smartparent obj1_<span style="color:rgb(255,0,0);">1</span>
        }
actor obj1_<span style="color:rgb(51,102,255);">3</span>
        {
        smartparent obj1_<span style="color:rgb(0,255,0);">2</span>
        }
}