In testing to set up an oscillating tail I set up three attributes, called ZOscillateStrength ZOscillateSpeed and ZOscillateBend for oscillating in the Z axis, onto a control object and then put this expression onto the root joint
joint1.rotateZ = sin(frame * joint1.ZOscillateSpeed)* joint1.ZOscillateStrength;
the following expressions were applied to the the rest of the joints in the chain
joint2.rotateZ = joint1.rotateZ * joint1.ZBend
joint3.rotateX = joint1.rotateX * joint1.XBend
When values are put into all of my attributes this creates the effect of the tail wagging similar to how a fish would travel through water and is what I'm looking for.
In my actual rig I have set up a spline IK from the second joint in the chain all the way to the end, clustered the curve and parent constrained all but the first cluster to a controller. The first expression has been applied to the first joint in the chain and the tail can wag rigidly and then be keyframed using the controllers.
My problem is that with all but the first joint in the chain being controlled by a splineIK curve I cannot put my second set of expressions into place because rest of the joints attributes are already being controlled. I have looked into trying to set up a broken hierarchy so that the control the splineIK has on the joints can be turned on and off but I has of yet been unable to find anything like this.
If anyone has any advice or suggestion on how to solve this problem it would be greatly appreciated.