mirror of
https://github.com/blender/blender
synced 2026-11-22 03:45:13 +03:00
Examples were supported with/without number suffix, this caused problems using mypy for type checking because it attempted to resolve imports such as `mathutils` to the example file. Having only some examples numbered already complicated documentation for conventions with examples - simplify extraction and number all.
16 lines
581 B
Python
16 lines
581 B
Python
"""
|
|
Get the property associated with a hovered button.
|
|
Returns a tuple of the data-block, data path to the property, and array index.
|
|
|
|
.. note::
|
|
|
|
When the property doesn't have an associated :class:`bpy.types.ID` non-ID data may be returned.
|
|
This may occur when accessing windowing data, for example, operator properties.
|
|
"""
|
|
import bpy
|
|
|
|
# Example inserting keyframe for the hovered property.
|
|
active_property = bpy.context.property
|
|
if active_property:
|
|
datablock, data_path, index = active_property
|
|
datablock.keyframe_insert(data_path=data_path, index=index, frame=1)
|