Forum: Poser - OFFICIAL


Subject: A Compendium of PZ2 Techniques.

lesbentley opened this issue on Mar 31, 2008 · 137 posts


lesbentley posted Tue, 15 April 2008 at 1:31 PM

**The Monster Eyes Problem (part 1).**Sometimes when you morph the head the eye sockets get moved, and the eyes need to be moved and/or scaled to fit the new location of the eye sockets. If you try to move an eye by a positioning morph, not only will you waste disk space, but more importantly the eye geometry will be moved away from its 'origin' (centre of rotation). The eye will no longer rotate properly and will tend to move out of the eye socket when rotated. On the other hand, if you use a normal pose file to directly reset the translations of the eye (or set the translations via the dials), then the first time a stock pose is applied to the figure, it is likely to reset the translations of the eye back to zero.

I call this "The Monster Eyes Problem", because this situation often occurs when you create a monster or alien head morph.

The best solution to this problem is to slave the translations (and if necessary scale) of the eye to the the head morph. Let's do this as an exercise.

Load a figure, select the head, then create a magnet. Scale the magnet up to 135%. Spawn a morph for the head, let's call it "Monster". Delete the magnet and set the morph dial to 1.000. Translate the right eye until it fits the socket. Increments of the Tran dials may be too coarse to get exact placement, you may need to click on a dial then type in the number, this gives you 6 decimal places. If the head morph is symmetrical you can Copy the right eye (Ctrl+C), and Paste the values into the left eye (Ctrl+V), then reverse the sign for xTran in the left eye (delete the "-"). Rotate the eyes to check that the placement is OK when rotated.

Select the leftEye, do Ctrl+C (Copy), open Notepad (or some other text editor), do Ctrl+V (paste), enter a carriage return, then do the same for the rightEye, Pasting its data in Notepad under that for the leftEye.

Make a DIP for the "Monster" head morph by any method. Add actors with 'channels' blocks for the leftEye and rightEye to the DIP, it does not matter whether they go before or after the other actors.

You only need channels for for the values that need to be changed, eg if you do not need to yTran the eyes to fit the morphed head, leave the 'ytran' out.

Now add slaving code to each of these channels to slave them to the "Monster" targetGeom channel in the head:

actor leftEye
        {
        channels
                {
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                }
        }
actor rightEye
        {
        channels
                {
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Monster
                        deltaAddDelta 
                        }
                }
        }

The code you added should look like above, the deltaAddDelta values (in red above) will need to be specific to your morph. For the 'deltaAddDelta' use the value for 'xtran'  you stored in Notepad. Repeat the process for 'ytran' and 'ztran', using the corresponding values from Notepad for the 'deltaAddDelta' values. Now repeat the process for the rightEye. Save the file back to disk and test it. NOTES:
The eyes should be slaved to the dial name of the targetGeom channel, in preference to its internal name, so that if a new head morph with a different dial name is injected into the same channel the slaving will be broken.

The translate channels should be slaved directly to the morph in the head, they will still work if the head morph is activated via a master channel in the BODY, or some other place.

In my next post I will say a bit about scaling the eyes.

To be continued...