Check if bone is keyed in an action?
Posted: Thu Feb 20, 2025 7:08 pm
---------------
Edit:
Basically I need to check if a bone is keyed in a specific smartbone action. That's the basic question.
----------------
So I'm working on an old script to smooth interpolate switches with bone rotation and got it working pretty good.
I would like this to work with smartbone actions but can't quite figure out how to find the smartbone that controls everything and use that key.
Here is how my script works.
You give a bone and switch layer the same name. The script matches them up and adds and deletes keys for the switch based on each angle KEY FRAME of the bone. works great. Works with bone constraints as well using fAngleControlParent to find keys.
For example:
A switch layer and a bone are both named "Phonemes".
Add an angle key on the bone and the switch gets keyed.
Delete the key on the bone and the switch key is deleted.
Lets mix it up a bit...
Remove all the keys.
Add an angle control bone called "Control". Add an angle control to the "Phonemes" bone.
The "Phonemes" bone now HAS NO KEYS and is controlled via constraint by the "Control" bone.
No problems! Works great! I just look for the fAngleControlParent of the "Phonemes" bone and use THOSE keys to key the switch layer.
Here's where I'm stuck.
I added a third bone called "SmartBone".
The bone called "Control" is only rotated in the "Smartbone" action.
The only bone with a keyframe now is "SmartBone".
The bone "Control" has no keys in the main timeline only in the smart bone action.
The bone "Phonemes" has no keys and neither does its fAngleControlParent so can't look there for keys.
I need to follow up this convoluted chain from the original "Phonemes" bone to it's fAngleControlParent, "Control" then continue up to the bone called "SmartBone" and use that key to key the switch layer.
Phew! good lord. I get dizzy thinking about it too hard.
I understand a bunch of the new scripting commands for actions, layer:HasAction for the layer and the bones etc. I just haven't figured out how to get there from the bone and switch layers with matching names. I need to go from a bone with no keys and a constraint, up to the fAngleControlParent which ALSO has no keys except in the "SmartBone" bones action. There's a gap in the path I can't figure out how to get across.
Edit:
Basically I need to check if a bone is keyed in a specific smartbone action. That's the basic question.
----------------
So I'm working on an old script to smooth interpolate switches with bone rotation and got it working pretty good.
I would like this to work with smartbone actions but can't quite figure out how to find the smartbone that controls everything and use that key.
Here is how my script works.
You give a bone and switch layer the same name. The script matches them up and adds and deletes keys for the switch based on each angle KEY FRAME of the bone. works great. Works with bone constraints as well using fAngleControlParent to find keys.
For example:
A switch layer and a bone are both named "Phonemes".
Add an angle key on the bone and the switch gets keyed.
Delete the key on the bone and the switch key is deleted.
Lets mix it up a bit...
Remove all the keys.
Add an angle control bone called "Control". Add an angle control to the "Phonemes" bone.
The "Phonemes" bone now HAS NO KEYS and is controlled via constraint by the "Control" bone.
No problems! Works great! I just look for the fAngleControlParent of the "Phonemes" bone and use THOSE keys to key the switch layer.
Here's where I'm stuck.
I added a third bone called "SmartBone".
The bone called "Control" is only rotated in the "Smartbone" action.
The only bone with a keyframe now is "SmartBone".
The bone "Control" has no keys in the main timeline only in the smart bone action.
The bone "Phonemes" has no keys and neither does its fAngleControlParent so can't look there for keys.
I need to follow up this convoluted chain from the original "Phonemes" bone to it's fAngleControlParent, "Control" then continue up to the bone called "SmartBone" and use that key to key the switch layer.
Phew! good lord. I get dizzy thinking about it too hard.
I understand a bunch of the new scripting commands for actions, layer:HasAction for the layer and the bones etc. I just haven't figured out how to get there from the bone and switch layers with matching names. I need to go from a bone with no keys and a constraint, up to the fAngleControlParent which ALSO has no keys except in the "SmartBone" bones action. There's a gap in the path I can't figure out how to get across.