odf opened this issue on Oct 27, 2008 · 13933 posts
lesbentley posted Thu, 18 March 2010 at 9:42 AM
Attached above is the text of a simple figure to demonstrate that it can be done. It has two body parts "hip2" and "lThigh", simple cube geometry stands in for these parts. There is one morph in hip2 "X times Z", when this morph is fully expressed at a value of 1.0, it makes the right hand side of hip2 exactly twice as high, extending it upwards by 0.1 Poser units.
Select the lThigh, with Spread at zero, if you use Kick on the lThigh nothing happens. With Kick at zero, if you use Spread on the lThigh nothing happens.
If you set Spread to 45° and Kick to 90°, the morph will be fully expressed.
If you halve the value for rotation on either the Kick or Spread dials, then the morph will be expressed at 50%. This is what is happening, whatever value the "X times Z" morph inherits from the Spread (zrot) channel is multiplied by the value it inherits from the Kick (xrot) channel (these values are modified by the respective "deltaAddDelta" lines in the slaving code).
So morph expression = xrot deltaAddDelta x zrot deltaAddDelta.
Here is the actual code:
<span style="color:rgb(0,255,0);">targetGeom X times Z</span>
{
name X times Z
initValue 0
hidden 0
forceLimits 1
min -100000
max 100000
trackingScale 0.02
keys
{
static 0
k 0 0
}
interpStyleLocked 0
valueOpDeltaAdd
Figure 1
<span style="color:rgb(0,255,0);">lThigh:1<br></br> xrot</span>
deltaAddDelta <span style="color:rgb(0,255,0);">0.0222222</span>
<span style="color:rgb(0,255,0);">valueOpTimes</span>
Figure 1
<span style="color:rgb(0,255,0);">hip2:1</span>
<span style="color:rgb(0,255,0);">z-ratio</span>
indexes 2
numbDeltas 8
deltas
{
d 2 0 0.1000039 0
d 3 0 0.1000039 0
}
blendType 0
}
valueParm <span style="color:rgb(0,255,0);">z-ratio</span>
{
name z-ratio
initValue 0
hidden 0
forceLimits 0
min -100000
max 100000
trackingScale 0.004
keys
{
static 0
k 0 0
}
interpStyleLocked 0
valueOpDeltaAdd
Figure 1
<span style="color:rgb(0,255,0);">lThigh:1</span>
<span style="color:rgb(0,255,0);">zrot</span>
deltaAddDelta <span style="color:rgb(0,255,0);">0.0111111</span>
}
The trick is done my using valueOpTimes in place of valueOpDeltaAdd. valueOpTimes tells Poser to multiply the value in the slaved channel by the value in the master channel. Because valueOpTimes can't take a deltaAddDelta parameter, it is necessary to filter its input through a channel that can take use a deltaAddDelta. In this case that channel is "z-ratio". z-ratio gets its input from zrot at a strength of 0.0111111 as set by the deltaAddDelta in the z-ratio channel. valueOpTimes in the 'X times Z' channel gets its value from the z-ratio channel, already filtered down to a deltaAddDelta of 0.0111111. As to the deltaAddDelta values used, if I had wanted the morph to be fully expressed when both rotation channels had a rotation of 1.0° I would have used a deltaAddDelta of 1.0. If I had wanted the morph to be fully expressed when both rotation channels had a rotation of 100.0° I would have used a deltaAddDelta of 0.01. The actual values used "0.0222222" and "0.0111111" give full expression at rotations of 45° and 90° respectively.
I don't know how well I have explained this, or how easy or hard it may be to understand. Please feel free to ask any questions.
I will try to provide a real world example using a JCM on the Volleyball Set in the near future.