From dd1132416e5bcbad5d4f80631b1a9f3152a514ee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Mar 2019 00:07:06 +1100 Subject: Docs: update examples for 2.8x Use fields for properties --- doc/python_api/examples/bpy.props.3.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'doc/python_api/examples/bpy.props.3.py') 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() -- cgit v1.2.3