Docs: update examples for 2.8x
Use fields for properties
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user