nutti / fake-bpy-module

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

LayerObjects.active can be None #228

Closed Andrej730 closed 1 month ago

Andrej730 commented 1 month ago

fake-bpy-module-latest==20240522

See example below, type checker complains though it is possible to assign None to active attribute (or get None from it), so active should have a type typing.Optional[Object] instead of Object.

import bpy

# Cannot assign to attribute "active" for class "LayerObjects"
#   "None" is incompatible with "Object"
bpy.context.view_layer.objects.active = None

image

nutti commented 1 month ago

This issue is now fixed.