Forum: Poser - OFFICIAL


Subject: A Compendium of PZ2 Techniques.

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


lesbentley posted Thu, 17 April 2008 at 2:36 PM

**The Monster Eyes Problem (part 2).**Scaling the Eyes.

Please bare in mind that what follows is from a few experiments I have done at home on my PC, I have not "road tested" any of this. There may be mistakes, bugs, consequences that I am not aware of, or important things that I have forgotten to say. If you plan to distribute anything based on the methods below, do your own testing first to verify that it works as expected under all conditions. If you find any mistakes, or know of different or better methods, please let us know.


You might expect (quite reasonably) that slaving the scale channel of an eye to a morph in the head would work just the same as slaving a translation. The situation is not always that simple, a number of new factors come into play. Take "Victoria 3 SAE" (or V3 RR) as an example, try scaling both her eyes up to 300%. They end up different sizes!!! This is because the 'smoothScaleY head_smooY' joint parameter channels in the eyes use different settings for the 'smoothZones' in each eye. Phew, bet you didn't now that! This introduces one of the problems that we can face in scaling the eyes, 'smoothScale' channels in the eyes, or head, can affect the results of our attempts to scale the eyes. And when each eye can scale differently in response to the same input we have a real mess, but this is just the start of the complications. Now try scaling V3's head. Again the eyes end up different sizes, and whilst the eyes scale up with the head to some extent, they do not scale to the same extent as the head, leaving them relatively smaller. If you try to scale the eyes of the P4 Nude Woman, or Jessi, they won't scale at all! Again this problem is caused by the 'smoothScale' channels, but in a slightly different way. In fact most of the problems I have seen with scaling the eyes relate to the 'smoothScale' channels.


Determining the value for the 'deltaAddDelta'.
You should select the method you are going to use before you determine the value for the 'deltaAddDelta', if the DIP is ging to scale the head as well as the eyes, you should do that first, also if the method calls for turning 'bend' off, or changing the value in 'smoothScaleY' these things should be done before you determine the value. You should understand this paragraph better when you have finished reading this post.

You can determine the correct value for the 'deltaAddDelta' of the scale channel in similar way what you did for the translations, but there is an extra step. Apply the head morph at a value of "1.000", scale the eye to the size you desire, then Copy the eye and Paste into Notepad. Now instead of using the number straight from Notepad, delete one from the number. Eg if the number from Notepad is "2.480" use "1.480", or if the number from Notepad is "1.332" use "0.332", if the or if the number from Notepad is "0.500" use "-0.500".

Although I have put scaling into a separate post, in practice you should probably be determining the values for scale and translation at the same time, so that you can see the combined effect of both.


**Method A.**If the scale dial in the eyes works to scale them, then you should probably use this method. If the eyes do not respond to the scale dial, you will have to use one of the other methods.

This is the same as we did for the translations, except with "1" subtracted from the 'deltaAddDelta' value. Here is an example of the code you would add to your DIP.

actor leftEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                NameOfHeadMorph
            deltaAddDelta 
            }
        }
    }

**Method B.**If the eyes won't scale in response to the scale dial when 'bend' is on, one approach we can take is to turn 'bend' off (bend 0) for the eye actors. When bend is turned off the joint parameters have no effect on the actor. So to slave the scale channels in the eyes to a morph in the head, and turn 'bend' off we could use this in a DIP pz2:

actor leftEye
    {
    
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                NameOfHeadMorph
            deltaAddDelta 
            }
        }
    }

This works fine as long as the scale of the head remains at 100%. But if we try to scale the head we have a new problem, the 'smoothScale' channels where there to make the eyes scale when the head was scaled. In turning off 'bend' we have stopped the influence of the 'smoothScale' channels, so the eyes will no longer scale with the head. I don't think this is a huge problem, if you manually scale the head, you can just scale the eyes manually to the same percentage. Note that when 'bend' is turned off, magnet and wave deformers will have no effect on the actor.

If you are distributing a DIP, you should probably point these things out in the ReadMe file (not that anyone ever reads the ReadMe).


**Method C.**Another approach we can take is to leave 'bend' on, and try to alter the 'smoothZones' in the 'smoothScaleY' channels of the eyes, so that they work better. The values needed for the 'smoothZones' will be specific to the figure.

actor leftEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                PBMCC_02
            deltaAddDelta -0.5
            valueOpDeltaAdd
                Figure
                head
                big
            deltaAddDelta 1.4080
            }
        smoothScaleY head_smooY
            {
            //the value below is for V3 SAE and V3 RR.
            smoothZones 0.687434 0.70952 99 100
            //the value below is for Jessi (P6 Woman).
            //smoothZones 0.601353 0.748332 99 100
            //the value below is for Don (P5 Man).
            //smoothZones 0.697943 0.726412 99 100
            //the value below is for P4 Nude Woman.
            //smoothZones 0.655437 0.718358 99 100
            }
        }
    }
actor rightEye
    {
    channels
        {
        scale scale
            {
            valueOpDeltaAdd
                Figure
                head
                PBMCC_02
            deltaAddDelta -0.5
            valueOpDeltaAdd
                Figure
                head
                big
            deltaAddDelta 1.4080
            }
        smoothScaleY head_smooY
            {

            //the value below is for V3 SAE and V3 RR.
            smoothZones 0.687434 0.70952 99 100
            //the value below is for Jessi (P6 Woman).
            //smoothZones 0.601353 0.748332 99 100
            //the value below is for Don (P5 Man).
            //smoothZones 0.697943 0.726412 99 100
            //the value below is for P4 Nude Woman.
            //smoothZones 0.655437 0.718358 99 100
            }
        }
    }

The above is a full pz2, to use it as a snippet in a DIP just leave out the bits in blue, and delete unneeded comment lines. The file is set to work on V3. I have used "//" to "comment out" values for other figures, you can swap the commented out lines to use this on different figures. The values I have used are by their very nature a compromise between getting the eyes to scale well when the head is scaled, and getting the eyes to scale well when the eyes are scaled. The values are probably far from optimal, but I think they should suffice for most cases. They were the result of a few quick trial and error experiments. It was beyond my means to include more than a few figures. I did the ones I still had laying around after my main Poser HDD died.

Whilst you should probably prefer method A, for figures that will respond to the 'Scale' dial whilst 'bend' is turned on. I have included V3 in this file because changing her 'smoothScaleY' channels in this way makes a dramatic improvement to the way the eyes scale when the head is scaled (eg in normal manual operation), it also makes it so that when scaling individual eyes the same value on the scale dial will have the same effect for each eye. However these changes can, and probably will, mess up the way that native and third party ERC scaling affects the eyes, this is because these were designed to work with the original (bad) values of the 'smoothScaleY' channel.


**Method D.**This may be the best method when method A won't work. I won't go into full details here, you should already know how to do much of this stuff from the previous posts. Apply your head morph with a value of one. Create a magnet for the eye, scale the Zone up to a large value, say 10000%. Select the eye, open the Joint Editor, copy the Y value for the 'Center point', and use this as the value for yTran in the Mag Base. Scale the Mag until the eye reaches the required size, spawn a morph, slave this morph to the head morph with a deltaAddDelta value of one. Unlike translations, it is quite acceptable to use a morph to scale the eyes, so long as you use a large scale for the Zone, have the Base in the center of the eye, and only use the 'Scale' dial on the Mag, the eye geometry should stay centered on the 'origin' (a,k.a. "Center Point"). One down side I can think of is the extra file size that will result from using a morph, as opposed to the other methods. On the positive side you are not changing the way the eyes scale, so there should be no potential for conflict with any other ERC eye scaling that may already exist in the file, or that may be injected into it at a future time.


**So which method should you use to scale the eyes?**Really it's your call depending on what factors you consider most important, I don't have a lot of experience in this field to draw on, and the best method may depend on which figure you are using, but so as not to leave you totally hanging, I would suggest this.

If the eyes scale in response to the Scale dial, then usually prefer method A, as this makes no changes to the way eye scaling works, and is more compatible with any native or third party eye scaling that may be used on the same figure. If you need to scale the eyes in cases where the Scale dial does not work, then method A is out, I would tend to opt for method D as my first choice.


NOTES:
If you want to read the value from the Scale dial, rather than Copy & Pasting to Notepad, as suggested. Be aware that you will need to shift the decimal point two places to the left before using it in a scale channel. In other words "100%" on the Scale dial is equal to "1.000" in the channel, and you will still need to subtract one from this value before using it as the 'deltaAddDelta' value. Some figures (eg V3 RR) already have ERC slaving built into the scale channels of the eyes, the scale channel is slaved to various targetGeom channels in the head (you may want to inspect this as a working example of method A).


This brings me to the end of what I have to say about Delta Injection and related issues, at least for the moment. It's time to move on to a new subject.