WIP:#104303:WM panel parent API #105645

Draft
Pratyaksh Raj wants to merge 2 commits from Pratyaksh-Raj/blender:WM-Panel-API1 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor
  1. The function 'WM_paneltype_subpanel_add' adds a sub-panel to a parent panel in Blender's user interface.

  2. The function takes three arguments: 'pt', 'parent', and 'use_order'. 'pt' is a pointer to the sub-panel to be added, 'parent' is a pointer to the parent panel, and 'use_order' is a boolean flag that determines whether the sub-panel should be added in a specific order.

  3. The first thing the function does is set the 'parent' of the 'pt' sub-panel to the 'parent' panel passed as an argument.

  4. If 'parent' is not NULL, the function checks if 'use_order' is true. If it is, the function iterates through the children of the 'parent' panel to find the correct position for the sub-panel based on its order property. If 'use_order' is false, the function simply adds the sub-panel to the end of the children list of the 'parent' panel.

  5. The function then sets the 'owner_id' property of the 'pt' sub-panel to the current owner ID using the 'RNA_struct_state_owner_get' function.

  6. Finally, the function adds the 'pt' sub-panel to the global 'paneltypes' list using the 'WM_paneltype_add' function.

'WM_paneltype_subpanel_add' function improve the usability and functionality of Blender's user interface, which can ultimately benefit both developers and users alike.

1. The function 'WM_paneltype_subpanel_add' adds a sub-panel to a parent panel in Blender's user interface. 2. The function takes three arguments: 'pt', 'parent', and 'use_order'. 'pt' is a pointer to the sub-panel to be added, 'parent' is a pointer to the parent panel, and 'use_order' is a boolean flag that determines whether the sub-panel should be added in a specific order. 3. The first thing the function does is set the 'parent' of the 'pt' sub-panel to the 'parent' panel passed as an argument. 4. If 'parent' is not NULL, the function checks if 'use_order' is true. If it is, the function iterates through the children of the 'parent' panel to find the correct position for the sub-panel based on its order property. If 'use_order' is false, the function simply adds the sub-panel to the end of the children list of the 'parent' panel. 5. The function then sets the 'owner_id' property of the 'pt' sub-panel to the current owner ID using the 'RNA_struct_state_owner_get' function. 6. Finally, the function adds the 'pt' sub-panel to the global 'paneltypes' list using the 'WM_paneltype_add' function. 'WM_paneltype_subpanel_add' function improve the usability and functionality of Blender's user interface, which can ultimately benefit both developers and users alike.
Pratyaksh Raj added 1 commit 2023-03-10 20:42:04 +01:00
Pratyaksh Raj added 1 commit 2023-03-10 20:43:35 +01:00
Pratyaksh Raj requested review from Bastien Montagne 2023-03-10 20:45:10 +01:00
Pratyaksh Raj changed title from WIP:#104303:WM panel parent API to WIP:https://projects.blender.org/blender/blender/issues/104303:WM panel parent API 2023-03-10 20:51:08 +01:00
Pratyaksh Raj changed title from WIP:https://projects.blender.org/blender/blender/issues/104303:WM panel parent API to WIP:#104303:WM panel parent API 2023-03-10 20:52:04 +01:00
Author
First-time contributor

Sir, @mont29, I have updated the changes you requested and have also tested and build this PR. However, the second commit was made by mistake when I clicked on 'Update branch'.

Sir, @mont29, I have updated the changes you requested and have also tested and build this PR. However, the second commit was made by mistake when I clicked on 'Update branch'.
Bastien Montagne requested changes 2023-03-13 10:51:44 +01:00
Bastien Montagne left a comment
Owner

Unfortunately there is still obvious mistakes in that code, some which will crash blender on run (access to NULL pointer), others which will break current UI.

Please do build and test your patch before submitting it (testing meaning 'use Blender checking the areas of code you did change').

Unfortunately there is still obvious mistakes in that code, some which will crash blender on run (access to NULL pointer), others which will break current UI. Please do build and test your patch before submitting it (testing meaning 'use Blender checking the areas of code you did change').
This pull request has changes conflicting with the target branch.
  • source/blender/editors/animation/fmodifier_ui.c
  • source/blender/editors/space_nla/nla_buttons.c
  • source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c
  • source/blender/makesrna/intern/rna_ui.c
  • source/blender/modifiers/intern/MOD_ui_common.c
  • source/blender/shader_fx/intern/FX_ui_common.c
  • source/blender/windowmanager/WM_api.h
  • source/blender/windowmanager/intern/wm_panel_type.c

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u WM-Panel-API1:Pratyaksh-Raj-WM-Panel-API1
git checkout Pratyaksh-Raj-WM-Panel-API1
Sign in to join this conversation.
No reviewers
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
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#105645
No description provided.