Sunday, May 26, 2019

Re: Blender - no gui menu displayed

On Sun, May 26 2019, Jeremie Courreges-Anglas <jca@wxcvbn.org> wrote:
> On Sat, May 25 2019, Pascal Stumpf <pascal@stumpf.co> wrote:
>> OK for this patch for now, will look at the update later.
>
> Done.
>
> As I said the update to 2.79b alone didn't solve the python3.7 problem,
> but my diff also included a fix from upstream for that specific problem.
> I probably shouldn't have mixed those up.
>
> The diff below is probably a better way forward if people want to get
> rid of python3.6 before blender-2.80 reaches our tree.
>
> Thoughts?

There is not much point adding said python3.7 fix if we don't switch
blender back to python3.7. Sorry about that, here's an updated diff.
Again, slightly tested, the menus show up properly.


Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/blender/Makefile,v
retrieving revision 1.92
diff -u -p -r1.92 Makefile
--- Makefile 26 May 2019 11:09:30 -0000 1.92
+++ Makefile 26 May 2019 12:47:12 -0000
@@ -5,7 +5,7 @@ ONLY_FOR_ARCHS = amd64 i386
COMMENT = 3D creation software

DISTNAME = blender-2.79
-REVISION = 6
+REVISION = 7

CATEGORIES = graphics

@@ -32,7 +32,7 @@ MODULES = devel/cmake \

COMPILER = base-clang ports-gcc

-MODPY_VERSION = 3.6
+MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}

CONFIGURE_ARGS = -DPYTHON_INCLUDE_DIR="${MODPY_INCDIR}" \
-DPYTHON_VERSION=${MODPY_VERSION} \
Index: patches/patch-source_blender_python_intern_bpy_rna_c
===================================================================
RCS file: patches/patch-source_blender_python_intern_bpy_rna_c
diff -N patches/patch-source_blender_python_intern_bpy_rna_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-source_blender_python_intern_bpy_rna_c 26 May 2019 12:47:12 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Fix PyRNA class registration w/ Python 3.7
+https://developer.blender.org/rB1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f
+
+Index: source/blender/python/intern/bpy_rna.c
+--- source/blender/python/intern/bpy_rna.c.orig
++++ source/blender/python/intern/bpy_rna.c
+@@ -7389,6 +7389,7 @@ static int bpy_class_validate_recursive(PointerRNA *du
+ item = PyObject_GetAttrString(py_class, identifier);
+
+ 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 +7405,9 @@ static int bpy_class_validate_recursive(PointerRNA *du
+ } \
+ Py_DECREF(item); \
+ } \
++ else { \
++ PyErr_Clear(); \
++ } \
+ } /* intentionally allow else here */
+
+ if (false) {} /* needed for macro */


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

No comments:

Post a Comment