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.4.py

23 lines
496 B
Python

"""
Update Example
++++++++++++++
It can be useful to perform an action when a property is changed and can be
used to update other properties or synchronize with external data.
All properties define update functions except for CollectionProperty.
"""
import bpy
def update_func(self, context):
print("my test function", self)
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
bpy.context.scene.testprop = 11.0
# >>> my test function <bpy_struct, Scene("Scene")>