Docs: update examples for 2.8x

Use fields for properties
This commit is contained in:
2019-03-22 00:07:06 +11:00
parent bd1299f6a4
commit dd1132416e
13 changed files with 90 additions and 60 deletions

View File

@@ -10,15 +10,14 @@ import bpy
class MaterialSettings(bpy.types.PropertyGroup):
my_int = bpy.props.IntProperty()
my_float = bpy.props.FloatProperty()
my_string = bpy.props.StringProperty()
my_int: bpy.props.IntProperty()
my_float: bpy.props.FloatProperty()
my_string: bpy.props.StringProperty()
bpy.utils.register_class(MaterialSettings)
bpy.types.Material.my_settings = \
bpy.props.PointerProperty(type=MaterialSettings)
bpy.types.Material.my_settings = bpy.props.PointerProperty(type=MaterialSettings)
# test the new settings work
material = bpy.data.materials[0]