Forum: Poser - OFFICIAL


Subject: A Compendium of PZ2 Techniques.

lesbentley opened this issue on Mar 31, 2008 ยท 137 posts


lesbentley posted Fri, 04 April 2008 at 9:50 PM

**Injecting ERC slaving (part 3).**V3_EyesBoth.pz2

This is a more complex file, only because it contains more channels, but the structure and function of the pz2 below are much the same as the "V3_Squint.pz2". The only significant differences are that it places the master dials in a group, and contains more master and slave channels.

The file contains channels to move the eyes Side-Side, Up-Down, and also to translate the eyes.

{
//V3_EyesBoth.pz2
//For V3 and similar figures.
//Adds dials to the head to move both eyes at once.
version
        {
        number 3
        }

//The section below sets up the initial state of the master targetGeom channels in the head,
//note in particular the use of 'indexes 0' to clear any deltas from the channels.

actor head
        {
        channels
                {
                groups
                        {
                        groupNode Eyes_Move
                                {
                                parmNode PBMCC_11
                                parmNode PBMCC_12
                                parmNode PBMCC_13
                                parmNode PBMCC_14
                                parmNode PBMCC_15
                                }
                        }
                targetGeom PBMCC_11
                        {
                        name Eyes_Side-Side
                        initValue 0
                        hidden 0
                        forceLimits 1
                        min -5.500
                        max 5.500
                        trackingScale 0.02
                        keys
                                {
                                static  0
                                k  0  0
                                }
                        interpStyleLocked 0
                        indexes 0
                        }
                targetGeom PBMCC_12
                        {
                        name Eyes_Up-Down
                        initValue 0
                        hidden 0
                        forceLimits 1
                        min -3.300
                        max 3.300
                        trackingScale 0.02
                        keys
                                {
                                static  0
                                k  0  0
                                }
                        interpStyleLocked 0
                        indexes 0
                        }
                targetGeom PBMCC_13
                        {
                        name Eyes_xTran
                        initValue 0
                        hidden 0
                        forceLimits 0
                        min -10000
                        max 10000
                        trackingScale 0.02
                        keys
                                {
                                static  0
                                k  0  0
                                }
                        interpStyleLocked 0
                        indexes 0
                        }
                targetGeom PBMCC_14
                        {
                        name Eyes_yTran
                        initValue 0
                        hidden 0
                        forceLimits 0
                        min -10000
                        max 10000
                        trackingScale 0.02
                        keys
                                {
                                static  0
                                k  0  0
                                }
                        interpStyleLocked 0
                        indexes 0
                        }
                targetGeom PBMCC_15
                        {
                        name Eyes_zTran
                        initValue 0
                        hidden 0
                        forceLimits 0
                        min -10000
                        max 10000
                        trackingScale 0.02
                        keys
                                {
                                static  0
                                k  0  0
                                }
                        interpStyleLocked 0
                        indexes 0
                        }
                }
        }

//The section below is used to inject slaving code into the eyes.

actor leftEye
        {
        channels
                {
                rotateY yrot
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                PBMCC_11
                        deltaAddDelta 10.000000
                        }
                rotateX xrot
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                PBMCC_12
                        deltaAddDelta 10.000000
                        }
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_xTran
                        deltaAddDelta 0.0010000
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_yTran
                        deltaAddDelta 0.0010000
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_zTran
                        deltaAddDelta 0.0010000
                        }
                }
        }

actor rightEye
        {
        channels
                {
                rotateY yrot
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                PBMCC_11
                        deltaAddDelta 10.000000
                        }
                rotateX xrot
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                PBMCC_12
                        deltaAddDelta 10.000000
                        }
                translateX xtran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_xTran
                        deltaAddDelta -0.0010000
                        }
                translateY ytran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_yTran
                        deltaAddDelta 0.0010000
                        }
                translateZ ztran
                        {
                        valueOpDeltaAdd
                                Figure
                                head
                                Eyes_zTran
                        deltaAddDelta 0.0010000
                        }
                }
        }
//below is the figure section.
figure
        {

        }
}

NOTES:
All the notes that applied to the "V3_Squint.pz2" and the previous tip on grouping dials, also apply the this file. Note that the 'deltaAddDelta' for the translate channels is a relatively small number '0.0010000', there are two reasons for this. First, a translate channel slaved to a targetGeom (morph) or valueParm (FBM) channel inherently tends to need a smaller 'deltaAddDelta' value than a rotate channel in the same situation. Secondly, because we are moving a small object, the eye, relative to a thin object, the eyelid, we need small increments to get the exact fit. If we were trying to move a car along a road, a much bigger value for 'deltaAddDelta' might be appropriate.

Note that I have forced limits on the master rotate channels, but not on the translate channels. I know that exceeding the limits I have set for the rotations would be silly, so I forced limits for these channels, I don't know how far someone might want to translate the eyes, so I left the limits unforced.

Although this file is called V3EyesBoth.pz2, it should work on just about any figure that uses the PBMCC## channel names.

To be continued...