nutti / fake-bpy-module

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

Type Hint Error: "bpy.types.XXXX" to type hint parm type/return type shows "Any" #259

Closed atticus-lv closed 1 day ago

atticus-lv commented 2 weeks ago

System Information

Description about the bug

seems that type hint is not right image

Andrej730 commented 2 weeks ago

What module is this?

atticus-lv commented 2 weeks ago

This is not a module but a custom tool class. The problem is when using bpy.types.XXXX to type hint a parm type/return type, it always shows Any

Andrej730 commented 2 weeks ago

Was able to reproduce this. If you open bpy.types you'll see a warning that PyCharm skips the file because of it's size: image

You can increase maximum file size in the pycharm settings and restart pycharm, then it will load symbols from bpy.types too and it will work fine. https://stackoverflow.com/questions/37695939/maximum-file-size-in-pycharm

nutti commented 2 weeks ago

@atticus-lv

You can also see the same information at the first Note on https://github.com/nutti/fake-bpy-module/blob/master/docs/setup_pycharm.md to solve this issue.

atticus-lv commented 2 weeks ago

thanks, I will check it out. Before I had set intellisense.filesize to 2600 just as the readme said. Maybe I should make it larger just like 30000

atticus-lv commented 2 weeks ago

nice, set it to 5000 and it works image

however the bpy.utils still highlight, old version like 4.0 will not have this issue(set it to 30000 is not work, but when using from bpy.utils import ...) image image

nutti commented 2 weeks ago

I'm not sure whether this issue is PyCharm specific or not. From my VSCode environment, I could not find this issue.

Andrej730 commented 2 weeks ago

however the bpy.utils still highlight, old version like 4.0 will not have this issue(set it to 30000 is not work, but when using from bpy.utils import ...)

Sorry, I don't understand what's the issue, can you explain it more?

nutti commented 1 week ago

@atticus-lv Any update?

nutti commented 1 day ago

Close this issue due to no response.