* Enabled rna access to fluid sim velocity vectors
[blender-staging.git] / release / scripts / startup / keyingsets_builtins.py
index 0775d38c437d497812566a6648b37c42446c4fbb..8cb63ea48cffb2fbf41c9d0c2fdef5788ec298bd 100644 (file)
@@ -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