diff options
Diffstat (limited to 'doc/python_api/examples/bpy.props.py')
-rw-r--r-- | doc/python_api/examples/bpy.props.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.props.py b/doc/python_api/examples/bpy.props.py new file mode 100644 index 00000000000..f6bc55d6824 --- /dev/null +++ b/doc/python_api/examples/bpy.props.py @@ -0,0 +1,18 @@ +""" +Assigning to Existing Classes ++++++++++++++++++++++++++++++ + +Custom properties can be added to any subclass of an :class:`ID`, +:class:`Bone` and :class:`PoseBone`. + +These properties can be animated, accessed by the user interface and python +like blenders existing properties. +""" + +import bpy + +# Assign a custom property to an existing type. +bpy.types.Material.custom_float = bpy.props.FloatProperty(name="Test Prob") + +# Test the property is there. +bpy.data.materials[0].custom_float = 5.0 |