diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-01-10 13:22:08 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-01-10 13:22:08 +0300 |
commit | 1b19ffb8c722a9ee450e94fbcef9504a27286928 (patch) | |
tree | a160594b3d3e624c06a0d16de467b94add751fb4 /release | |
parent | b0af2b5f3e1eb96a428de36c2e41316f12f3308a (diff) |
"Available" Keying Set bugfix:
This builtin Keying Set is supposed to insert keyframes for every
F-Curve that exists for the selected data (usually objects and/or
bones only). However, as coded, it was only useful for objects, since
it would just go through all the F-Curves for the object's action,
instead of just the F-Curves relevant to a selected bone.
Tweaked the code to make this case (and similar ones) hopefully work
better by default.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/keyingsets/keyingsets_utils.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/release/scripts/keyingsets/keyingsets_utils.py b/release/scripts/keyingsets/keyingsets_utils.py index 901aa715296..953cff9e01e 100644 --- a/release/scripts/keyingsets/keyingsets_utils.py +++ b/release/scripts/keyingsets/keyingsets_utils.py @@ -63,10 +63,22 @@ def RKS_GEN_available(ksi, context, ks, data): if adt is None or adt.action is None: return; - # for each F-Curve, include an path to key it + # if we haven't got an ID-block as 'data', try to restrict + # paths added to only those which branch off from here + # i.e. for bones + if id_block != data: + basePath = data.path_from_id() + else: + basePath = None; # this is not needed... + + # for each F-Curve, include a path to key it # NOTE: we don't need to set the group settings here for fcu in adt.action.fcurves: - ks.paths.add(id_block, fcu.data_path, index=fcu.array_index) + if basePath: + if basePath in fcu.data_path: + ks.paths.add(id_block, fcu.data_path, index=fcu.array_index) + else: + ks.paths.add(id_block, fcu.data_path, index=fcu.array_index) # ------ |