diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-21 16:07:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-21 16:07:06 +0300 |
commit | dd1132416e5bcbad5d4f80631b1a9f3152a514ee (patch) | |
tree | c3ccf1d18376d42a818dc22c962bcdefc370f0f4 /doc/python_api/examples/bpy.props.3.py | |
parent | bd1299f6a4398e06db00d77f9ea7382f9e7bcf53 (diff) |
Docs: update examples for 2.8x
Use fields for properties
Diffstat (limited to 'doc/python_api/examples/bpy.props.3.py')
-rw-r--r-- | doc/python_api/examples/bpy.props.3.py | 11 |
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() |