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:
Diffstat (limited to 'doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py')
-rw-r--r--doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py b/doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py
index d46ffcc8373..27706c06688 100644
--- a/doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py
+++ b/doc/python_api/examples/bpy.types.bpy_struct.keyframe_insert.1.py
@@ -5,25 +5,32 @@ than the bone.
"""
import bpy
-from bpy.props import PointerProperty
+from bpy.props import (
+ FloatProperty,
+ PointerProperty,
+)
-# define a nested property
+# Define a nested property.
class MyPropGroup(bpy.types.PropertyGroup):
- nested = bpy.props.FloatProperty(name="Nested", default=0.0)
+ nested: FloatProperty(name="Nested", default=0.0)
-# register it so its available for all bones
+# Register it so its available for all bones.
bpy.utils.register_class(MyPropGroup)
-bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
- name="MyProp")
+bpy.types.Bone.my_prop = PointerProperty(
+ type=MyPropGroup,
+ name="MyProp",
+)
-# get a bone
+# Get a bone.
obj = bpy.data.objects["Armature"]
arm = obj.data
-# set the keyframe at frame 1
+# Set the keyframe at frame 1.
arm.bones["Bone"].my_prop_group.nested = 10
-arm.keyframe_insert(data_path='bones["Bone"].my_prop.nested',
- frame=1,
- group="Nested Group")
+arm.keyframe_insert(
+ data_path='bones["Bone"].my_prop.nested',
+ frame=1,
+ group="Nested Group",
+)