diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-30 09:03:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-30 09:03:47 +0300 |
commit | a2b8dad469a0f7fa16d73cccfdbd37c9d5d5c10d (patch) | |
tree | ebb41643bd1df2bb33664b89e42f17526a31c5af /source/blender/python/intern/bpy_rna.h | |
parent | ddcb6b1023bf3089cd6d2db3012b68b9ec2b980f (diff) |
PyAPI: support accessing the original value for RNA enum parsing
Needed in siturations when the input argument is needed for exception messages.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.h')
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 23a6b19c22c..24dbad53eb3 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -219,6 +219,13 @@ int pyrna_set_to_enum_bitfield(const struct EnumPropertyItem *items, */ struct BPy_EnumProperty_Parse { const EnumPropertyItem *items; + /** + * Set when the value was successfully parsed. + * Useful if the input ever needs to be included in an error message. + * (if the value is not supported under certain conditions). + */ + PyObject *value_orig; + int value; bool is_set; }; |