Add WM api to handle PanelType parent/child relationships #104303

Open
opened 2023-02-02 15:27:25 +01:00 by Bastien Montagne · 10 comments

Currently handling of parenting between panels in C/C++ code is spread all over the place, each area of code redefining the essentially the same logic to create sub-panels. At least these functions are concerned:

  • rna_Panel_register used by all Python-defined panels
  • modifier_subpanel_register
  • gpencil_modifier_subpanel_register
  • fmodifier_subpanel_register
  • shaderfx_panel_register
  • nla_buttons_register

TODO

Check all current use-cases and define what part of these are common logic. Put this common logic into a new WM_paneltype_subpanel_add API function (defined in wm_panel_type.c).
This should cover at the very least setting the parent_id string and parent PanelType pointer of the child, and insert the child at the proper place in its parent's children list.

Currently handling of parenting between panels in C/C++ code is spread all over the place, each area of code redefining the essentially the same logic to create sub-panels. At least these functions are concerned: * `rna_Panel_register` used by all Python-defined panels * `modifier_subpanel_register` * `gpencil_modifier_subpanel_register` * `fmodifier_subpanel_register` * `shaderfx_panel_register` * `nla_buttons_register` TODO ------- Check all current use-cases and define what part of these are common logic. Put this common logic into a new `WM_paneltype_subpanel_add` API function (defined in `wm_panel_type.c`). This should cover at the very least setting the `parent_id` string and `parent` `PanelType` pointer of the child, and insert the child at the proper place in its parent's `children` list.
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @bekzii

Added subscriber: @bekzii
bekzii self-assigned this 2023-02-03 08:57:33 +01:00

Hi, I'd like to take on this task :)

Hi, I'd like to take on this task :)

Added subscriber: @DMaroo

Added subscriber: @DMaroo
bekzii was unassigned by Dhruv Maroo 2023-02-03 12:00:30 +01:00
Dhruv Maroo self-assigned this 2023-02-03 12:00:30 +01:00

Hi @bekzii

I'm sorry, I didn't notice your comment about working on the task. But I started working on the task a while before that and even submitted a patch at https://developer.blender.org/D17193 :/

I'm sorry for this collision, and I should have claimed the task for myself. But I believe there is no need to work on this task anymore. Again, sorry for not claiming it.

Hi @bekzii I'm sorry, I didn't notice your comment about working on the task. But I started working on the task a while before that and even submitted a patch at https://developer.blender.org/D17193 :/ I'm sorry for this collision, and I should have claimed the task for myself. But I believe there is no need to work on this task anymore. Again, sorry for not claiming it.

It's okay! Glad you managed to get it done :) (You actually did it kind of better than my solution)

It's okay! Glad you managed to get it done :) (You actually did it kind of better than my solution)

Thank you bekzii!

Thank you bekzii!

Added subscriber: @Pratyaksh-Raj

Added subscriber: @Pratyaksh-Raj
Dhruv Maroo was unassigned by Pratyaksh Raj 2023-02-04 17:11:28 +01:00
Pratyaksh Raj self-assigned this 2023-02-04 17:11:28 +01:00

Hello @mont29

Let me Know If This issue is still open , I am ready with solution, It can be solved by using Linked list or tree.

Hello @mont29 Let me Know If This issue is still open , I am ready with solution, It can be solved by using Linked list or tree.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:21:21 +01: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 project
No Assignees
4 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#104303
No description provided.