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

Mesh.from_pydata() "vertices" parameter has incomplete type

Open arcusmaximus opened this issue 5 months ago • 3 comments

The "vertices" parameter of bpy.types.Mesh.from_pydata() was originally untyped, but in fake-bpy-module version 20250606, it received the type Iterable[Sequence[float]]. This is better than before, but it's not complete: it should be Iterable[Sequence[float] | Vector]. Right now, passing a list of Vectors (which works just fine at runtime) raises a type error.

arcusmaximus avatar Jul 09 '25 17:07 arcusmaximus

Also an issue upstream? https://docs.blender.org/api/4.5/bpy.types.Mesh.html#bpy.types.Mesh.from_pydata

Andrej730 avatar Jul 10 '25 18:07 Andrej730

Raise PR to fix this issue. https://projects.blender.org/blender/blender/pulls/148872

nutti avatar Oct 27 '25 15:10 nutti

The patch is rejected. https://projects.blender.org/blender/blender/pulls/148872#issuecomment-1746958

@arcusmaximus @Andrej730 He said we can handle mathutils.Vector as a sequence in typing. Is there any idea about this? If not, I need to handle this issue by using mod file.

nutti avatar Oct 29 '25 13:10 nutti