[solved]Drive a Pose IPO Curve of a bone to another one, inside same armature

Hi all,
I got a “problem”, i wanna drive rotX, rotY, rotZ IPO curves from a bone to an other bone’s IPO rotX, rotY, rotZ curves… So, when I had to enter the name of the driver object, I entered the name of the armature, and it told me tha it couldn’t assign a Driver to own object… Then I tried a name like Armature.Head, Armature[‘Head’], Armature(Head), but, no success… So my questions are : is that possible ? If yes, how?
Please, does someone knows it ?

I encountered the same limitation some weeks ago.
If I remember well, I used Copy Rotation constraints instead of Drivers to do the thing.

Yeah while your assumption is correct, IPO drivers are a shortcoming of Blender.

To copy a rotation, use the "Copy Rotation constraint from the constraint menu.
shortcut : select your source bone, then shift-select your target bone, and press Ctrl+Alt+C and select “Copy Rotation” from the menu

Hope that helps

All right, thanx guys :), if i’m lucky it will be correctly translated when exporting to egg format… but wathever, thanx agin, it will be usefull :wink:

Unfortunatelly this cannot be done direct because how dependency is coded in Blender. Maybe Blender 2.5 willl help.

But you can over come it with external object. For example from bone 1 of an Armture transform its IPO feature though IPO driver to a cube and from the cube use IPO driver to transform it to the bone 2 of the same Armature.

You’re right ! I don’t know why I didn’t think about it… Thanx man, great idea :yes:

Odd, I’ve been doing it for approaching a year now (!!) on my Katrice model’s armature. I’ve had to do some small workarounds to get animations rendered properly but it is quite feasible if you’re willing to get your hands dirty well under the BPython hood.

I use the relative rotation angle between various bones to calculate values that are then used to transform bones that do corrective deformations in the same armature. Works pretty good, though the maths involved are a bit hairy due to the different spaces the bones occupy and how their rotations within these spaceframes are related to one another. All of this is coded into a pydrivers.py script that can then be turned into an NLA strip and combined with IK and FK IPO curve animations.

Sounds good too, but for now I must get used to blender basics features, how to operate in it, and Blender API Structure… for example, I almost know nothing about the NLA part and its associated features :spin: … So, I will remember what you said and study it just… later ;), but thanx to you man

Sorry, I have just tested my proposal. There is also dependency chain issue so you need to skip one frame to make it work which is not really good for animating.

This is true if using the ANIMATE button in the Render context to do a range of frames. It stymied me for a while also, but I found that if you use F12 or the RENDER button, each frame renders as expected with no dependency issues.

So, I just wrote a fairly simple script that automates pressing the RENDER button (F12) for a number of specified consecutive frames, and advances the frame count and names the render output accordingly, frame by frame. My script isn’t “pretty” enough for public use, no UI or anything, you have to edit it directly to do the inputs, but it shows that you can work around the depsgraph issues.

Wow, you can overcome it by script? That would be great. Because my suggested solution works (rendering etc.) but it is not animator friendly when you do not have direct response in 3d view and had to go one frame forth and back. But this is well known problem and Blender 2.5 architecture might help.

Anyway if you could solve this, chipmasque, to automate it via script so no frames skipping will be needed many blenderheads will be grateful. (it would solve some FK IK switches proposals for example, complicated constrained chaines etc.) Good luck!

My script doesn’t affect anything in the UI, just solves the problem when rendering. Sorry.

In 3D views, my model’s driven IPOs update OK as long as I don’t move more than one frame at a time, so If I jump a handful of frames, I need to then move ahead one frame to get the update to take effect. This sounds like the “skip” you mentioned but maybe it’s not the same? In any case, it hasn’t been terribly problematic to work around this in the UI, it’s become a matter of habit to jump one frame behind my target, then R arrow-key to the target frame.

Hmmm… Excuse me but, yersterday, I wanted to try this method with a dummy, but I can’t figure out how you do someting…
I’ve created a simple Armature of 2 bones (B1,B2) and an empty object next to it (Dummy). So, my goal was to drive Armature.B1.QuatY to Dummy.RotY, and then drive this last to Armature.B2.QuatY… But here is my problem, when I wanted to drive Dummy.RotY to Armature.B2.QuatY, I first selected Dummy.rotY curve, open the transform properties, click on add driver button, enter the Armature’s name, next to it, select the pose channels, enter The the bone 2 name (B2), and… and… I could’nt find out the QuatY channel ! So I tried to drive the rotY channel, but there is no effects…
Here are my questions :
How do you do ?
Personnally to obtain something nearest from Euler than Quaternions, I fix the QuatW to 1.0 with a simple python expression (“1”), and you, can you operate on true Euler, or on a “Euler Fake” too ?

@N.tox – sounds like you need to use the math function(s) that convert Eulers to Quats and/or Quats to Eulers. The values of different types can’t be used directly to replace one another – Quats & Eulers aren’t equivalent in any numeric sense without conversion.

Ok, but I’ll stay with my method, it acts like the Euler rotations (or it looks to, even if it is beneath truly different). But whatever, I found a way to connect a bone’s Quatn curve to an other bone’s Quatn curve inside the same armature, it’s a python drive type… Maybe it is obious to you but who knows, perhaps someone will be interested, here is what I did:

Let’s create an armature of 2 bones, we will call this OBject “Arma”, and call the first and the second bone respectivly ‘B0’ and 'B1".
We want B0.QuatY curve be driven by B1.QuatY curve, enter in PoseMode from 3D View and select them all, and insert a key of whatever (loc and/or Rot, we don’t care), open an IPO curve window, select PoseType, select all curves, and erase them all.
Now, select B0.QuatY and open its transform properties, Add a Driver, select the python mode, and enter:

 
Blender.Object.Get('Arma').getPose().bones['B1'].quat[2]

But, if you rotate B1 from the 3D View, you won’t see the effects “in live”, but by IPO window, it works pretty good :smiley: (and like I animate only with curves…)

NOTE: at the end of the expression I used .quat[2] which correcpond to QuatY, the instance variable “quat” return a quaternion object, which is a list (in fact, an object which inherit list methods) of four values : [w, x, y, z], and the [2] correspond to the index of the wanted value in the list (index start at 0). So, w index = 0, x index =1, etc…
for the location, the instance variable is “loc”, and “loc” return a list of three values [x,y,z]. Finally, to acces to the scale, the instance variable is “size” and not scale…

That’s similar to the approach I’ve used in terms of the Python expression, the main difference being that I put everything into a pydrivers.py script and reference that in the IPO driver slot. This allows for much more complex Python expressions (functions, actually) to be used. I can also see the model update in the 3D window if I make the pydrivers IPOs into an Action and make that Action active on the Armature.

I can then take things a step further and convert the pydrivers Acton into an NLA strip, so it can be combined with other animation in the NLA Editor. This way I have two “sources” for animation data: the pydrivers, which manipulate only the corrective bones in my rig, and are basically fully automated, and also the “full motion” animations that move the main Armature, basically just your standard set of IPOs->Action->NLA.

Ok, I understand now the utility of the pydriver.py , and I still have to study the NLA stuffs… hmmm about the pydriver.py, where do I put it ? In "/.blender/scripts/ " ? And I red somewhere that we had to open it in the text window (i find it weird…), is it really necessary ?

Yes, you must have the pydrivers.py script as a Text file available to the .blend where you use it, but it doesn’t have to be the active Text file in the Text Editor. Putting it in the Scripts folder will do nothing for you, it isn’t accessed exactly like other scripts (though you can run those from the Text window, also).

This web page:

http://kokcito.tk/tut/shoulders.html

got me started on how to use pydrivers.py, and has tons of other excellent info in it as well, it’d be a good place to start learning.

BTW, you can save the script from the Text Editor window, but the .blend will only use the one present in the Text Editor. I use this to save multiple versions of the pydrivers.py script so I can backtrack easily when necessary.

A great link ! :yes:
Thanx a lot for your explainations :wink:

EDIT: in fact, I already knew a lot of the things he said, but under Max… I personnaly prefer not use the morphing… just bones (bigger challenge, and less problem once it’s done…). too bad that image’s links are broken :frowning:

It seems that your are really going somewhere with this guys. Nice to follow your researches. I am really sorry not to no nearly anything concerning python coding :frowning: