Michael_C opened this issue on Jul 23, 2010 · 5 posts
lesbentley posted Sat, 24 July 2010 at 6:24 PM
Glad you got it working Michael. I'll add a bit of explanation for others who may be following the thread. The "OneWay" channel in the BODY is the master channel that drives everything else, in this example it is a 'valueParm' channel, but it could be any type of channel:
valueParm OneWay
{
name OneWay
initValue 0
hidden 0
forceLimits 0
min -100000
max 100000
trackingScale 0.100
keys
{
static 0
k 0 0
}
interpStyleLocked 0
}
There is nothing special needed in this channel, it is just a normal valueParm channel. Two more valueParm channels "OneWay-A" and "OneWay-B" receive input from the master channel above. Here they are:
valueParm OneWay-A
{
name OneWay-A
initValue 0
hidden 1
forceLimits <span style="color:rgb(0,255,0);">1</span>
min <span style="color:rgb(0,255,0);">0</span>
max <span style="color:rgb(0,255,0);">100000</span>
trackingScale 0.004
keys
{
static 0
k 0 0
}
interpStyleLocked 0
valueOpDeltaAdd
Figure 1
BODY:1
OneWay
deltaAddDelta 1.000000
}
valueParm OneWay-B
{
name OneWay-B
initValue 0
hidden 1
forceLimits <span style="color:rgb(0,255,0);">1</span>
min <span style="color:rgb(0,255,0);">-100000</span>
max <span style="color:rgb(0,255,0);">0</span>
trackingScale 0.004
keys
{
static 0
k 0 0
}
interpStyleLocked 0
valueOpDeltaAdd
Figure 1
BODY:1
OneWay
deltaAddDelta 0.000000
}
The important thing to note, and the trick that makes the whole thing work, is the 'limits' on these two channels. The limits on "OneWay-A" have been set so that the channel can't go to a negative value, and the limits on "OneWay-B" are set so that it can't go to a positive value. This means that turning the "OneWay" master dial in a positive direction will affect OneWay-A, but will not affect OneWay-B because its limits prevent it from going positive. Conversely turning the master dial in the negative direction will affect OneWay-B, but can't affect OneWay-A. To complete the set up, we slave the xRotate channel to both OneWay-A and OneWay-B:
rotateX xRotate
{
name xrot
initValue 0
hidden 0
forceLimits 0
min -100000
max 100000
trackingScale 1
keys
{
static 0
k 0 0
}
interpStyleLocked 0
valueOpDeltaAdd
Figure 1
BODY:1
OneWay-<span style="color:rgb(0,255,0);">A</span>
deltaAddDelta <span style="color:rgb(0,255,0);">-0.214</span>
valueOpDeltaAdd
Figure 1
BODY:1
OneWay-<span style="color:rgb(0,255,0);">B</span>
deltaAddDelta <span style="color:rgb(0,255,0);">0.214</span>
}
Note that one block of slaving code uses a negative deltaAddDelta value and the other uses a positive value. This ensures that the actor (cube) will rotate in the same direction irrespective of whether the master dial goes positive or negative. Swapping the sign in the 'deltaAddDelta' lines of the two blocks of slaving code would make the actor rotate in the opposite sense.