Fix #111713: Nodes crash when overriding due to item.parent nullptr #111755

Merged
Lukas Tönne merged 3 commits from LukasTonne/blender:fix-root-panel-rna-crash into main 2023-08-31 18:53:04 +02:00
Member

Library overrides crashed with on trying to access the interface root panel. The root panel should not be exposed through RNA, but also accessing its position property should be allowed.

Several fixes here:

  • Fix position property getter when the item has no parent panel (i.e. the root panel).
  • Avoid infinite loops in the greedy override comparison: exclude the loopback parent property.
  • Don't return the root panel via the parent property in the first place, just return nullptr.
Library overrides crashed with on trying to access the interface root panel. The root panel should not be exposed through RNA, but also accessing its `position` property should be allowed. Several fixes here: - Fix `position` property getter when the item has no parent panel (i.e. the root panel). - Avoid infinite loops in the greedy override comparison: exclude the loopback `parent` property. - Don't return the root panel via the `parent` property in the first place, just return nullptr.
Lukas Tönne added 3 commits 2023-08-31 18:14:39 +02:00
3268f57f40 Gracefully handle getting index of the root panel.
Currently accessing "parent.position" of node interface items can crash
because the parent can be the root panel which does not have a parent
itself. Getting a root panel pointer should be prevent by RNA, but for
internal access it must be handled properly.
2bf9ccda9a Exclude 'parent' property of items from override comparison.
Comparing both "parent" and "ui_items" in overrides leads to loopback:
`item.parent.items[0].parent.items[0].parent. ...`.
ea3d11769f Return nullptr instead of the root panel for RNA "parent" property.
Root panel should not be exposed through RNA. Cases of crashing behavior
have been resolved, but it's confusing and should not be returned by
any RNA function.
Lukas Tönne added this to the Nodes & Physics project 2023-08-31 18:14:54 +02:00
Lukas Tönne requested review from Bastien Montagne 2023-08-31 18:15:11 +02:00
Lukas Tönne requested review from Jacques Lucke 2023-08-31 18:15:11 +02:00
Lukas Tönne changed title from Fix 111713: Nodes crash when overriding due to item.parent nullptr to Fix #111713: Nodes crash when overriding due to item.parent nullptr 2023-08-31 18:15:30 +02:00
Jacques Lucke approved these changes 2023-08-31 18:20:24 +02:00
Lukas Tönne merged commit 2a94a99605 into main 2023-08-31 18:53:04 +02:00
Lukas Tönne deleted branch fix-root-panel-rna-crash 2023-08-31 18:53:06 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 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#111755
No description provided.