fake-bpy-module icon indicating copy to clipboard operation
fake-bpy-module copied to clipboard

BMesh typing issues

Open arcusmaximus opened this issue 1 year ago • 0 comments
trafficstars

  • OS: Windows
  • Blender version: 4.0
  • fake-bpy-module-4.0 20231118

The following code produces a bunch of type checking errors:

bl_mesh = bmesh.from_edit_mesh(cast(bpy.types.Mesh, bpy.context.edit_object.data))

bl_layer = bl_mesh.edges.layers.float.get("bevel_weight_edge")
for bl_edge in bl_mesh.edges:
    cast(bmesh.types.BMEdge, bl_edge)[bl_layer] = 1.0

Specifically:

  • BMLayerAccessEdge.float is typed as None instead of BMLayerCollection.
  • BMLayerCollection.get() is similarly typed to return None instead of BMLayerItem.
  • BMesh.edges is not recognized as being iterable.
  • BMEdge.__setitem__ is not defined, meaning bl_edge[bl_layer] again results in a type error.

In general, though, fake-bpy-module is a huge help for developing my Blender addon. Thank you for creating it :)

arcusmaximus avatar Jan 27 '24 18:01 arcusmaximus