diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 23:56:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 23:56:39 +0300 |
commit | a61480c27103fbf449fd14ea8061b65c29f19eae (patch) | |
tree | 8d626b465ebe17936b7551aa91cc5b9d3b192607 /doc/python_api/examples/bpy.props.5.py | |
parent | a3cd57ea8c57c10d4c65ddd51faa6cce14c98e10 (diff) | |
parent | 532c8ac58384309e77791e32ab78f448ad2a76a6 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'doc/python_api/examples/bpy.props.5.py')
-rw-r--r-- | doc/python_api/examples/bpy.props.5.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py index a9e79fa0272..c428b4743f8 100644 --- a/doc/python_api/examples/bpy.props.5.py +++ b/doc/python_api/examples/bpy.props.5.py @@ -19,6 +19,7 @@ def get_float(self): def set_float(self, value): self["testprop"] = value + bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float) @@ -27,6 +28,7 @@ def get_date(self): import datetime return str(datetime.datetime.now()) + bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date) @@ -40,6 +42,7 @@ def get_array(self): def set_array(self, values): self["somebool"] = values[0] and values[1] + bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array) @@ -50,7 +53,7 @@ test_items = [ ("GREEN", "Green", "", 2), ("BLUE", "Blue", "", 3), ("YELLOW", "Yellow", "", 4), - ] +] def get_enum(self): @@ -61,6 +64,7 @@ def get_enum(self): def set_enum(self, value): print("setting value", value) + bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum) |