[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34222] trunk/blender/release/scripts/ keyingsets/keyingsets_utils.py: "Available" Keying Set bugfix:
Joshua Leung
aligorith at gmail.com
Mon Jan 10 11:22:09 CET 2011
Revision: 34222
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34222
Author: aligorith
Date: 2011-01-10 10:22:08 +0000 (Mon, 10 Jan 2011)
Log Message:
-----------
"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.
Modified Paths:
--------------
trunk/blender/release/scripts/keyingsets/keyingsets_utils.py
Modified: trunk/blender/release/scripts/keyingsets/keyingsets_utils.py
===================================================================
--- trunk/blender/release/scripts/keyingsets/keyingsets_utils.py 2011-01-10 06:00:56 UTC (rev 34221)
+++ trunk/blender/release/scripts/keyingsets/keyingsets_utils.py 2011-01-10 10:22:08 UTC (rev 34222)
@@ -63,10 +63,22 @@
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)
# ------
More information about the Bf-blender-cvs
mailing list