nutti / fake-bpy-module

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

bpy.context should have type of bpy.types.Context #104

Closed anatawa12 closed 2 years ago

anatawa12 commented 2 years ago

System Information

Expected behavior
The behavior you expect about the feature you reported.

_context: bpy.types.Context = bpy.context

Should not have a type error.

Description about the bug
The description about the bug.

bpy.context is a instance of bpy.types.Context however it's not in fake-bpy-module.

Screenshots/Files [Optional]
It is good to solve the bug if you attach the screenshots or .blend file.

Additional comments [Optional]

nutti commented 2 years ago

@anatawa12

Should not have a type error.

fake-bpy-module exposes bpy.context as a module. I think that there is no issue for the code completion.

github_20220718

However, please let me know if you have a issue in your workflow about this hack.

anatawa12 commented 2 years ago

please let me know if you have a issue in your workflow about this hack.

Context can be passed as first positional parameter of operators (currently fake-bpy-module doesn't support yet) so in my function, I have parameter with type Context. It should be possible to paas bpy.context to such a parameter.

nutti commented 2 years ago

Ah, I understand this issue relates to #103. Thanks.

nutti commented 2 years ago

This issue is now fixed.