Refactor ID types code/handling to use an ID_type
structure, with callbacks for common generic ID management (creation, copy, delete, etc.). #73719
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#73719
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
General Idea
We want to have some sort of
ID_type
structure, similar to what we have for e.g. modifiers or constraints.This structure would mainly contain:
** note: this is mostly handled in
BKE_idcode
currently.** note: those are mostly scattered in each ID type BKE's code currently, and called from
BKE_lib
API throughswitch
/case
pattern.Process
See D6966 and
c328049535
for the initial implementation, including 'demo' for theID_OB
object type.To add a new IDTypeInfo you need to:
mesh.c
forID_ME
, etc.).BKE_XXX_copy_data()
,BKE_XXX_init()
etc. functions. Those existing functions become therefore wrappers around the static callbacks as well (and shall be removed in later cleanup steps).IDType_ID_OB
for object).extern
declaration of the new IDType inBKE_idtype.h
.Register the new IDType in
id_type_init()
ofidtype.c
.Tasks for Cleanup Friday
Now we have to create those for all remaining ID types. Please put your name in the list below for IDTypes you want to handle (I already reserved the oddballs ones I suspect to be the trickiest ;)).
ID_SCE
Scene ~~@mont29ID_LI
Library ~~@mont29ID_OB
Object ~~@mont29ID_ME
Mesh ~~@mont29ID_CU
Curve ~~@mont29ID_MB
MetaBall ~~@mont29ID_MA
Material ~~@mont29ID_TE
Texture ~~@mont29ID_IM
Image ~~@mont29ID_LT
Lattice ~~@mont29ID_LA
Light ~~@brechtID_CA
Camera ~~@brechtID_IP
Ipo (deprecated) ~~@mont29ID_KE
Shape key ~~@mont29ID_WO
World ~~@brechtID_SCR
Screen ~~@mont29ID_VF
VFont~~@dfelintoID_TXT
Text~~@dfelintoID_SPK
Speaker ~~@mont29ID_SO
Sound ~~@mont29ID_GR
Group ~~@dfelintoID_AR
Armature @dfelintoID_AC
Action @dfelintoID_NT
NodeTree ~~@mont29ID_BR
Brush ~~@mont29ID_PA
ParticleSettings ~~@mont29ID_GD
Grease Pencil ~~@mont29ID_WM
WindowManager ~~@mont29ID_MC
MovieClip ~~@mont29ID_MSK
Mask ~~@mont29ID_LS
FreestyleLineStyle ~~@mont29ID_PAL
Palette ~~@mont29ID_PC
PaintCurve ~~@mont29ID_CF
CacheFile ~~@mont29ID_WS
WorkSpace ~~@mont29ID_LP
LightProbe ~~@brechtID_HA
Hair ~~@brechtID_PT
PointCloud ~~@brechtID_VO
Volume ~~@brechtChanged status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @mont29
Added subscriber: @brecht
Added subscriber: @dfelinto
Changed status from 'Confirmed' to: 'Resolved'
I guess we need a follow-up task for:
BLI_assert(0)
BKE_id_swap
andBKE_libblock_get_alloc_info
genericidcode.c
intoidtype.c
lib_query.c
to the various ID typesYes indeed (already removed the relevant switch/case btw, just have to commit this).
Will handle creating new tasks in comming days.
See #74960 for follow-up tasks.