diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-28 08:58:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-28 09:05:53 +0300 |
commit | 36863cf129460c1c3ce850a79c9a5660a7441379 (patch) | |
tree | ce552d331829d5d3ed98a0424b188787fc46c5a1 | |
parent | 7e678c30964c4c0d9d2c020f25e8ac717211c208 (diff) |
Fix T87864: Context is None for draw method
Use WM_operator_properties_create_ptr so the owner_id is
set to the window manger which is now required.
Regression in 919558854d624f5db40acfa9f5674ac8c94873b6.
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d7a988383a7..2b1a5f7fde1 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -604,14 +604,22 @@ static PointerRNA rna_Operator_options_get(PointerRNA *ptr) static PointerRNA rna_Operator_properties_get(PointerRNA *ptr) { wmOperator *op = (wmOperator *)ptr->data; - return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties); + + PointerRNA result; + WM_operator_properties_create_ptr(&result, op->type); + result.data = op->properties; + return result; } static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr) { wmOperatorTypeMacro *otmacro = (wmOperatorTypeMacro *)ptr->data; wmOperatorType *ot = WM_operatortype_find(otmacro->idname, true); - return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties); + + PointerRNA result; + WM_operator_properties_create_ptr(&result, ot); + result.data = otmacro->properties; + return result; } static const EnumPropertyItem *rna_Event_value_itemf(bContext *UNUSED(C), |