[Bf-blender-cvs] [c8d6bba3cce] fracture_modifier: backport of master fix for https://developer.blender.org/T56969

Martin Felke noreply at git.blender.org
Sun Dec 2 22:17:00 CET 2018


Commit: c8d6bba3cce77ff2005205ab2af0d1757ef29b4c
Author: Martin Felke
Date:   Sun Dec 2 22:16:16 2018 +0100
Branches: fracture_modifier
https://developer.blender.org/rBc8d6bba3cce77ff2005205ab2af0d1757ef29b4c

backport of master fix for https://developer.blender.org/T56969

allows to let the branch run with python 3.7 too

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

M	source/blender/python/intern/bpy_rna.c

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

diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 0d3781ca176..38d139188f9 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -7388,7 +7388,13 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
 		identifier = RNA_property_identifier(prop);
 		item = PyObject_GetAttrString(py_class, identifier);
 
+		/* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */
+		/* backported fix from 2.79 master to allow 2.79b based fracture_modifier branch
+		 * running with Python 3.7x which would throw an error here,
+		 * symptom was no rendered UI elements,
+		 * https://developer.blender.org/T56969 - Martin Felke */
 		if (item == NULL) {
+			PyErr_Clear();
 			/* Sneaky workaround to use the class name as the bl_idname */
 
 #define     BPY_REPLACEMENT_STRING(rna_attr, py_attr)                         \
@@ -7404,6 +7410,9 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
 					}                                                         \
 					Py_DECREF(item);                                          \
 				}                                                             \
+				else {                                                        \
+					PyErr_Clear();                                            \
+				}                                                             \
 			}  /* intentionally allow else here */
 
 			if (false) {}  /* needed for macro */



More information about the Bf-blender-cvs mailing list