[Bf-blender-cvs] [36863cf1294] blender-v2.93-release: Fix T87864: Context is None for draw method

Campbell Barton noreply at git.blender.org
Wed Apr 28 08:06:37 CEST 2021


Commit: 36863cf129460c1c3ce850a79c9a5660a7441379
Author: Campbell Barton
Date:   Wed Apr 28 15:58:30 2021 +1000
Branches: blender-v2.93-release
https://developer.blender.org/rB36863cf129460c1c3ce850a79c9a5660a7441379

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.

===================================================================

M	source/blender/makesrna/intern/rna_wm.c

===================================================================

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),



More information about the Bf-blender-cvs mailing list