nutti / fake-bpy-module

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

SpaceView3D.draw_handler_add/remove self argument not implicit #137

Closed Rawalanche closed 10 months ago

Rawalanche commented 11 months ago

System Information

Description about the bug

Hi, I installed fake-bpy and was able to get my script to be nearly warning/error clean even with linter as strict as PyLint. However I have issue with two specific functions: bpy.types.SpaceView3D.draw_handler_add and bpy.types.SpaceView3D.draw_handler_remove. I have no clue why, but they keep causing the "no value for argument errors: image and if I specify the argument names, the linter starts complaining about not supplying self as an argument, while self in this case should be implicit: image

Is this a bug or am I doing something wrong? I don't believe I should be supplying any self argument here, as that one should be passed by Python implicitly... or not?

nutti commented 11 months ago

This is an issue that comes from handling draw_handler_add and draw_handler_remove as methods not class methods.

This issue needs to be fixed from Blender. I have submitted the PR to fix this issue. https://projects.blender.org/blender/blender/pulls/111107

Rawalanche commented 11 months ago

This is an issue that comes from handling draw_handler_add and draw_handler_remove as methods not class methods.

This issue needs to be fixed from Blender. I have submitted the PR to fix this issue. https://projects.blender.org/blender/blender/pulls/111107

Ah, thanks! Great job by the way. I am using latest fake-bpy and as I said, even with strict linters, I can get a lot of static analysis and code completion in VSCode without having to ignore any errors and warnings.

nutti commented 10 months ago

The patch is merged.