1
1
This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/doc/python_api/examples/bpy.props.py
2019-03-22 00:07:06 +11:00

19 lines
498 B
Python

"""
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 Blender's existing properties.
"""
import bpy
# Assign a custom property to an existing type.
bpy.types.Material.custom_float = bpy.props.FloatProperty(name="Test Property")
# Test the property is there.
bpy.data.materials[0].custom_float = 5.0