Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-10-26 14:24:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-26 14:26:35 +0300
commit118664e4631a29c9a4f1f8e06be124c8ea3a006a (patch)
treed8550eb1e3112b5942e11ea0478aa8d98f84bd40
parent6d3d2988faad182eedc34210c651f8edb1cda6d8 (diff)
Fix custom property editing with Python 3.10
-rw-r--r--release/scripts/startup/bl_operators/wm.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 4dbdc6e633e..28bb0a58c02 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1298,6 +1298,13 @@ rna_vector_subtype_items = (
('QUATERNION', "Quaternion Rotation", "Quaternion rotation (affects NLA blending)"),
)
+
+# NOTE: needed for Python 3.10 since there are name-space issues with annotations.
+# This can be moved into the class as a static-method once Python 3.9x is dropped.
+def _wm_properties_edit_subtype_items(_self, _context):
+ return WM_OT_properties_edit.subtype_items
+
+
class WM_OT_properties_edit(Operator):
"""Change a custom property's type, or adjust how it is displayed in the interface"""
bl_idname = "wm.properties_edit"
@@ -1312,7 +1319,7 @@ class WM_OT_properties_edit(Operator):
property_name: rna_custom_property_name
property_type: EnumProperty(
name="Type",
- items=lambda self, _context: WM_OT_properties_edit.type_items,
+ items=rna_custom_property_type_items,
)
is_overridable_library: BoolProperty(
name="Is Library Overridable",
@@ -1404,7 +1411,7 @@ class WM_OT_properties_edit(Operator):
)
subtype: EnumProperty(
name="Subtype",
- items=lambda self, _context: WM_OT_properties_edit.subtype_items,
+ items=_wm_properties_edit_subtype_items,
)
# String properties.