Unify link/append between WM operators and BPY context manager API, and cleanup usages of BKE_library_make_local
#91414
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#91414
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?
Recent refactor of Append code in WM operators left bpy API and copy/paste code untouched. Those three code paths need to be unified, they are essentially doing the same thing, there is no reason to have them separated in the first place.
Proposal
Step 1: Reorganization
wm_files_link.c
to a newBKE_blendfile_link_append.h
/intern/blendfile_link_append.c
, including:wm_do_link
,wm_do_append
, and their dependencies;WMLinkAppendData/Item
structures (which should be 'private', i.e. only defined in implementation) and their API (to be made public).**
WMLinkAppendData
could be renamedBlendfileLinkAppendContext
e.g.BKE_blendflie_link_append
module.,fe274d91a1
This will allow any code to have access to the advanced linking and appending features currently only available in WM (e.g. copy/paste code, or the python API): fine control over link/append behavior, handling of several IDs from potentially several libraries at the same time, etc.
Step 2: De-duplication
BKE_blender_link_append
code (was already done for append inwm_append_do
).d7cf7d4048
bpy.data.libraries.load()
exit function to use BKE's link/append code. D13331: LibLink/Append: Portbpy.data.libraries.load
to newBKE_blendfile_link_append
module.,0704570721
b9f54dd48a
,3f08488244
.BKE_library_make_local
.BLO
linking code (unless this very basic behavior - only linking from a single library - is good enough. But don't think it would be for any current usecases).Step 3: Code Removal
Simplifynot much to do here actually, we could simplify a bit the signature of the function, but not really its content.BKE_library_make_local
to make it only handle the actual 'make local' case (i.e. when a user wants to manually make local a datablock after they have linked it, or a whole library).BLO
.9f290467ca
4fe8c62b56
This is not the place for such code. It is only used currently in linking case, in append case it was already moved to
wm_append_do
and would now be handled by the newBKE_blender_link_append
module.** In BLO it lacks some high-level context information to get proper refined and controllable handling in all possible usecases.
Notes and references
ref.
3be5ce4aad
for the initial new append code.Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @mont29, @ideasman42
Added subscriber: @brecht
This proposal looks good.
Fine with me.
This issue was referenced by
fe274d91a1
This issue was referenced by
0704570721
Changed status from 'Confirmed' to: 'Resolved'