Fix: copying panels in regions did not handle runtime data
Caused by 663aa353.
This commit is contained in:
@@ -315,16 +315,14 @@ void BKE_spacedata_freelist(ListBase *lb)
|
|||||||
static void panel_list_copy(ListBase *newlb, const ListBase *lb)
|
static void panel_list_copy(ListBase *newlb, const ListBase *lb)
|
||||||
{
|
{
|
||||||
BLI_listbase_clear(newlb);
|
BLI_listbase_clear(newlb);
|
||||||
BLI_duplicatelist(newlb, lb);
|
|
||||||
|
|
||||||
/* copy panel pointers */
|
LISTBASE_FOREACH (const Panel *, old_panel, lb) {
|
||||||
Panel *new_panel = static_cast<Panel *>(newlb->first);
|
Panel *new_panel = BKE_panel_new(old_panel->type);
|
||||||
Panel *panel = static_cast<Panel *>(lb->first);
|
*new_panel = *old_panel;
|
||||||
for (; new_panel; new_panel = new_panel->next, panel = panel->next) {
|
|
||||||
new_panel->activedata = nullptr;
|
new_panel->activedata = nullptr;
|
||||||
new_panel->drawname = nullptr;
|
new_panel->drawname = nullptr;
|
||||||
memset(&new_panel->runtime, 0x0, sizeof(new_panel->runtime));
|
BLI_addtail(newlb, new_panel);
|
||||||
panel_list_copy(&new_panel->children, &panel->children);
|
panel_list_copy(&new_panel->children, &old_panel->children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,6 +360,9 @@ ARegion *BKE_area_region_copy(const SpaceType *st, const ARegion *region)
|
|||||||
}
|
}
|
||||||
|
|
||||||
panel_list_copy(&newar->panels, ®ion->panels);
|
panel_list_copy(&newar->panels, ®ion->panels);
|
||||||
|
LISTBASE_FOREACH (Panel *, p, &newar->panels) {
|
||||||
|
BLI_assert(p->runtime);
|
||||||
|
}
|
||||||
|
|
||||||
BLI_listbase_clear(&newar->ui_previews);
|
BLI_listbase_clear(&newar->ui_previews);
|
||||||
BLI_duplicatelist(&newar->ui_previews, ®ion->ui_previews);
|
BLI_duplicatelist(&newar->ui_previews, ®ion->ui_previews);
|
||||||
|
|||||||
Reference in New Issue
Block a user