Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2011-04-21 05:21:28 +0400
committerJoshua Leung <aligorith@gmail.com>2011-04-21 05:21:28 +0400
commit18e4f7de4f9e4a59b9123df5b2025776b11bb11d (patch)
treef7c656f31f160d9cd80ad2151afcdc9d45ec17d3 /release/scripts/startup/keyingsets_builtins.py
parent26916206f80bb55d1ea71ef8108336109cebd90b (diff)
Bugfix [#27090] Available keying set fails in armature pose mode
A change in the poll callback that Available KeyingSet used to use restricted its use to Object-mode only, while this could also be useful in Pose Mode (though it would only affect all channels there). Made this use a custom poll callback now that tests for whether the active object has an action. This does mean that if you select a bunch of objects with animation data, but the active object doesn't have it, then the keyingset will fail to fire, but that's been marked as a todo in the code.
Diffstat (limited to 'release/scripts/startup/keyingsets_builtins.py')
-rw-r--r--release/scripts/startup/keyingsets_builtins.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index 0775d38c437..8cb63ea48cf 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -215,10 +215,14 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
bl_label = "Available"
- # poll - use predefined callback for selected objects
- # TODO: this should really check whether the selected object (or datablock)
- # has any animation data defined yet
- poll = keyingsets_utils.RKS_POLL_selected_objects
+ # poll - selected objects or selected object with animation data
+ def poll(ksi, context):
+ ob = context.active_object
+ if ob:
+ # TODO: this fails if one animation-less object is active, but many others are selected
+ return ob.animation_data and ob.animation_data.action
+ else:
+ return bool(context.selected_objects)
# iterator - use callback for selected bones/objects
iterator = keyingsets_utils.RKS_ITER_selected_item