Forum: Poser - OFFICIAL


Subject: Smart Prop parenting issue

basicwiz opened this issue on Aug 28, 2009 ยท 13 posts


lesbentley posted Sun, 30 August 2009 at 8:38 PM

OK, here is how its done. I'm going to give an example, but not the same as the above image, I'm going to build it bottom up this time, because that is easier to explain. Note that all the measurements I use are in Poser Native units (PNU). You can set PNU from General Preferences. In Poser load a cone primitive. Scale it to 200%, export it as an obj with all export options un-ticked, scale the cone back to 100%. Load the obj back into the cone as a morph target. For this exercise, accept the default name "Morph" for the morph. Do the same procedure as you did for the cone to a ball and box primitive.

yTran the ball to 0.1 so it sits on the tip of the cone. Do Memorize All (Alt+Ctrl+A). Now apply the morph to the cone at a value of 1.0. Again move the ball so it sits on the tip of the cone, and note down how much you moved it by, this is the critical number. In this example you will have moves the ball from 0.1 to 0.2, so you moved it 0.1 PNU. Note that down:

"0.1 for ball".

Do Restore All (Ctrl+A). Move the box till is sits on top of the ball (in our example this should be 0.2 PNU). Do Memorize All (Alt+Ctrl+A). Apply the morph to the ball at a value of 1.0. yTran the box till it again sits on top of the ball, and note down how far you moved it. In our example this should be 0.1 PNU, so we now have:

"0.1 for ball
0.1 for box"

We now have the date we need to write the ERC slaving. Do Restore All (Ctrl+A). Parent the box to the ball and the ball to the cone. Save all 3 props to the props pallet as "TEST" using "Select Subset" to save all 3 to the same pp2.

Open the pp2 in a text editor. Find the ytran channel for the ball and add the following slaving code (in green) to it:

                translateY ytran
                        {
                        name ytran
                        initValue 0.1
                        hidden 0
                        forceLimits 0
                        min -100000
                        max 100000
                        trackingScale 0.001
                        keys
                                {
                                static  0
                                k  0  0.1
                                }
                        interpStyleLocked 0
<span style="color:rgb(0,255,0);">                   valueOpDeltaAdd<br></br>                           _NO_FIG_<br></br><span style="color:rgb(153,204,0);">cone_1</span><br></br>                              Morph<br></br>                     deltaAddDelta</span> <span style="color:rgb(255,0,0);">0.1</span>
                        }

The value (red) in the 'deltaAddDelta' line is the value you noted down for the ball, "0.1" in this example, but it might be something entirely different in another example. Find the ytran channel for the box and enter this slaving code:

<span style="color:rgb(0,255,0);">                      valueOpDeltaAdd<br></br>                           _NO_FIG_<br></br><span style="color:rgb(153,204,0);">ball_1</span><br></br>                              Morph<br></br>                     deltaAddDelta</span> <span style="color:rgb(255,0,0);">0.1</span>

The number in red is the number you noted down for the box. Save the file and test it in poser. If it works correctly, you can resave the props as individual smart props. Now I did cheat a little bit here. In the morphs we made, the props all grew from their bottom edge, with that edge itself not being moved by the morph. If it had been otherwise the coding needed may have been more complicated.