[Solved] Using Intra Armature Drivers and Copy Rotation Constraints in b3d 2.76

Colleagues:

I have been trying to get intra armature drivers to work in 2.76 (i.e. some bones rotations are drivers for other bones rotations, mapping local z rotations of one bone to local z and local y rotations of another)

It seems to be working, although not in the way I want (bone 1 z rotation will map to bone 2 z rotation ok, but not to bone 2 y rotation)

Should I even be trying to do this? https://developer.blender.org/T40301 indicates that as of 2014 doing this type of driver setup was not possible, but I cannot trace out whether the issue has been straightened out.

Attached is the armture I am working on. I am trying to get the following setup to work

Local z rotation of bone 1_1.R and 1_1.L drive local z rotation of bone helper_0_1, with the values of the driving bones averaged.

Local z rotation of bone 1_1.R and 1_1.L drive local y rotation of bone helper_0_1, with the values of the driving bones averaged.

Local z rotation of bone 1_1.R and 2_1.R drive local z rotation of bone helper_1_1.R, with the values of the driving bones averaged.

Local z rotation of bone 1_1.R and 2_1.R drive local y rotation of bone helper_1_1.R, with the values of the driving bones averaged.

I find that no matter what I do, I cannot get the z and y rotations of the “helper” bones to rotate correctly at the same time, whether I use xyz euler rotations or xyzw quaternions.

If I restrict myself to getting the adjacent bones to drive the y rotation of the ‘helper’ bones only, I find that i if i set up the helper bone to rotate correctly for, say bone helper_0_1, I have to mirror by values over cursor value in the driver graph view. But by doing that, I cannot get the bone helper 1_1,R to behave correctly without doing another mirror by values over cursor value in the graph view, which reverses the rotation of helper_0_1, since doing a mirror command on the driver graph view affects all drivers. So if I make helper_0_1 rotate correctly around its local y axis, helper_1_1.R rotates opposite to what I intend. If I go ahead and mirror values over cursor value for to make helper_1_1.R behave, then helper_0_1 rotates opposite to what I intend.

I’m rigging an octopus, so I’m trying to use drivers to make it so the user does not have to manually rotate the helper bones, which control the deformations of the webs between the tentacles. If the webs do not have any bones, they don’t deform correctly (i.e. their faces self intersect, twist, and in general, become a mess.)

What I am trying to do may be impossible with blender’s current capabilities, so I don’t want to spend time doing something that atm blender just cannot do.

the blend file is attached, with my aborted attempts to get those helper bones to rotate around their local y axis correctly.

ideally i would like the helper bones to be driven by the adjacent bones’ local z rotations to do local z and local y rotations correctly, but as described above, trying to get the driven y rotations to behave as intended is proving impossible.

thanks alot for your input!

Attachments

octodriversarmatureonly.blend (162 KB)

One issue you may be fighting is the the bone roll, the R and L have opposite local Z’s (See image) This is a solution using 2 bone constraints copy rotation each with 50% influence. The driver was deleted.
octodriversarmatureonly2.blend (171 KB)


thanks! i’ll try that out.

Photox thanks your solution takes care of 1/2 of the problem. Now I can see how the copy rotation constraint can take care of the local z rotation of the helper bone (the one in the middle).

The second half of the problem has me stumped, which is to make the helper bone rotate in a counterclockwise fashion along its local y axis from the bone on the right in your screenshot, when the bone on the right is rotated up towards a horizontal level along its local z axis, and to make the helper bone rotate in a clockwise fashion along its local y axis from the bone on the left in your screenshot, when the bone on the left is rotated up towards a horizontal level along its local z axis. I have attached the file (based on yours) where i have a driver affecting the euler y axis of the middle helper bone, using the averaged value of the z local rotation of the flanking bones, but the bone does not rotate as intended as you can see when you press alt a (i’ve hidden all the other bones in pose mode to make the file easier to look at.)

thanks for your help!

Attachments

octodriversarmatureonly3.blend (159 KB)

I think this is what you want. I switched everything to euler, and changed your averaged value driver to scripted expression. The flipped rolls are going to be trouble for averaged value, so you just multiply one of them by -1. At the end I am dividing by 3, it could be 2 - or 10, higher numbers will dampen the local y rolling.
octodriversarmatureonly4.blend (166 KB)


thanks!!!
i have to figure out how to enable execution of scripted expressions but i think i’ll be able to figure that out

as for that expression, i would have to go through a deep dark rabbit hole to find that out.

I had a problem with the execution of python expressions, so, for the blenderhivemind, to enable the execution of an expression as shown in the screen shot above, goto preferences>file>and check Auto run Python Scripts, to the left of Auto execution
Photox I’d have to go back to high school, relearn what I knew, and then learn a bit more to figure your solution out.

Thanks!!! while this applies to an octopus, it must be useful for any rig with appendages and stuff (like webbing) between appendages. it saves alot of manual work. (so I think now, I have to test everything with the mesh, but it looks like it will work.)

[edit]

I appended the mesh from another file, and this rig works perfectly. Until the next issue I encounter. (I’m getting it to work with spline ik, an armature that controls the spline that controls the deformation armature that I’ve posted to this thread, and softbody physics…but I don’t see any reason why the setup you helped me with so much will not work.)

Cool, good luck.

I added spline ik to the right tentacle (1_1.R-1_6.R), and it deactivated the rotation constraint on the deformation mesh bone 1_1.R. As per a response to another one of my posts, spline ik disables all other constraints on the bones in the bone chain, but thanks Photox for teaching me to use drivers to achieve the same result.

So I added a driver local z rotation 1_1.R (var 1) and 1_1.L, var2, using the expression “((1var1) -( 1var2))/1” > local z rotation helper 0_1.

I added the coeffecients for both var1 and var2 because I lose track of which one has to be inverted, but the equation above works.

I believe https://www.blender.org/manual/animation/drivers.html is outdated on this issue as it still states:

Intra-armature Bone Drivers Can Misbehave
There is a well known limitation with drivers on bones that refer to another bone in the same armature. Their values can be incorrectly calculated based on the position of the other bone as it was before you adjust the current_frame. This can lead to obvious shape glitches when the rendering of frames has a jump in the frame number (either because the .blend file is currently on a different frame number or because you’re skipping already-rendered frames).

but, knock on computer, it’s all working in blender 2.76 and playing nice with ogre 1.9

one thing i’ve noticed though, is that the variable names for the source values for the values in then scripted expression for each bone must be unique, otherwise a variable , say var1, in one driver, for bone1, affects the result for bone2, which has its own var1 as part of the expression