From 43b08d05786f83797d04e5d0f777ae9b888807f9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 16 Apr 2021 15:04:37 +1000 Subject: RNA: add STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID flag This flag is needed so PointerRNA structs that aren't part of the current context can access enum values without inspecting the context. This is needed for keymap access, so the keymap UI and keymap export doesn't depend on the current context. --- source/blender/makesrna/RNA_types.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/makesrna/RNA_types.h') diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 78192f937e6..6cd3678017e 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -636,6 +636,12 @@ typedef enum StructFlag { STRUCT_PUBLIC_NAMESPACE = (1 << 9), /** All subtypes are added too. */ STRUCT_PUBLIC_NAMESPACE_INHERIT = (1 << 10), + /** + * When the #PointerRNA.owner_id is NULL, this signifies the property should be accessed + * without any context (the key-map UI and import/export for example). + * So accessing the property should not read from the current context to derive values/limits. + */ + STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID = (1 << 11), } StructFlag; typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function); -- cgit v1.2.3