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.props.3.py')
-rw-r--r--doc/python_api/examples/bpy.props.3.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/python_api/examples/bpy.props.3.py b/doc/python_api/examples/bpy.props.3.py
index 340618e5ca4..b8e0045fe58 100644
--- a/doc/python_api/examples/bpy.props.3.py
+++ b/doc/python_api/examples/bpy.props.3.py
@@ -9,18 +9,17 @@ Custom properties can be added to any subclass of an :class:`ID`,
import bpy
-# Assign a collection
+# Assign a collection.
class SceneSettingItem(bpy.types.PropertyGroup):
- name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
- value = bpy.props.IntProperty(name="Test Prop", default=22)
+ name: bpy.props.StringProperty(name="Test Property", default="Unknown")
+ value: bpy.props.IntProperty(name="Test Property", default=22)
bpy.utils.register_class(SceneSettingItem)
-bpy.types.Scene.my_settings = \
- bpy.props.CollectionProperty(type=SceneSettingItem)
+bpy.types.Scene.my_settings = bpy.props.CollectionProperty(type=SceneSettingItem)
-# Assume an armature object selected
+# Assume an armature object selected.
print("Adding 2 values!")
my_item = bpy.context.scene.my_settings.add()