Fix nested collection write/read
This commit is contained in:
@@ -5497,6 +5497,18 @@ static void direct_link_view_settings(FileData *fd, ColorManagedViewSettings *vi
|
||||
direct_link_curvemapping(fd, view_settings->curve_mapping);
|
||||
}
|
||||
|
||||
/* recursively direct link the layer collections */
|
||||
static void direct_link_layer_collections(FileData *fd , ListBase *lb)
|
||||
{
|
||||
link_list(fd, lb);
|
||||
|
||||
for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
|
||||
link_list(fd, &(lc->elements));
|
||||
link_list(fd, &(lc->overrides));
|
||||
direct_link_layer_collections(fd, &lc->collections);
|
||||
}
|
||||
}
|
||||
|
||||
static void direct_link_scene(FileData *fd, Scene *sce)
|
||||
{
|
||||
Editing *ed;
|
||||
@@ -5744,12 +5756,9 @@ static void direct_link_scene(FileData *fd, Scene *sce)
|
||||
sl->obedit = NULL;
|
||||
link_list(fd, &(sl->base));
|
||||
sl->basact = newdataadr(fd, sl->basact);
|
||||
link_list(fd, &(sl->collections));
|
||||
|
||||
for (LayerCollection *lc = sl->collections.first; lc; lc = lc->next) {
|
||||
link_list(fd, &(lc->elements));
|
||||
link_list(fd, &(lc->overrides));
|
||||
}
|
||||
/* recursively direct link the layer collections */
|
||||
direct_link_layer_collections(fd, &(sl->collections));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2401,13 +2401,30 @@ static void write_paint(WriteData *wd, Paint *p)
|
||||
}
|
||||
}
|
||||
|
||||
/* recursively write the layer collections structs */
|
||||
static void write_layer_collections(WriteData *wd, ListBase *lb)
|
||||
{
|
||||
for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
|
||||
writestruct(wd, DATA, LayerCollection, 1, lc);
|
||||
|
||||
for (LinkData *link = lc->elements.first; link; link = link->next) {
|
||||
writestruct(wd, DATA, LinkData, 1, link);
|
||||
}
|
||||
|
||||
for (CollectionOverride *ov = lc->overrides.first; ov; ov = ov->next) {
|
||||
writestruct(wd, DATA, CollectionOverride, 1, ov);
|
||||
}
|
||||
|
||||
write_layer_collections(wd, &(lc->collections));
|
||||
}
|
||||
}
|
||||
|
||||
static void write_scenes(WriteData *wd, ListBase *scebase)
|
||||
{
|
||||
Scene *sce;
|
||||
Base *base;
|
||||
Editing *ed;
|
||||
Sequence *seq;
|
||||
LayerCollection *lc;
|
||||
MetaStack *ms;
|
||||
Strip *strip;
|
||||
TimeMarker *marker;
|
||||
@@ -2597,17 +2614,8 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
|
||||
base = base->next;
|
||||
}
|
||||
|
||||
for (lc = sl->collections.first; lc; lc = lc->next) {
|
||||
writestruct(wd, DATA, LayerCollection, 1, lc);
|
||||
|
||||
for (LinkData *link = lc->elements.first; link; link = link->next) {
|
||||
writestruct(wd, DATA, LinkData, 1, link);
|
||||
}
|
||||
|
||||
for (CollectionOverride *ov = lc->overrides.first; ov; ov = ov->next) {
|
||||
writestruct(wd, DATA, CollectionOverride, 1, ov);
|
||||
}
|
||||
}
|
||||
/* recursively write the layer collections structs */
|
||||
write_layer_collections(wd, &sl->collections);
|
||||
}
|
||||
|
||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
||||
|
Reference in New Issue
Block a user