Some "never None" properties (property groups) are not documented as such #104903

Open
opened 2024-08-25 08:01:56 +02:00 by Andrej · 0 comments
Contributor

Noticed working on fake-bpy-module (typing module for Blender API that's using blender documentation to parse the typing data) that properties that act as PropertyGroups are not documented as "never None" though they are always set and never appear as None.

E.g. Scene.eevee or Scene.sequencer_colorspace_settings.

I've found that for some of them (e.g. bpy.types.Scene) can be fixed by changing sphinx_doc_gen.py to treat isinstance(prop.fixed_type, bpy.types.PropertyGroup) as "never None" too.

But I don't know how can we distinguish between Scene.eevee type of props and something like ID.library_weak_reference - maybe I'm missing something but from C-code they seem to be defined in the same way, they are pointer properties referring to internal C-defined blender structures, not "never none", read only.

Noticed working on [fake-bpy-module](https://github.com/nutti/fake-bpy-module) (typing module for Blender API that's using blender documentation to parse the typing data) that properties that act as PropertyGroups are not documented as "never None" though they are always set and never appear as `None`. E.g. [Scene.eevee](https://docs.blender.org/api/current/bpy.types.Scene.html#bpy.types.Scene.eevee) or [Scene.sequencer_colorspace_settings](https://docs.blender.org/api/current/bpy.types.Scene.html#bpy.types.Scene.sequencer_colorspace_settings). I've found that for some of them (e.g. `bpy.types.Scene`) can be fixed by changing sphinx_doc_gen.py to treat `isinstance(prop.fixed_type, bpy.types.PropertyGroup)` as "never None" too. But I don't know how can we distinguish between `Scene.eevee` type of props and something like `ID.library_weak_reference` - maybe I'm missing something but from C-code they seem to be defined in the same way, they are pointer properties referring to internal C-defined blender structures, not "never none", read only.
Andrej added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2024-08-25 08:01:56 +02:00
Andrej changed title from Some "never None" properties (property groups) are not documented to Some "never None" properties (property groups) are not documented as such 2024-08-25 08:02:02 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#104903
No description provided.