Modifiers: Add idname
field to ModifierTypeInfo
#110468
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110468
Loading…
Reference in New Issue
No description provided.
Delete Branch "filedescriptor/blender:modifier-panel-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously the panel type name of a modifier (e.g. "MOD_PT_Smooth") was
created by copying from the
ModifierTypeInfo
sname
.This meant that modifiers with the same default name would use
the same identifier for the panels.
Since different object types (e.g.
OB_GREASE_PENCIL
andOB_MESH
)might want to use the same default modifier name, this PR introduces
an
idname
field in theModifierTypeInfo
struct. This is then used togenerate the panel type name.
For compatibility reasons, the
idname
is the same as thename
for now.Note: Because the
name
was used previously, this means that somemodifiers have spaces in their panel type name.
E.g. "MOD_PT_Volume to Mesh".
If I understand correctly, this wasn't a problem before because grease pencil modifiers were totally separate.
I think that context is sort of essential to understand the patch.
Maybe use
structName
then? The panel identifiers don't really matter, since the panels are created and destroyed at runtime and just need to be unique between modifiers in a single object.AFAIK using the
structName
breaks compatibility, because addons could rely on the panel names. The names are specifically duplicated from thename
so that the panel are still called the same.Should have also added that to the description.
I'm fairly sure panel types defined in C/C++ aren't accessible in Python anyway. And then, just finding any unique name when registering the panel should be fine.
Addons can set their custom Panel's
bl_parent_id
to a C/C++ defined Panel's id name to add their custom Panel as a sub-panel of that C/C++ defined Panel. I think it's about the only way to extend C/C++ Panels from addons.We should really be careful with the API, and if it is simple to avoid any API change we should follow this path.
The only thing which seems to make more sense is to add an
id
field, which then can be used to generate panel ID. Having it a panel ID in the type info seems a bit too specific.I can confirm what @Mysteryem said.
Another weird thing about using
name
in the panel id that I found is that thename
can contain spaces.Which means that using
bl_parent_id = "MOD_PT_Volume to Mesh"
in a panel actually works.So yea this should probably be changed.
Modifiers: Add `panelIDName` fieldto Modifiers: Add `id` field8c0b20332b
to6e811b61c2
Modifiers: Add `id` fieldto Modifiers: Add `idname` fieldModifiers: Add `idname` fieldto Modifiers: Add `idname` field to `ModifierTypeInfo`