From 0313eb47958693e965f1fe33aaefd522e06ac08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 23 Apr 2023 20:07:00 +0200 Subject: [PATCH] blender: patch removed numpy attribute --- pkgs/applications/misc/blender/blender-numpy.patch | 14 ++++++++++++++ pkgs/applications/misc/blender/default.nix | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/misc/blender/blender-numpy.patch diff --git a/pkgs/applications/misc/blender/blender-numpy.patch b/pkgs/applications/misc/blender/blender-numpy.patch new file mode 100644 index 000000000000..c76324846b1c --- /dev/null +++ b/pkgs/applications/misc/blender/blender-numpy.patch @@ -0,0 +1,14 @@ +diff --git a/release/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py b/release/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py +index 41dd4d03..a97f9d38 100755 +--- a/release/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py ++++ b/release/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py +@@ -572,7 +572,7 @@ def set_poly_smoothing(gltf, pymesh, mesh, vert_normals, loop_vidxs): + # Try to guess which polys should be flat based on the fact that all the + # loop normals for a flat poly are = the poly's normal. + +- poly_smooths = np.empty(num_polys, dtype=np.bool) ++ poly_smooths = np.empty(num_polys, dtype=np.bool_) + + poly_normals = np.empty(num_polys * 3, dtype=np.float32) + mesh.polygons.foreach_get('normal', poly_normals) + diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index df783bdbba5b..77ba09c23816 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -34,7 +34,10 @@ stdenv.mkDerivation rec { hash = "sha256-JHxMEignDJAQ9HIcmFy1tiirUKvPnyZ4Ywc3FC7rkcM="; }; - patches = lib.optional stdenv.isDarwin ./darwin.patch; + patches = [ + # remove with 3.5.X + ./blender-numpy.patch + ] ++ lib.optional stdenv.isDarwin ./darwin.patch; nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ];