From 340dea5261a663fc1218a82f79e2fcdd1915c867 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Jan 2022 11:52:40 +0100 Subject: [PATCH 1/7] gobj: Fix crash when trying to load directory as txo/dds/ktx file --- panda/src/gobj/texture.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index ccd6997691..b0ad695ba1 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -3575,6 +3575,12 @@ do_read_txo_file(CData *cdata, const Filename &fullpath) { } istream *in = file->open_read_file(true); + if (in == nullptr) { + gobj_cat.error() + << "Failed to open " << filename << " for reading.\n"; + return false; + } + bool success = do_read_txo(cdata, *in, fullpath); vfs->close_read_file(in); @@ -3630,6 +3636,12 @@ do_read_dds_file(CData *cdata, const Filename &fullpath, bool header_only) { } istream *in = file->open_read_file(true); + if (in == nullptr) { + gobj_cat.error() + << "Failed to open " << filename << " for reading.\n"; + return false; + } + bool success = do_read_dds(cdata, *in, fullpath, header_only); vfs->close_read_file(in); @@ -4310,6 +4322,12 @@ do_read_ktx_file(CData *cdata, const Filename &fullpath, bool header_only) { } istream *in = file->open_read_file(true); + if (in == nullptr) { + gobj_cat.error() + << "Failed to open " << filename << " for reading.\n"; + return false; + } + bool success = do_read_ktx(cdata, *in, fullpath, header_only); vfs->close_read_file(in); From 2d77093398756559bcc8d467881595fc5e21d715 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Jan 2022 12:52:10 +0100 Subject: [PATCH 2/7] gobj: Fix TexturePeeker docstrings for filter_* being incorrect about wrapping Fixes #1195 --- panda/src/gobj/texturePeeker.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/texturePeeker.cxx b/panda/src/gobj/texturePeeker.cxx index b531e04bff..997d44e182 100644 --- a/panda/src/gobj/texturePeeker.cxx +++ b/panda/src/gobj/texturePeeker.cxx @@ -436,7 +436,7 @@ lookup_bilinear(LColor &color, PN_stdfloat u, PN_stdfloat v) const { * rectangle defined by the specified coordinate range. * * The texel color is linearly filtered over the entire region. u, v, and w - * will wrap around regardless of the texture's wrap mode. + * must be in the range [0, 1]. */ void TexturePeeker:: filter_rect(LColor &color, @@ -464,7 +464,7 @@ filter_rect(LColor &color, * rectangle defined by the specified coordinate range. * * The texel color is linearly filtered over the entire region. u, v, and w - * will wrap around regardless of the texture's wrap mode. + * must be in the range [0, 1]. */ void TexturePeeker:: filter_rect(LColor &color, From 91f3ab01f3dde4465e45f57d197d06e4cb1445e1 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Jan 2022 17:06:16 +0100 Subject: [PATCH 3/7] mayapath: Properly handle new bin2/bin3 folders on Windows for Maya 2022 --- pandatool/src/mayaprogs/mayapath.cxx | 49 ++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index 249dd4eeff..3354f1b2cb 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -58,15 +58,6 @@ using std::string; #define QUOTESTR(x) #x #define TOSTRING(x) QUOTESTR(x) -#if defined(_WIN32) -// Note: Filename::dso_filename changes .so to .dll automatically. -static const Filename openmaya_filename = "bin/OpenMaya.so"; -#elif defined(IS_OSX) -static const Filename openmaya_filename = "MacOS/libOpenMaya.dylib"; -#else -static const Filename openmaya_filename = "lib/libOpenMaya.so"; -#endif // _WIN32 - // Searches for python26.zip or whatever version it is. static Filename find_pyzip(const Filename &maya_location) { @@ -122,6 +113,25 @@ get_version_number(const char *ver) { return 0; } +static Filename +get_openmaya_filename(const Filename &maya_location) { +#ifdef _WIN32 + // Note: Filename::dso_filename changes .so to .dll automatically. + // Maya 2022 has two versions of OpenMaya.dll, one for Python 3 and + // one for Python 2, in bin3 and bin2 folders. + Filename bin3 = Filename(maya_location, "bin3"); + Filename bin3_openmaya = Filename::dso_filename(maya_location / "bin3/OpenMaya.so"); + if (bin3_openmaya.is_regular_file()) { + return bin3_openmaya; + } + return Filename::dso_filename(maya_location / "bin/OpenMaya.so"); +#elif defined(IS_OSX) + return Filename::dso_filename(maya_location / "MacOS/libOpenMaya.dylib"); +#else + return Filename::dso_filename(maya_location / "lib/libOpenMaya.so"); +#endif // _WIN32 +} + #if defined(_WIN32) static void get_maya_location(const char *ver, string &loc) { @@ -265,8 +275,8 @@ main(int argc, char *argv[]) { } else if (maya_location != standard_maya_location) { // If it *is* set, we verify that OpenMaya.dll matches the standard // version. - Filename openmaya_given = Filename::dso_filename(Filename(maya_location, openmaya_filename)); - Filename openmaya_standard = Filename::dso_filename(Filename(standard_maya_location, openmaya_filename)); + Filename openmaya_given = get_openmaya_filename(maya_location); + Filename openmaya_standard = get_openmaya_filename(standard_maya_location); if (openmaya_given != openmaya_standard) { #ifdef HAVE_OPENSSL @@ -335,9 +345,9 @@ main(int argc, char *argv[]) { } // Look for OpenMaya.dll as a sanity check. - Filename openmaya = Filename::dso_filename(Filename(maya_location, openmaya_filename)); + Filename openmaya = get_openmaya_filename(maya_location); if (!openmaya.is_regular_file()) { - cerr << "Could not find $MAYA_LOCATION/" << Filename::dso_filename(openmaya_filename).to_os_specific() << "!\n"; + cerr << "Could not find OpenMaya library in $MAYA_LOCATION!\n"; exit(1); } @@ -395,7 +405,18 @@ main(int argc, char *argv[]) { if (path == nullptr) { path = ""; } - string putenv_str = "PATH=" + bin.to_os_specific() + sep + path; + string putenv_str = "PATH="; + + // On Windows, there may also be a bin3 or bin2 directory, we should + // add either one to the PATH. +#ifdef _WIN32 + Filename bin3 = Filename(maya_location, "bin3"); + if (bin3.is_directory()) { + putenv_str += bin3.to_os_specific() + sep; + } +#endif + putenv_str += bin.to_os_specific() + sep + path; + char *putenv_cstr = strdup(putenv_str.c_str()); putenv(putenv_cstr); } From 50dd0113e714873a381ff5413cbc4f576eda8069 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Jan 2022 17:10:04 +0100 Subject: [PATCH 4/7] doc: Update release notes for 1.10.11 [skip ci] --- doc/ReleaseNotes | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index ccf0a771c3..a0436156e2 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,61 @@ +----------------------- RELEASE 1.10.11 ----------------------- + +Maintenance release containing assorted bug fixes and minor improvements. + +Rendering +* Fix erratic shadow bug with multiple lights from gltf/blend2bam (#1153) +* Fix erratic behavior of HW skinning shaders on non-animated models (#1207) +* Fix errors with compressed luminance textures in DirectX 9 (#1198) +* Implement screenshotting multisample backbuffer in DirectX 9 (#1225) + +Texture Loading +* Don't load texture from disk when loading .bam if preloading is off (#1208) +* Fix TextureReloadRequest not working properly when mipmapping is disabled +* Add TexturePool.get_texture() method for querying textures in pool +* Fix crash when opening a .txo, .dds or .ktx file fails +* Improve error message when calling tex.write() with unknown extension + +Input +* Generate horizontal scroll wheel events on Windows +* Generate events for mouse buttons 4 and 5 on X11 +* Generate events for lmeta, rmeta and menu keys on Windows +* Add raw event (raw-<) for key between shift and Z on ISO keyboards +* Gracefully handle invalid raw input device data on Windows +* Correctly handle negative axis input from Windows raw input devices (#1218) +* FrSky RC controller is now registered as flight stick (#1218) + +Deployment +* Support building with tkinter on all supported platforms (#780) +* Fix issue with zipimport module not being packaged +* Fix grayscale icons becoming blue when scaled automatically +* Automatically include cacert.pem when depending on certifi +* Suppress assorted spurious missing module warnings +* Targeting linux_x86_64 / linux_i686 also allows use of manylinux wheels + +Build +* Add support for Maya 2022 (#1213) +* Support building with Visual Studio 2022 +* Support building with macOS 11.3 SDK (and work around clang crash) +* Support building with Windows 11 SDK +* Build Ubuntu .deb files with bindings for multiple Python 3 versions +* Support compilation with Assimp 5.x (#1212) +* Support building on manylinux_2_24 + +Miscellaneous +* Fix nodes with same tag key but different value getting flattened together +* taskMgr.step() now restores previous SIGINT handler afterwards (#1180) +* Add base.clock as alias for globalClock +* Assorted minor API documentation improvements +* Fix memory leak getting Bullet persistent manifolds from Python (#1193) +* Add missing property interface to PlaneNode +* Fix prepare_scene() not properly invoking the Shader Generator +* Add name property to AICharacter class (#1205) +* Add bullet-split-impulse configuration variable (#1201) +* Fix slider thumb entering dragging state on keyboard button press (#1188) +* Allow OnscreenImage to be created before ShowBase is created (#1209) +* Fix manager, t, play_rate, duration properties of Sequence/Parallel (#1202) +* Expose ButtonEvent API to Python (UNSTABLE API, will be changed soon) + ----------------------- RELEASE 1.10.10 ----------------------- This release fixes assorted, mostly very minor bugs. From 99c133a7f5c16fdd8b0975b1400eebb84bd74c13 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Jan 2022 17:12:40 +0100 Subject: [PATCH 5/7] readme: Update download link to 1.10.11 [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fb6d99fb3..f1ac3a0931 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Installing Panda3D ================== The latest Panda3D SDK can be downloaded from -[this page](https://www.panda3d.org/download/sdk-1-10-10/). +[this page](https://www.panda3d.org/download/sdk-1-10-11/). If you are familiar with installing Python packages, you can use the following command: From b736b3e4db4e7fe44010aeb2b2569229728fe75c Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 7 Jan 2022 10:14:30 +0100 Subject: [PATCH 6/7] filter: Accept floating-point values for FilterManager mul= parameter Fixes #1231 Closes #1232 --- direct/src/filter/FilterManager.py | 4 ++-- doc/ReleaseNotes | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index 784a2cc2b3..ad0f72cca8 100644 --- a/direct/src/filter/FilterManager.py +++ b/direct/src/filter/FilterManager.py @@ -122,8 +122,8 @@ class FilterManager(DirectObject): winy = winy // div if mul != 1: - winx = winx * mul - winy = winy * mul + winx = int(round(winx * mul)) + winy = int(round(winy * mul)) return winx,winy diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a0436156e2..1ddd2fd9c6 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -45,6 +45,7 @@ Miscellaneous * Fix nodes with same tag key but different value getting flattened together * taskMgr.step() now restores previous SIGINT handler afterwards (#1180) * Add base.clock as alias for globalClock +* FilterManager mul parameter now accepts floating-point values (#1231) * Assorted minor API documentation improvements * Fix memory leak getting Bullet persistent manifolds from Python (#1193) * Add missing property interface to PlaneNode From d66ef59ecc0ca1078e2dc9629984f9d08bfee806 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 5 Jan 2022 13:54:57 +0100 Subject: [PATCH 7/7] pgraph: Fix assertion in PythonLoaderFileType with debug Python build --- doc/ReleaseNotes | 1 + panda/src/pgraph/pythonLoaderFileType.cxx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 1ddd2fd9c6..a2499ce00d 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -48,6 +48,7 @@ Miscellaneous * FilterManager mul parameter now accepts floating-point values (#1231) * Assorted minor API documentation improvements * Fix memory leak getting Bullet persistent manifolds from Python (#1193) +* Fix assertion in PythonLoaderFileType with debug Python build * Add missing property interface to PlaneNode * Fix prepare_scene() not properly invoking the Shader Generator * Add name property to AICharacter class (#1205) diff --git a/panda/src/pgraph/pythonLoaderFileType.cxx b/panda/src/pgraph/pythonLoaderFileType.cxx index 3006a13cd3..cd38ed52df 100644 --- a/panda/src/pgraph/pythonLoaderFileType.cxx +++ b/panda/src/pgraph/pythonLoaderFileType.cxx @@ -172,8 +172,12 @@ init(PyObject *loader) { } Py_DECREF(supports_compressed); } + else { + PyErr_Clear(); + } _load_func = PyObject_GetAttrString(loader, "load_file"); + PyErr_Clear(); _save_func = PyObject_GetAttrString(loader, "save_file"); PyErr_Clear();