Fix: Appending a workspace appends scene data along with it
This probably got broken when expanding was changed to use foreach ID. In the old code the screen was not part of expanding. Also adds the appropriate flags for workspace pinned and sequencer scenes. This was causing issues in particular with the new video editing template, where appending a workspace would append the Edit scene. Fix #146156 Pull Request: https://projects.blender.org/blender/blender/pulls/146164
This commit is contained in:
committed by
Brecht Van Lommel
parent
851e5b55af
commit
fdc9412b9d
@@ -70,8 +70,8 @@ static void workspace_foreach_id(ID *id, LibraryForeachIDData *data)
|
||||
{
|
||||
WorkSpace *workspace = (WorkSpace *)id;
|
||||
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, workspace->pin_scene, IDWALK_CB_NOP);
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, workspace->sequencer_scene, IDWALK_CB_NOP);
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, workspace->pin_scene, IDWALK_CB_DIRECT_WEAK_LINK);
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, workspace->sequencer_scene, IDWALK_CB_DIRECT_WEAK_LINK);
|
||||
|
||||
LISTBASE_FOREACH (WorkSpaceLayout *, layout, &workspace->layouts) {
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, layout->screen, IDWALK_CB_USER);
|
||||
|
||||
@@ -4443,6 +4443,12 @@ static int expand_cb(LibraryIDLinkCallbackData *cb_data)
|
||||
return IDWALK_RET_NOP;
|
||||
}
|
||||
|
||||
/* Do not expand weak links. These are used when the user interface links to scene data,
|
||||
* but we don't want to bring along such datablocks with a workspace. */
|
||||
if (cb_data->cb_flag & IDWALK_CB_DIRECT_WEAK_LINK) {
|
||||
return IDWALK_RET_NOP;
|
||||
}
|
||||
|
||||
/* Explicitly requested to be ignored during readfile processing. Means the read_data code
|
||||
* already handled this pointer. Typically, the 'owner_id' pointer of an embedded ID. */
|
||||
if (cb_data->cb_flag & IDWALK_CB_READFILE_IGNORE) {
|
||||
|
||||
Reference in New Issue
Block a user