Page MenuHome

Incorrect api documentation for 'keyframe_insert' optional flags
Closed, ResolvedPublic

Description

System Information
Windows 10 64-bit, Nvidia gtx 570, Nvidia gt 610

Blender Version
Broken: 2.77a, 9f39619 (latest 64-bit build)
Worked: -

Short description of error

Both the online api documentation and Blender's built in 'Python Console' list the optional flags for bpy.types.bpy_struct.keyframe_insert as:

  • 'NEEDED'
  • 'VISUAL'
  • 'XYZ_TO_RGB'

However, all the optional flags need to be proceeded by INSERTKEY_ to work, e.g.:

  • 'INSERTKEY_NEEDED'
  • 'INSERTKEY_VISUAL'
  • 'INSERTKEY_XYZ_TO_RGB'

It is either a convention I am unaware of, that all options get proceeded by something, or the documentation needs to be updated or the API changed. The only way to know that INSERTKEY_ needs to proceed those flags is to see the error message when entering them incorrectly.

Exact steps for others to reproduce the error

  1. In the default Blender scene type the following in the 'Python Console' and press Ctrl+Space or the 'Autocomplete' button to see the internal 'optional flags' documentation:

bpy.data.objects['Cube'].keyframe_insert(

  1. Now paste this in the 'Python Console' and press enter to see the error message:

bpy.data.objects['Cube'].keyframe_insert(data_path="location", options={'NEEDED'})

  1. See how the flags are described here:

https://www.blender.org/api/blender_python_api_2_77a_release/bpy.types.bpy_struct.html?highlight=keyframe_insert#bpy.types.bpy_struct.keyframe_insert

Event Timeline

Ray Mairlot (madog) updated the task description. (Show Details)
Ray Mairlot (madog) raised the priority of this task from to Needs Triage by Developer.
Ray Mairlot (madog) set Type to Bug.