nytimes/rd-blender-docker

Import issue after latest numpy release

Opened this issue · 0 comments

numpy 1.24.0 got release on 18 Dec 2022 (https://pypi.org/project/numpy/#history).

Since we are not specifying the fixed version of numpy in the build (https://github.com/nytimes/rd-blender-docker/blob/master/generate.py#L107) it installs the latest one automatically.

GLTF import is failing with the latest numpy version and Blender 3.3:

AttributeError: module 'numpy' has no attribute 'bool'. Did you mean: 'bool_'?
    raise AttributeError("module {!r} has no attribute "
  File "/usr/bin/3.3/python/lib/python3.10/site-packages/numpy/__init__.py", line 284, in __getattr__
    poly_smooths = np.empty(num_polys, dtype=np.bool)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py", line 607, in set_poly_smoothing
    set_poly_smoothing(gltf, pymesh, mesh, vert_normals, loop_vidxs)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py", line 424, in do_primitives

    do_primitives(gltf, mesh_idx, skin_idx, mesh, tmp_ob)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py", line 46, in create_mesh
    return create_mesh(gltf, mesh_idx, skin_idx)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py", line 25, in create
    mesh = BlenderMesh.create(gltf, pynode.mesh, pynode.skin)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 223, in create_mesh_object
    obj = BlenderNode.create_mesh_object(gltf, vnode)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 51, in create_object
    obj = BlenderNode.create_object(gltf, vnode_id)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 30, in create_vnode
  [Previous line repeated 2 more times]
    BlenderNode.create_vnode(gltf, child)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 44, in create_vnode
    BlenderNode.create_vnode(gltf, child)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 44, in create_vnode
    BlenderNode.create_vnode(gltf, child)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 44, in create_vnode
    BlenderNode.create_vnode(gltf, 'root')
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py", line 36, in create
    BlenderScene.create(gltf)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py", line 40, in _create
    BlenderGlTF._create(gltf)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py", line 33, in create
    BlenderGlTF.create(gltf_importer)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/__init__.py", line 1221, in unit_import
    return self.unit_import(self.filepath, import_settings)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/__init__.py", line 1206, in import_gltf2
    return self.import_gltf2(context)
  File "/usr/bin/3.3/scripts/addons/io_scene_gltf2/__init__.py", line 1173, in execute
Traceback (most recent call last):
  poly_smooths = np.empty(num_polys, dtype=np.bool)
/usr/bin/3.3/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py:607: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  bpy.ops.object.delete({"selected_objects": objs})