From 80d67945d50708781ce7d838f4b9160380c4d527 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 31 Aug 2021 15:39:46 +0200 Subject: [PATCH 01/12] readme: Remove "Gold Sponsors" heading [skip ci] --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 3be11f9b58..70619892c7 100644 --- a/README.md +++ b/README.md @@ -250,10 +250,3 @@ to everyone who has donated! - -### Gold Sponsors -[![](https://opencollective.com/panda3d/tiers/gold-sponsor/0/avatar.svg?avatarHeight=128)](https://opencollective.com/panda3d/tiers/gold-sponsor/0/website) -[![](https://opencollective.com/panda3d/tiers/gold-sponsor/1/avatar.svg?avatarHeight=128)](https://opencollective.com/panda3d/tiers/gold-sponsor/1/website) -[![](https://opencollective.com/panda3d/tiers/gold-sponsor/2/avatar.svg?avatarHeight=128)](https://opencollective.com/panda3d/tiers/gold-sponsor/2/website) -[![](https://opencollective.com/panda3d/tiers/gold-sponsor/3/avatar.svg?avatarHeight=128)](https://opencollective.com/panda3d/tiers/gold-sponsor/3/website) -[![](https://opencollective.com/panda3d/tiers/gold-sponsor/4/avatar.svg?avatarHeight=128)](https://opencollective.com/panda3d/tiers/gold-sponsor/4/website) From 224d21352ae7ec8ff18682cad27b0fd667148dd5 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Oct 2021 09:47:03 +0200 Subject: [PATCH 02/12] dist: Suppress warnings about missing __builtin__ and _winapi --- direct/src/dist/FreezeTool.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index ea6919802f..e10c0aec09 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -125,6 +125,21 @@ if sys.version_info < (3, 0): 'direct.showbase.ShowBaseGlobal': ['builtins'], 'py._builtin': ['builtins'], }) +else: + # And ignore attempts to conditionally import __builtin__ in Python 3, + # suppressing a warning message. + ignoreImports.update({ + 'direct.p3d.AppRunner': ['__builtin__'], + 'direct.showbase.ContainerLeakDetector': ['__builtin__'], + 'direct.showbase.LeakDetectors': ['__builtin__'], + 'direct.showbase.MessengerLeakDetector': ['__builtin__'], + 'direct.showbase.ObjectReport': ['__builtin__'], + 'direct.showbase.ProfileSession': ['__builtin__'], + 'direct.showbase.PythonUtil': ['__builtin__'] + ignoreImports['direct.showbase.PythonUtil'], + 'direct.showbase.ShowBase': ['__builtin__'], + 'direct.showbase.ShowBaseGlobal': ['__builtin__'], + 'py._builtin': ['__builtin__'], + }) # These are overrides for specific modules. @@ -688,7 +703,7 @@ okMissing = [ 'email.Iterators', '_subprocess', 'gestalt', 'java.lang', 'direct.extensions_native.extensions_darwin', '_manylinux', 'collections.Iterable', 'collections.Mapping', 'collections.MutableMapping', - 'collections.Sequence', 'numpy_distutils', + 'collections.Sequence', 'numpy_distutils', '_winapi', ] class Freezer: From 98e3b1f03e69318df5f161eb0d4b6f9a59a1da14 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Oct 2021 09:47:46 +0200 Subject: [PATCH 03/12] dist: update linecache module with missing __all__ item --- direct/src/dist/FreezeTool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index e10c0aec09..d4af3c3ff8 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -147,7 +147,7 @@ overrideModules = { # Used by the warnings module, among others, to get line numbers. Since # we set __file__, this would cause it to try and extract Python code # lines from the main executable, which we don't want. - 'linecache': """__all__ = ["getline", "clearcache", "checkcache"] + 'linecache': """__all__ = ["getline", "clearcache", "checkcache", "lazycache"] cache = {} From e9b50927342e679d3e98e819fa4e7e9ee29e9600 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Oct 2021 09:48:25 +0200 Subject: [PATCH 04/12] dist: Fix frozen modules not packaged (such as zipimport in Python 3.8+) --- direct/src/dist/FreezeTool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index d4af3c3ff8..c8b42263fe 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -2563,9 +2563,9 @@ class PandaModuleFinder(modulefinder.ModuleFinder): (or self.path if None). Returns a tuple like (fp, path, stuff), where stuff is a tuple like (suffix, mode, type). """ - if imp.is_frozen(name): - # Don't pick up modules that are frozen into p3dpython. - raise ImportError("'%s' is a frozen module" % (name)) + #if imp.is_frozen(name): + # # Don't pick up modules that are frozen into p3dpython. + # raise ImportError("'%s' is a frozen module" % (name)) if parent is not None: fullname = parent.__name__+'.'+name From 64345c71b62ac15f85c4ab21b9ce74c819f44909 Mon Sep 17 00:00:00 2001 From: "Stephen A. Imhoff" Date: Thu, 14 Oct 2021 11:09:00 -0700 Subject: [PATCH 05/12] Update version number on release/1.10.x branch to 1.10.11 --- dtool/PandaVersion.pp | 4 ++-- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dtool/PandaVersion.pp b/dtool/PandaVersion.pp index db041fd61f..d5cc7fea53 100644 --- a/dtool/PandaVersion.pp +++ b/dtool/PandaVersion.pp @@ -7,7 +7,7 @@ // place to put this. // Use spaces to separate the major, minor, and sequence numbers here. -#define PANDA_VERSION 1 10 10 +#define PANDA_VERSION 1 10 11 // This variable will be defined to false in the CVS repository, but // scripts that generate source tarballs and/or binary releases for @@ -30,7 +30,7 @@ // any distributable Panda3D packages. If you are making a Panda3D // build which you will be using to produce a distributable Panda3D // package, you should set this string appropriately. -#define PANDA_PACKAGE_VERSION +#define PANDA_PACKAGE_VERSION // We also define a version for the Panda3D plugin/runtime, // i.e. nppanda3d.dll, p3dactivex.ocx, and panda3d.exe. This is an diff --git a/setup.cfg b/setup.cfg index 44e2b5dbef..6fd743f75a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = Panda3D -version = 1.10.10 +version = 1.10.11 url = https://www.panda3d.org/ description = Panda3D is a framework for 3D rendering and game development for Python and C++ programs. license = Modified BSD License From de334f5597076029143b37d13fd5c0b2ba4e2f77 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:28:35 +0200 Subject: [PATCH 06/12] PythonUtil: remove deadlink from normalDistrib docstring --- direct/src/showbase/PythonUtil.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 7f8830fc85..ea08247823 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -1173,8 +1173,6 @@ def normalDistrib(a, b, gauss=random.gauss): uniformly onto the curve inside [a, b] ------------------------------------------------------------------------ - https://statweb.stanford.edu/~naras/jsm/NormalDensity/NormalDensity.html - The 68-95-99.7% Rule ==================== All normal density curves satisfy the following property which is often From 618e6f3feea3abc6edb382cc12ac3a9278b25af8 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:45:38 +0200 Subject: [PATCH 07/12] pgui: Fix slider thumb entering dragging state on button press This caused updating the slider while a button is pressed and the mouse is held over the thumb not to work. Fixes #1188 --- panda/src/pgui/pgSliderBar.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/pgui/pgSliderBar.cxx b/panda/src/pgui/pgSliderBar.cxx index e666d2a496..d423549ccb 100644 --- a/panda/src/pgui/pgSliderBar.cxx +++ b/panda/src/pgui/pgSliderBar.cxx @@ -605,8 +605,10 @@ item_press(PGItem *item, const MouseWatcherParameter ¶m) { ClockObject::get_global_clock()->get_frame_time() + scroll_initial_delay; } else if (item == _thumb_button) { - _scroll_button_held = nullptr; - begin_drag(); + if (((PGButton *)item)->has_click_button(param.get_button())) { + _scroll_button_held = nullptr; + begin_drag(); + } } } From cd9712270b1257bdcc67dd8eb1460c0e01991c29 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:51:04 +0200 Subject: [PATCH 08/12] dcparser: slight code cleanup in dcPacker.cxx --- direct/src/dcparser/dcPacker.cxx | 98 +++++++++++++++----------------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/direct/src/dcparser/dcPacker.cxx b/direct/src/dcparser/dcPacker.cxx index 810744c2ab..2a5a923bc2 100644 --- a/direct/src/dcparser/dcPacker.cxx +++ b/direct/src/dcparser/dcPacker.cxx @@ -637,71 +637,67 @@ pack_object(PyObject *object) { // had to add this for basic 64 and unsigned data to get packed right .. Not // sure if we can just do the rest this way.. - switch(pack_type) - { + switch (pack_type) { case PT_int64: - if(PyLong_Check(object)) - { - pack_int64(PyLong_AsLongLong(object)); - return; - } + if (PyLong_Check(object)) { + pack_int64(PyLong_AsLongLong(object)); + return; + } #if PY_MAJOR_VERSION < 3 - else if (PyInt_Check(object)) - { - pack_int64(PyInt_AsLong(object)); - return; - } + else if (PyInt_Check(object)) { + pack_int64(PyInt_AsLong(object)); + return; + } #endif - break; + break; + case PT_uint64: - if(PyLong_Check(object)) - { - pack_uint64(PyLong_AsUnsignedLongLong(object)); - return; - } + if (PyLong_Check(object)) { + pack_uint64(PyLong_AsUnsignedLongLong(object)); + return; + } #if PY_MAJOR_VERSION < 3 - else if(PyInt_Check(object)) - { - PyObject *obj1 = PyNumber_Long(object); - pack_int(PyLong_AsUnsignedLongLong(obj1)); - Py_DECREF(obj1); - return; - } + else if (PyInt_Check(object)) { + PyObject *obj1 = PyNumber_Long(object); + pack_int(PyLong_AsUnsignedLongLong(obj1)); + Py_DECREF(obj1); + return; + } #endif - break; + break; + case PT_int: - if(PyLong_Check(object)) - { - pack_int(PyLong_AsLong(object)); - return; - } + if (PyLong_Check(object)) { + pack_int(PyLong_AsLong(object)); + return; + } #if PY_MAJOR_VERSION < 3 - else if (PyInt_Check(object)) - { - pack_int(PyInt_AsLong(object)); - return; - } + else if (PyInt_Check(object)) { + pack_int(PyInt_AsLong(object)); + return; + } #endif - break; + break; + case PT_uint: - if(PyLong_Check(object)) - { - pack_uint(PyLong_AsUnsignedLong(object)); - return; - } + if (PyLong_Check(object)) { + pack_uint(PyLong_AsUnsignedLong(object)); + return; + } #if PY_MAJOR_VERSION < 3 - else if (PyInt_Check(object)) - { - PyObject *obj1 = PyNumber_Long(object); - pack_uint(PyLong_AsUnsignedLong(obj1)); - Py_DECREF(obj1); - return; - } + else if (PyInt_Check(object)) { + PyObject *obj1 = PyNumber_Long(object); + pack_uint(PyLong_AsUnsignedLong(obj1)); + Py_DECREF(obj1); + return; + } #endif - break; + break; + default: - break; + break; } + if (PyLong_Check(object)) { pack_int(PyLong_AsLong(object)); #if PY_MAJOR_VERSION < 3 From ca061c98a6bc3215fa740224663e5b0646ddd798 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:55:47 +0200 Subject: [PATCH 09/12] dcparser: Improve assertion error message for invalid UTF-8 data --- direct/src/dcparser/dcPacker.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/src/dcparser/dcPacker.cxx b/direct/src/dcparser/dcPacker.cxx index 2a5a923bc2..4ba255a78c 100644 --- a/direct/src/dcparser/dcPacker.cxx +++ b/direct/src/dcparser/dcPacker.cxx @@ -889,6 +889,10 @@ unpack_object() { unpack_string(str); #if PY_MAJOR_VERSION >= 3 object = PyUnicode_FromStringAndSize(str.data(), str.size()); + if (object == nullptr) { + nassert_raise("Unable to decode UTF-8 string; use blob type for binary data"); + return nullptr; + } #else object = PyString_FromStringAndSize(str.data(), str.size()); #endif From 594a26662ec3e6cbf1916a3831cb0c5ace81176a Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 13:59:39 +0200 Subject: [PATCH 10/12] dist: Automatically include cacert.pem when depending on certifi --- direct/src/dist/commands.py | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 47422a7e47..061f641e67 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -113,6 +113,7 @@ PACKAGE_DATA_DIRS = { ('cefpython3/Chromium Embedded Framework.framework/Chromium Embedded Framework', '', {'PKG_DATA_MAKE_EXECUTABLE'}), ], 'pytz': [('pytz/zoneinfo/*', 'zoneinfo', ())], + 'certifi': [('certifi/cacert.pem', '', {})], } # Some dependencies have extra directories that need to be scanned for DLLs. From 9b55279fdefb2cd92cf9fc0c49c3f66f1965749c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 14:00:04 +0200 Subject: [PATCH 11/12] glgsg: Minor code cleanup in FBO code --- panda/src/glstuff/glGraphicsBuffer_src.I | 16 ++++++++++------ panda/src/glstuff/glGraphicsBuffer_src.h | 14 ++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.I b/panda/src/glstuff/glGraphicsBuffer_src.I index 021116b7ff..4a3250eee8 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.I +++ b/panda/src/glstuff/glGraphicsBuffer_src.I @@ -11,14 +11,18 @@ * @date 2006-01-15 */ +/** + * + */ INLINE int CLP(GraphicsBuffer):: -get_multisample_count() -{ - return _requested_multisamples; +get_multisample_count() { + return _requested_multisamples; } +/** + * + */ INLINE int CLP(GraphicsBuffer):: -get_coverage_sample_count() -{ - return _requested_coverage_samples; +get_coverage_sample_count() { + return _requested_coverage_samples; } diff --git a/panda/src/glstuff/glGraphicsBuffer_src.h b/panda/src/glstuff/glGraphicsBuffer_src.h index c383a0a5d4..68c2dab74f 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.h +++ b/panda/src/glstuff/glGraphicsBuffer_src.h @@ -23,11 +23,14 @@ * ARB_draw_buffers extensions. This design has significant advantages over * the older wglGraphicsBuffer and glxGraphicsBuffer: * - * * Can export depth and stencil. * Supports auxiliary bitplanes. * - * Supports non-power-of-two padding. * Supports tracking of host window - * size. * Supports cumulative render-to-texture. * Faster than pbuffers. * - * Can render onto a texture without clearing it first. * Supports - * multisample antialiased rendering. + * - Can export depth and stencil. + * - Supports auxiliary bitplanes. + * - Supports non-power-of-two padding. + * - Supports tracking of host window size. + * - Supports cumulative render-to-texture. + * - Faster than pbuffers. + * - Can render onto a texture without clearing it first. + * - Supports multisample antialiased rendering. * * Some of these deserve a little explanation. Auxiliary bitplanes are * additional bitplanes above and beyond the normal depth,stencil,color. One @@ -45,7 +48,6 @@ * EXT_framebuffer_blit to allow for multisample antialiasing these offscreen * render targets. If these extensions are unavailable the buffer will render * as if multisamples is 0. - * */ class EXPCL_GL CLP(GraphicsBuffer) : public GraphicsBuffer { public: From 57d7bc2f536048142ff38b948ccf2ee0bba00f97 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 26 Oct 2021 14:00:25 +0200 Subject: [PATCH 12/12] display: document make_texture_buffer() behavior when size is 0 Fixes panda3d/panda3d-docs#100 --- panda/src/display/graphicsOutput.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 1f97ade9e7..58d4099a45 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -834,6 +834,9 @@ get_active_display_region(int n) const { * which will be a texture suitable for applying to geometry within the scene * rendered into this window. * + * If you pass zero as the buffer size, the buffer will have the same size as + * the host window, and will automatically be resized when the host window is. + * * If tex is not NULL, it is the texture that will be set up for rendering * into; otherwise, a new Texture object will be created. In either case, the * target texture can be retrieved from the return value with