bpy.props.py 498 B

12345678910111213141516171819
  1. """
  2. Assigning to Existing Classes
  3. +++++++++++++++++++++++++++++
  4. Custom properties can be added to any subclass of an :class:`ID`,
  5. :class:`Bone` and :class:`PoseBone`.
  6. These properties can be animated, accessed by the user interface and python
  7. like Blender's existing properties.
  8. """
  9. import bpy
  10. # Assign a custom property to an existing type.
  11. bpy.types.Material.custom_float = bpy.props.FloatProperty(name="Test Property")
  12. # Test the property is there.
  13. bpy.data.materials[0].custom_float = 5.0