From 2b327d1c0eb5d018023ada2b72167275aef73b1f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 9 Jun 2023 17:47:06 +0200 Subject: [PATCH 1/6] Fix realtime compositor unsupported node warnings shown for hidden 3D views --- source/blender/editors/space_node/node_draw.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 7009cb5ce93..07cf94d4c0a 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -3327,15 +3327,13 @@ static bool realtime_compositor_is_in_use(const bContext &context) return false; } - const Main *main = CTX_data_main(&context); - LISTBASE_FOREACH (const bScreen *, screen, &main->screens) { + wmWindowManager *wm = CTX_wm_manager(&context); + LISTBASE_FOREACH (const wmWindow *, win, &wm->windows) { + const bScreen *screen = WM_window_get_active_screen(win); LISTBASE_FOREACH (const ScrArea *, area, &screen->areabase) { - LISTBASE_FOREACH (const SpaceLink *, space, &area->spacedata) { - if (space->spacetype != SPACE_VIEW3D) { - continue; - } - - const View3D &view_3d = *reinterpret_cast(space); + const SpaceLink &space = *static_cast(area->spacedata.first); + if (space.spacetype == SPACE_VIEW3D) { + const View3D &view_3d = reinterpret_cast(space); if (view_3d.shading.use_compositor == V3D_SHADING_USE_COMPOSITOR_DISABLED) { continue; From 61ead957a0129cce141c2aa1a3e65cb378eb8437 Mon Sep 17 00:00:00 2001 From: nutti Date: Sun, 11 Jun 2023 18:17:06 +0900 Subject: [PATCH 2/6] Docs: Fix bpy.types.Operator.poll_message_set() method to classmethod Pull Request: https://projects.blender.org/blender/blender/pulls/108854 --- source/blender/python/intern/bpy_rna_operator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_rna_operator.c b/source/blender/python/intern/bpy_rna_operator.c index e0a4356dc18..ce82e8396df 100644 --- a/source/blender/python/intern/bpy_rna_operator.c +++ b/source/blender/python/intern/bpy_rna_operator.c @@ -77,7 +77,7 @@ static void pyop_poll_message_free_fn(bContext *UNUSED(C), void *user_data) } PyDoc_STRVAR(BPY_rna_operator_poll_message_set_doc, - ".. method:: poll_message_set(message, *args)\n" + ".. classmethod:: poll_message_set(message, *args)\n" "\n" " Set the message to show in the tool-tip when poll fails.\n" "\n" From c3514b0eb7fceb4b38e38ea512688da9e2e4c701 Mon Sep 17 00:00:00 2001 From: nutti Date: Sun, 11 Jun 2023 17:58:12 +0900 Subject: [PATCH 3/6] Docs: add data types of missing bpy.types.Object properties Pull Request: https://projects.blender.org/blender/blender/pulls/108852 --- scripts/modules/bpy_types.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/modules/bpy_types.py b/scripts/modules/bpy_types.py index ca62145dc87..9d67805a481 100644 --- a/scripts/modules/bpy_types.py +++ b/scripts/modules/bpy_types.py @@ -178,6 +178,8 @@ class Object(bpy_types.ID): def children(self): """All the children of this object. + :type: tuple of `Object` + .. note:: Takes ``O(len(bpy.data.objects))`` time.""" import bpy return tuple(child for child in bpy.data.objects @@ -187,6 +189,8 @@ class Object(bpy_types.ID): def children_recursive(self): """A list of all children from this object. + :type: tuple of `Object` + .. note:: Takes ``O(len(bpy.data.objects))`` time.""" import bpy parent_child_map = {} @@ -209,6 +213,8 @@ class Object(bpy_types.ID): """ The collections this object is in. + :type: tuple of `Collection` + .. note:: Takes ``O(len(bpy.data.collections) + len(bpy.data.scenes))`` time.""" import bpy return ( @@ -225,6 +231,8 @@ class Object(bpy_types.ID): def users_scene(self): """The scenes this object is in. + :type: tuple of `Scene` + .. note:: Takes ``O(len(bpy.data.scenes) * len(bpy.data.objects))`` time.""" import bpy return tuple(scene for scene in bpy.data.scenes From 57f7721ffc31fe96aa4bdb8c48e853629ca656a1 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 9 Jun 2023 23:12:39 -0400 Subject: [PATCH 4/6] Build: fix NetBSD support in Glog Pull Request: https://projects.blender.org/blender/blender/pulls/108835 --- extern/glog/src/config.h | 2 + extern/glog/src/config_netbsd.h | 192 ++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 extern/glog/src/config_netbsd.h diff --git a/extern/glog/src/config.h b/extern/glog/src/config.h index fa704c912b1..643850f5016 100644 --- a/extern/glog/src/config.h +++ b/extern/glog/src/config.h @@ -2,6 +2,8 @@ #include "config_mac.h" #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "config_freebsd.h" +#elif defined(__NetBSD__) + #include "config_netbsd.h" #elif defined(__OpenBSD__) #include "config_openbsd.h" #elif defined(__MINGW32__) diff --git a/extern/glog/src/config_netbsd.h b/extern/glog/src/config_netbsd.h new file mode 100644 index 00000000000..d97b7e16c61 --- /dev/null +++ b/extern/glog/src/config_netbsd.h @@ -0,0 +1,192 @@ +/* define if glog doesn't use RTTI */ +/* #undef DISABLE_RTTI */ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ +/* #undef HAVE_DLADDR */ + +/* Define if you have the `snprintf' function */ +#define HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define if you have the `fcntl' function */ +#define HAVE_FCNTL + +/* Define to 1 if you have the header file. */ +#define HAVE_GLOB_H + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUNWIND_H */ + +/* define if you have google gflags library */ +#define HAVE_LIB_GFLAGS + +/* define if you have google gmock library */ +/* #undef HAVE_LIB_GMOCK */ + +/* define if you have google gtest library */ +/* #undef HAVE_LIB_GTEST */ + +/* define if you have libunwind */ +/* #undef HAVE_LIB_UNWIND */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H + +/* define to disable multithreading support. */ +/* #undef NO_THREADS */ + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES + +/* Define if you have the 'pread' function */ +#define HAVE_PREAD + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H + +/* Define if you have the 'pwrite' function */ +#define HAVE_PWRITE + +/* define if the compiler implements pthread_rwlock_* */ +#define HAVE_RWLOCK 1 + +/* Define if you have the 'sigaction' function */ +#define HAVE_SIGACTION + +/* Define if you have the `sigaltstack' function */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UCONTEXT_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UTSNAME_H + +/* Define to 1 if you have the header file. */ +#define HAVE_UCONTEXT_H + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNWIND_H 1 + +/* define if the compiler supports using expression for operator */ +#define HAVE_USING_OPERATOR + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ + +/* define if your compiler has __builtin_expect */ +#define HAVE___BUILTIN_EXPECT 1 + +/* define if your compiler has __sync_val_compare_and_swap */ +#define HAVE___SYNC_VAL_COMPARE_AND_SWAP + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +/* #undef LT_OBJDIR */ + +/* Name of package */ +/* #undef PACKAGE */ + +/* Define to the address where bug reports for this package should be sent. */ +/* #undef PACKAGE_BUGREPORT */ + +/* Define to the full name of this package. */ +/* #undef PACKAGE_NAME */ + +/* Define to the full name and version of this package. */ +/* #undef PACKAGE_STRING */ + +/* Define to the one symbol short name of this package. */ +/* #undef PACKAGE_TARNAME */ + +/* Define to the home page for this package. */ +/* #undef PACKAGE_URL */ + +/* Define to the version of this package. */ +/* #undef PACKAGE_VERSION */ + +/* How to access the PC from a struct ucontext */ +/* #undef PC_FROM_UCONTEXT */ + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* location of source code */ +#define TEST_SRC_DIR "." + +/* Version number of package */ +/* #undef VERSION */ + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { + +#define GOOGLE_GLOG_DLL_DECL + +/* isn't getting defined by configure script when clang compilers are used + and cuases compilation errors in stactrace/unwind modules */ +#ifdef __clang__ +# define NO_FRAME_POINTER +#endif From c1d353c17b33971523dd4aab540091c6418d790f Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 9 Jun 2023 21:25:00 -0400 Subject: [PATCH 5/6] Build: fix NetBSD error in guardedalloc Pull Request: https://projects.blender.org/blender/blender/pulls/108831 --- intern/guardedalloc/intern/mallocn_intern.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h index 8a77a57b390..731d71f8d4c 100644 --- a/intern/guardedalloc/intern/mallocn_intern.h +++ b/intern/guardedalloc/intern/mallocn_intern.h @@ -25,7 +25,7 @@ # define HAVE_MALLOC_STATS #elif defined(__FreeBSD__) # include -#elif defined(__OpenBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) # undef USE_MALLOC_USABLE_SIZE #elif defined(__APPLE__) # include From 6948a2d6134ef19ae326e98a60aa33cb1f5deedd Mon Sep 17 00:00:00 2001 From: guishe Date: Tue, 16 May 2023 10:42:46 -0600 Subject: [PATCH 6/6] Fix #98973: Renaming Custom Python Properties is Incorrect PyUnicode_AsUTF8AndSize is used when renaming a custom python property, this method stores the size of the string without including the null terminator in the size. Renaming a custom python property now includes the null terminator when copying the new string name. Pull Request: https://projects.blender.org/blender/blender/pulls/107983 --- source/blender/python/generic/idprop_py_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 9542a00283f..8b40691bd77 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -261,12 +261,12 @@ static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUS name = PyUnicode_AsUTF8AndSize(value, &name_size); - if (name_size >= MAX_IDPROP_NAME) { + if (name_size + 1 >= MAX_IDPROP_NAME) { PyErr_SetString(PyExc_TypeError, "string length cannot exceed 63 characters!"); return -1; } - memcpy(self->prop->name, name, name_size); + memcpy(self->prop->name, name, name_size + 1); return 0; }