nutti / fake-bpy-module

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

Object.children should be tuple #130

Closed Pyrolistical closed 1 year ago

Pyrolistical commented 1 year ago

System Information

Expected behavior

bpy.types.Object.children should be iterable

From Blender console:

>>> type(bpy.data.objects['some object'])
<class 'bpy_types.Object'>

>>> type(bpy.data.objects['some object'].children)
<class 'tuple'>

Description about the bug

in fake-bpy-modules/bpy/types.py class Object defines children as:

children = None

Additional comments

I believe it should be Tuple[Object] as the workaround is to cast children

from typing import cast

for child in cast(tuple[Object], some_object.children):
nutti commented 1 year ago

This issue needs to be fixed by sending a patch to Blender itself. I have already submitted the PR. https://projects.blender.org/blender/blender/pulls/108852

nutti commented 1 year ago

This issue is now solved.