nutti / fake-bpy-module

Fake Blender Python API module collection for the code completion.
MIT License
1.37k stars 97 forks source link

Many type errors when using bmesh #152

Closed Intrets closed 9 months ago

Intrets commented 10 months ago

System Information

Expected behavior

Ability to use type information in Pycharm or VSCode's Pylance.

Description about the bug

For types from bmesh I ran into a lot of type errors.

Screenshots/Files

Pylance errors, similar errors in pycharm:

code in text format ```python import bpy import bmesh for mesh in bpy.data.meshes: mesh.animation_data bm = bmesh.from_edit_mesh(mesh) bm.verts.ensure_lookup_table() vert = bm.verts[0] vert.co.x += 2.0 bmesh.ops.triangulate(bm, faces = bm.faces) bmesh.update_edit_mesh(mesh) for face in bm.faces: for vert in face.verts: print(vert.index) bm.to_mesh(mesh) bm.free() ```

image image

Additional comments

Am I misunderstanding the scope of the project? From the small tests I did I could use the types fine for bpy types, iterating over them, passing to function arguments etc. but when I tried using some bmesh functions and types it went wrong.

Intrets commented 10 months ago

I should add I tried fake-bpy-module, fake-bpy-module-3.6 and fake-bpy-module-latest, installed via pip.

nutti commented 9 months ago

This issue is fixed now.