diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-16 08:04:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-16 08:08:49 +0300 |
commit | 919558854d624f5db40acfa9f5674ac8c94873b6 (patch) | |
tree | 99d5d47119ccbd1f02fb0e04adbcdd177ceb1a8e /source/blender/windowmanager/intern/wm_operators.c | |
parent | 43b08d05786f83797d04e5d0f777ae9b888807f9 (diff) |
Fix T65064: Keymaps items controlling dynamic enums fail to export
Keymap UI and import/export could depend on the current
context for dynamic enum's.
Use STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID for OperatorProperties.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 84c16999c1b..9499ac56932 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -583,7 +583,8 @@ char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, i void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot) { - RNA_pointer_create(NULL, ot->srna, NULL, ptr); + /* Set the ID so the context can be accessed: see #STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID. */ + RNA_pointer_create(G_MAIN->wm.first, ot->srna, NULL, ptr); } void WM_operator_properties_create(PointerRNA *ptr, const char *opstring) @@ -594,7 +595,8 @@ void WM_operator_properties_create(PointerRNA *ptr, const char *opstring) WM_operator_properties_create_ptr(ptr, ot); } else { - RNA_pointer_create(NULL, &RNA_OperatorProperties, NULL, ptr); + /* Set the ID so the context can be accessed: see #STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID. */ + RNA_pointer_create(G_MAIN->wm.first, &RNA_OperatorProperties, NULL, ptr); } } |