Blenloader Decentralization #76372

Closed
opened 2020-05-03 16:51:12 +02:00 by Jacques Lucke · 32 comments
Member

This is part of a larger refactoring towards a more extensible architecture in Blender (#75724).

  • Add new blenloader API that allows decentralizing the .blend file I/O code (48075b2c05).
  • Use new API in readfile.c and writefile.c.
  • Add new callbacks to ModifierTypeInfo (b6981d9e48).
  • Add new callbacks to IDTypeInfo (a443287908).
  • Move remaining id type specific code from readfile.c and writefile.c to IDTypeInfo callbacks.
This is part of a larger refactoring towards a more extensible architecture in Blender (#75724). - [x] Add new blenloader API that allows decentralizing the .blend file I/O code (48075b2c05). - [x] Use new API in `readfile.c` and `writefile.c`. - [x] Add new callbacks to `ModifierTypeInfo` (b6981d9e48). - [x] Add new callbacks to `IDTypeInfo` (a443287908). - [x] Move remaining id type specific code from `readfile.c` and `writefile.c` to `IDTypeInfo` callbacks.
Jacques Lucke self-assigned this 2020-05-03 16:51:12 +02:00
Author
Member

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

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

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Author
Member

Added subscribers: @brecht, @mont29

Added subscribers: @brecht, @mont29

Generally fine with this proposal.

I’m missing a more/better structured planning though, with some clear milestones etc.

Another question worse investigating is regarding the lib linking and expand processes. Those two could be entirely abstracted and performed through generic lib_query “foreach_id” system, which would save us adding two of the three callbacks currently needed for read code. Main issue/work here would be to add handling of deprecated DNA ID Pointers to lib_query, but that should not be a huge work (we already support conditional handling of some pointers for UI data-block pointers, doing the same thing for deprecated ones should be fairly straightforward).

Generally fine with this proposal. I’m missing a more/better structured planning though, with some clear milestones etc. Another question worse investigating is regarding the lib linking and expand processes. Those two could be entirely abstracted and performed through generic lib_query “foreach_id” system, which would save us adding two of the three callbacks currently needed for read code. Main issue/work here would be to add handling of deprecated DNA ID Pointers to lib_query, but that should not be a huge work (we already support conditional handling of some pointers for UI data-block pointers, doing the same thing for deprecated ones should be fairly straightforward).
Author
Member

I agree that lib linking and expanding can and should be done using the generic foreach_id system. However, I don't think that we should do both refactorings at the same time. If we decide to do both refactorings separately, the order probably does not matter too much. The difference is that I could start with the decentralization immediately, while you'd probably need to spend some time to make lib linking and expand work with the foreach_id system.

We can also decide that we only decentralize file writing and direct data reading at first.

As for milestones, I'd say that a first milestone would be to get all modifier specific code out of readfile.c.

I agree that lib linking and expanding can and should be done using the generic `foreach_id` system. However, I don't think that we should do both refactorings at the same time. If we decide to do both refactorings separately, the order probably does not matter too much. The difference is that I could start with the decentralization immediately, while you'd probably need to spend some time to make lib linking and expand work with the `foreach_id` system. We can also decide that we only decentralize file writing and direct data reading at first. As for milestones, I'd say that a first milestone would be to get all modifier specific code out of `readfile.c`.
Author
Member

Once the API is committed, I could also start using it in readfile.c and writefile.c directly. This would simplify the actual decentralization later on.

If we agree on the API, this should be fairly straight forward to do.

Once the API is committed, I could also start using it in `readfile.c` and `writefile.c` directly. This would simplify the actual decentralization later on. If we agree on the API, this should be fairly straight forward to do.

My main point is that if we use libquery for linking and expanding, we do not need those two callbacks in IDTypeInfo then. Feels a bit useless and very noisy to add, then remove two callbacks from such a struct.

I do not know how urgent it is for you to move forward on this topic, if needed i can spend a few hours to check how feasible using libquery for this is…

My main point is that if we use libquery for linking and expanding, we do not need those two callbacks in `IDTypeInfo` then. Feels a bit useless and very noisy to add, then remove two callbacks from such a struct. I do not know how urgent it is for you to move forward on this topic, if needed i can spend a few hours to check how feasible using libquery for this is…
Author
Member

For the next code quality day, I'd like to follow the checklist I added to the main post. Is that ok?

I think updating lib linking and expand to use the new API is a code quality improvement by itself, independent on how we decide to implement it in the future.

I read in the weekly report that @mont29 did some initial investigation to check if it is possible to use libquery for lib linking and expand. It seems to be not straight forward (which is also what I found). Let's discuss how to proceed with this topic, when I'm done with the tasks listed in the main post.

For the next code quality day, I'd like to follow the checklist I added to the main post. Is that ok? I think updating lib linking and expand to use the new API is a code quality improvement by itself, independent on how we decide to implement it in the future. I read in the weekly report that @mont29 did some initial investigation to check if it is possible to use libquery for lib linking and expand. It seems to be not straight forward (which is also what I found). Let's discuss how to proceed with this topic, when I'm done with the tasks listed in the main post.

Yeah, am not super happy to have to go through those intermediate steps (since the IDTypeInfo liblink/expand callbacks will likely be removed soon-ish), but I don’t really plan to work on this usage of libquery for those in immediate future, so I'm fine with your plan.

Yeah, am not super happy to have to go through those intermediate steps (since the IDTypeInfo liblink/expand callbacks will likely be removed soon-ish), but I don’t really plan to work on this usage of libquery for those in immediate future, so I'm fine with your plan.

Going ahead with this for the next code quality day sounds good then.

Going ahead with this for the next code quality day sounds good then.
Contributor

Added subscriber: @KenzieMac130

Added subscriber: @KenzieMac130

This issue was referenced by 538817d9a8

This issue was referenced by 538817d9a86c446cdab7b6b2e84378e1f9b99f22

This issue was referenced by b443f9b54c

This issue was referenced by b443f9b54c38570ca6b7cdc25a8eb1f3c97b735e

This issue was referenced by bcb612e361

This issue was referenced by bcb612e3615e216f6defb2d631ef0f8c3c6d6c82

This issue was referenced by fc9ec1b9d8

This issue was referenced by fc9ec1b9d80fb17d3cc5d3c63f8e4bb356fa7ebc

This issue was referenced by 9ad2965921

This issue was referenced by 9ad2965921f064250830a8647de3dce68bcb2e4d

This issue was referenced by da96389dcb

This issue was referenced by da96389dcba7b07506fd241616e7b1db3ba7a27b

This issue was referenced by 41db8f2fce

This issue was referenced by 41db8f2fce1763c312a7fa47ed3aa338e6d77124

This issue was referenced by 62223e9851

This issue was referenced by 62223e98510f2c0d735cb7084134c5213c1cb804

This issue was referenced by c32a5ce17c

This issue was referenced by c32a5ce17c7609c29c832a2d229c60e12d0ccbb5

This issue was referenced by dfa027fe09

This issue was referenced by dfa027fe09b53485802cb0d6224ffc6bbc058b87

This issue was referenced by 7dd76329e1

This issue was referenced by 7dd76329e11cd5dc13b5804670bee0efe4d51fa6

This issue was referenced by f6524aaa80

This issue was referenced by f6524aaa8093bfc88c658107b8077cd09ac3e989

This issue was referenced by af24532612

This issue was referenced by af245326125aed919bc7560d20f6152e55d1478f

This issue was referenced by 019407810b

This issue was referenced by 019407810b9eeebce0e7fdaf5fa89906a40841ed

This issue was referenced by 57414e6d1d

This issue was referenced by 57414e6d1de53c1c0c32304252a2e790d2fc4786

This issue was referenced by 37ef37711d

This issue was referenced by 37ef37711d997899041d84e8c7a17e1fbb4efab9

This issue was referenced by 58e9b51f95

This issue was referenced by 58e9b51f9551bc68011b85554bad4dd6487576ce

This issue was referenced by 2acf01ec62

This issue was referenced by 2acf01ec62158229d62944a3adac96fe370e040a

This issue was referenced by 992b8f6f5f

This issue was referenced by 992b8f6f5fce7f34139ad4acf4a2b74c0cf49185
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author
Member

Closing because this task is done from a core-module perspective. Other modules now have the capability to structure their .blend I/O code however they wish. The API for that is available in BLO_read_write.h.

Closing because this task is done from a core-module perspective. Other modules now have the capability to structure their .blend I/O code however they wish. The API for that is available in `BLO_read_write.h`.
Thomas Dinges added this to the 2.93 LTS milestone 2023-02-07 18:46:39 +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
5 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#76372
No description provided.