From 46b7fc6ee27d2690594ee7b8297b7198963063d2 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Dec 2021 23:05:29 +0100 Subject: [PATCH 01/12] dist: Fix bug with grayscale icons becoming blue when scaled --- direct/src/p3d/DeploymentTools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 23c5faf847..b7851ac947 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -359,8 +359,7 @@ class Icon: Icon.notify.warning("Generating %dx%d icon by scaling down %dx%d image" % (required_size, required_size, from_size, from_size)) image = PNMImage(required_size, required_size) - if self.images[from_size].hasAlpha(): - image.addAlpha() + image.setColorType(self.images[from_size].getColorType()) image.quickFilterFrom(self.images[from_size]) self.images[required_size] = image else: From 60cc334cd9f13bc3351a788583798bd3ea2963b1 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Dec 2021 23:05:49 +0100 Subject: [PATCH 02/12] gobj: Fix some TexturePeeker docstrings [skip ci] --- 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 97da4edec2..b531e04bff 100644 --- a/panda/src/gobj/texturePeeker.cxx +++ b/panda/src/gobj/texturePeeker.cxx @@ -361,7 +361,7 @@ lookup(LColor &color, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) const { } /** - * Works like TexturePeeker::lookup(), but instead uv-coordinates integer + * Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer * coordinates are used. */ void TexturePeeker:: @@ -372,7 +372,7 @@ fetch_pixel(LColor &color, int x, int y) const { } /** - * Works like TexturePeeker::lookup(), but instead uv-coordinates integer + * Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer * coordinates are used. */ void TexturePeeker:: From ec2084c23e693680182c117db7abbae11407100f Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 13:42:33 +0100 Subject: [PATCH 03/12] samples: Use SamplerState::WM_clamp as wrap mode in Asteroids demo [skip ci] --- samples/asteroids/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/asteroids/main.py b/samples/asteroids/main.py index bf7e7a68c5..d1e9fcfdc3 100755 --- a/samples/asteroids/main.py +++ b/samples/asteroids/main.py @@ -16,6 +16,7 @@ from direct.showbase.ShowBase import ShowBase from panda3d.core import TextNode, TransparencyAttrib from panda3d.core import LPoint3, LVector3 +from panda3d.core import SamplerState from direct.gui.OnscreenText import OnscreenText from direct.task.Task import Task from math import sin, cos, pi @@ -72,6 +73,8 @@ def loadObject(tex=None, pos=LPoint3(0, 0), depth=SPRITE_POS, scale=1, if tex: # Load and set the requested texture. tex = loader.loadTexture("textures/" + tex) + tex.setWrapU(SamplerState.WM_clamp) + tex.setWrapV(SamplerState.WM_clamp) obj.setTexture(tex, 1) return obj From 215ad6bfd9d65372a7441e933d31b2e7a384687e Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 17:07:43 +0100 Subject: [PATCH 04/12] Fix a few docstring typos --- panda/src/display/pythonGraphicsWindowProc.h | 2 +- panda/src/display/windowProperties.h | 2 +- panda/src/gobj/lens.cxx | 2 +- panda/src/putil/pythonCallbackObject.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/display/pythonGraphicsWindowProc.h b/panda/src/display/pythonGraphicsWindowProc.h index 902cb83fb7..0f5128b18a 100644 --- a/panda/src/display/pythonGraphicsWindowProc.h +++ b/panda/src/display/pythonGraphicsWindowProc.h @@ -21,7 +21,7 @@ #ifdef HAVE_PYTHON /** - * Extends GraphicsWindowProc to provde callback functionality to a python + * Extends GraphicsWindowProc to provide callback functionality to a Python * program. */ class PythonGraphicsWindowProc: public GraphicsWindowProc, diff --git a/panda/src/display/windowProperties.h b/panda/src/display/windowProperties.h index 82dcbb5358..11a9e439c7 100644 --- a/panda/src/display/windowProperties.h +++ b/panda/src/display/windowProperties.h @@ -224,7 +224,7 @@ private: S_raw_mice = 0x08000, }; - // This bitmask represents the truefalse settings for various boolean flags + // This bitmask represents the true/false settings for various boolean flags // (assuming the corresponding S_* bit has been set, above). enum Flags { F_undecorated = S_undecorated, diff --git a/panda/src/gobj/lens.cxx b/panda/src/gobj/lens.cxx index 6fabc0cf8f..989e501806 100644 --- a/panda/src/gobj/lens.cxx +++ b/panda/src/gobj/lens.cxx @@ -351,7 +351,7 @@ clear_custom_film_mat() { * nearly perpendicular to the center of the frustum as possible. Without * this bit, the orientation camera plane is defined by position of the four * points (which should all be coplanar). With this bit, the camera plane is - * arbitarary, and may be chosen so that the four points do not themselves lie + * arbitrary, and may be chosen so that the four points do not themselves lie * in the camera plane (but the points will still be within the frustum). * * FC_off_axis - This allows the resulting frustum to be off-axis to get the diff --git a/panda/src/putil/pythonCallbackObject.h b/panda/src/putil/pythonCallbackObject.h index d7757813db..5219146c9b 100644 --- a/panda/src/putil/pythonCallbackObject.h +++ b/panda/src/putil/pythonCallbackObject.h @@ -23,7 +23,7 @@ /** * This is a specialization on CallbackObject to allow a callback to directly - * call an arbitarary Python function. Powerful! But use with caution. + * call an arbitrary Python function. Powerful! But use with caution. */ class PythonCallbackObject : public CallbackObject { PUBLISHED: From 0e91f4ee1cba9f8885268f9184eb90df43773431 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 17:09:29 +0100 Subject: [PATCH 05/12] device: Gracefully ignore invalid data index from raw input device --- panda/src/device/winRawInputDevice.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/panda/src/device/winRawInputDevice.cxx b/panda/src/device/winRawInputDevice.cxx index 96c9b1adbe..1370561852 100644 --- a/panda/src/device/winRawInputDevice.cxx +++ b/panda/src/device/winRawInputDevice.cxx @@ -663,7 +663,15 @@ process_report(PCHAR ptr, size_t size) { if (status == HIDP_STATUS_SUCCESS) { for (ULONG di = 0; di < count; ++di) { if (data[di].DataIndex != _hat_data_index) { - nassertd(data[di].DataIndex < _indices.size()) continue; + if (data[di].DataIndex >= _indices.size()) { + if (device_cat.is_debug()) { + device_cat.debug() + << "Ignoring out of range DataIndex " << data[di].DataIndex + << "from raw device " << _path << "\n"; + } + continue; + } + const Index &idx = _indices[data[di].DataIndex]; if (idx._axis >= 0) { if (idx._signed) { From 3d1328fafb5664df3512423b42e20b936732364e Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 5 Dec 2021 17:36:46 +0200 Subject: [PATCH 06/12] workflow: Upgrade to setup-python@v2 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecca594aa9..00722c01e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: rmdir panda3d-1.10.9 (cd thirdparty/darwin-libs-a && rm -rf rocket) - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.9 - name: Build Python 3.9 @@ -45,7 +45,7 @@ jobs: python -m pip install pytest PYTHONPATH=built LD_LIBRARY_PATH=built/lib DYLD_LIBRARY_PATH=built/lib python -m pytest - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.8 - name: Build Python 3.8 @@ -58,7 +58,7 @@ jobs: python -m pip install pytest PYTHONPATH=built LD_LIBRARY_PATH=built/lib DYLD_LIBRARY_PATH=built/lib python -m pytest - name: Set up Python 3.7 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.7 - name: Build Python 3.7 From 541b9471b5761decd8bff6c97a362ad89a2cdd4b Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 18:40:31 +0100 Subject: [PATCH 07/12] workflow: Use thirdparty packages for 1.10.10 instead of 1.10.9 --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00722c01e5..44849afceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,16 @@ jobs: shell: powershell run: | $wc = New-Object System.Net.WebClient - $wc.DownloadFile("https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-win64.zip", "thirdparty-tools.zip") + $wc.DownloadFile("https://www.panda3d.org/download/panda3d-1.10.10/panda3d-1.10.10-tools-win64.zip", "thirdparty-tools.zip") Expand-Archive -Path thirdparty-tools.zip - Move-Item -Path thirdparty-tools/panda3d-1.10.9/thirdparty -Destination . + Move-Item -Path thirdparty-tools/panda3d-1.10.10/thirdparty -Destination . - name: Get thirdparty packages (macOS) if: runner.os == 'macOS' run: | - curl -O https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-mac.tar.gz - tar -xf panda3d-1.10.9-tools-mac.tar.gz - mv panda3d-1.10.9/thirdparty thirdparty - rmdir panda3d-1.10.9 + curl -O https://www.panda3d.org/download/panda3d-1.10.10/panda3d-1.10.10-tools-mac.tar.gz + tar -xf panda3d-1.10.10-tools-mac.tar.gz + mv panda3d-1.10.10/thirdparty thirdparty + rmdir panda3d-1.10.10 (cd thirdparty/darwin-libs-a && rm -rf rocket) - name: Set up Python 3.9 uses: actions/setup-python@v2 From 6acb94f4512b258ec85b7255ece6b13a48a26ca9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 5 Dec 2021 17:11:13 +0200 Subject: [PATCH 08/12] makepanda: Support Visual Studio 2022 Closes #1214 --- README.md | 12 ++++++------ makepanda/makepanda.py | 2 +- makepanda/makepandacore.py | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 70619892c7..63b493dfc2 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ Building Panda3D Windows ------- -You can build Panda3D with the Microsoft Visual C++ 2015, 2017 or 2019 compiler, -which can be downloaded for free from the [Visual Studio site](https://visualstudio.microsoft.com/downloads/). +You can build Panda3D with the Microsoft Visual C++ 2015, 2017, 2019 or 2022 +compiler, which can be downloaded for free from the [Visual Studio site](https://visualstudio.microsoft.com/downloads/). You will also need to install the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk), and if you intend to target Windows XP, you will also need the Windows 7.1A SDK (which can be installed from the Visual Studio Installer). @@ -69,12 +69,12 @@ building them from source. After acquiring these dependencies, you can build Panda3D from the command prompt using the following command. Change the `--msvc-version` option based -on your version of Visual C++; 2019 is 14.2, 2017 is 14.1, and 2015 is 14. -Remove the `--windows-sdk=10` option if you need to support Windows XP, which -requires the Windows 7.1A SDK. +on your version of Visual C++; 2022 is 14.3, 2019 is 14.2, 2017 is 14.1, and +2015 is 14. Remove the `--windows-sdk=10` option if you need to support +Windows XP, which requires the Windows 7.1A SDK. ```bash -makepanda\makepanda.bat --everything --installer --msvc-version=14.2 --windows-sdk=10 --no-eigen --threads=2 +makepanda\makepanda.bat --everything --installer --msvc-version=14.3 --windows-sdk=10 --no-eigen --threads=2 ``` When the build succeeds, it will produce an .exe file that you can use to diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index d9bfb9e4e3..a3803d11fa 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -159,7 +159,7 @@ def usage(problem): print(" --everything (enable every third-party lib)") print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)") print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)") - print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)") + print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)") print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") print("") print("The simplest way to compile panda is to just type:") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 97f79e951b..6d1ee15ff8 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -79,6 +79,7 @@ MSVCVERSIONINFO = { (14,0): {"vsversion":(14,0), "vsname":"Visual Studio 2015"}, (14,1): {"vsversion":(15,0), "vsname":"Visual Studio 2017"}, (14,2): {"vsversion":(16,0), "vsname":"Visual Studio 2019"}, + (14,3): {"vsversion":(17,0), "vsname":"Visual Studio 2022"}, } ######################################################################## From afadb556a28d3377799393b3ad3978c565f5203e Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 5 Dec 2021 16:26:43 +0200 Subject: [PATCH 09/12] maya: Add support for Maya 2022 Closes #1213 --- makepanda/makepanda.py | 2 +- makepanda/makepandacore.py | 1 + pandatool/src/mayaprogs/mayapath.cxx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index a3803d11fa..9af51e0832 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1221,7 +1221,7 @@ if (COMPILER=="GCC"): LibName(pkg, "-lDependEngine") LibName(pkg, "-lCommandEngine") LibName(pkg, "-lFoundation") - if pkg != "MAYA2020": + if pkg not in ("MAYA2020", "MAYA2022"): LibName(pkg, "-lIMFbase") if GetTarget() != 'darwin': LibName(pkg, "-lOpenMayalib") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 6d1ee15ff8..8ec441cb14 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -108,6 +108,7 @@ MAYAVERSIONINFO = [("MAYA6", "6.0"), ("MAYA2018","2018"), ("MAYA2019","2019"), ("MAYA2020","2020"), + ("MAYA2022","2022"), ] MAXVERSIONINFO = [("MAX6", "SOFTWARE\\Autodesk\\3DSMAX\\6.0", "installdir", "maxsdk\\cssdk\\include"), diff --git a/pandatool/src/mayaprogs/mayapath.cxx b/pandatool/src/mayaprogs/mayapath.cxx index 1f42d359ee..249dd4eeff 100644 --- a/pandatool/src/mayaprogs/mayapath.cxx +++ b/pandatool/src/mayaprogs/mayapath.cxx @@ -108,6 +108,7 @@ struct MayaVerInfo maya_versions[] = { { "MAYA2018", "2018"}, { "MAYA2019", "2019"}, { "MAYA2020", "2020"}, + { "MAYA2022", "2022"}, { 0, 0 }, }; From 8fbf972f306ec44ee6331145f7b60f869ea2ac34 Mon Sep 17 00:00:00 2001 From: Aidan Noll Date: Sat, 16 Oct 2021 00:00:50 -0400 Subject: [PATCH 10/12] putil: use Py_REFCNT macro instead of directly accessing reference count field Closes #1197 --- panda/src/putil/bamReader_ext.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/putil/bamReader_ext.cxx b/panda/src/putil/bamReader_ext.cxx index a224a36037..99ec982d74 100644 --- a/panda/src/putil/bamReader_ext.cxx +++ b/panda/src/putil/bamReader_ext.cxx @@ -79,7 +79,7 @@ static TypedWritable *factory_callback(const FactoryParams ¶ms){ // If the Python pointer is the last reference to it, make sure that the // object isn't destroyed. We do this by calling unref(), which // decreases the reference count without destroying the object. - if (result->ob_refcnt <= 1) { + if (Py_REFCNT(result) <= 1) { ref_count->unref(); // Tell the Python wrapper object that it shouldn't try to delete the From 2766bca974623bd653d7b149b871f26d488526a5 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 22:47:07 +0100 Subject: [PATCH 11/12] makepanda: Add macOS 11.3 SDK --- makepanda/makepandacore.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 8ec441cb14..21ec31f5f9 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2490,6 +2490,8 @@ def SdkLocateMacOSX(osxtarget = None, archs = []): SDK["MACOSX"] = "%s/Platforms/MacOSX.platform/Developer/SDKs/%s.sdk" % (result, sdkname) elif sdkname == "MacOSX11.0" and os.path.exists("/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk"): SDK["MACOSX"] = "/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk" + elif sdkname == "MacOSX11.0" and os.path.exists("/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk"): + SDK["MACOSX"] = "/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk" else: exit("Couldn't find any MacOSX SDK for macOS version %s!" % sdkname) SDK["OSXTARGET"] = osxtarget From b397ddb3112e57be241a2e159d026ed246299dce Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Dec 2021 22:47:32 +0100 Subject: [PATCH 12/12] workflow: Switch back from macOS-latest to 10.15 for now See actions/virtual-environments#4060 - the 11.0 image is crashing for us so we'll upgrade when it's more mature --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44849afceb..104acdde0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - os: [ubuntu-18.04, windows-2016, macOS-latest] + os: [ubuntu-18.04, windows-2016, macOS-10.15] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1