UI: Asset Shelf (Experimental Feature) #104831
|
@ -27,6 +27,7 @@ AssetShelfHook *ED_asset_shelf_hook_duplicate(const AssetShelfHook *hook)
|
|||
LISTBASE_FOREACH (const AssetShelf *, shelf, &hook->shelves) {
|
||||
AssetShelf *new_shelf = MEM_new<AssetShelf>("duplicate asset shelf",
|
||||
blender::dna::shallow_copy(*shelf));
|
||||
new_shelf->settings = shelf->settings;
|
||||
BLI_addtail(&new_hook->shelves, new_shelf);
|
||||
if (hook->active_shelf == shelf) {
|
||||
new_hook->active_shelf = new_shelf;
|
||||
|
|
|
@ -29,17 +29,25 @@ AssetShelfSettings::AssetShelfSettings()
|
|||
}
|
||||
|
||||
AssetShelfSettings::AssetShelfSettings(const AssetShelfSettings &other)
|
||||
{
|
||||
operator=(other);
|
||||
}
|
||||
|
||||
AssetShelfSettings &AssetShelfSettings::operator=(const AssetShelfSettings &other)
|
||||
{
|
||||
/* Start with a shallow copy. */
|
||||
memcpy(this, &other, sizeof(AssetShelfSettings));
|
||||
|
||||
next = prev = nullptr;
|
||||
|
||||
active_catalog_path = BLI_strdup(other.active_catalog_path);
|
||||
JulianEisel marked this conversation as resolved
Outdated
|
||||
BLI_listbase_clear(&enabled_catalog_paths);
|
||||
|
||||
LISTBASE_FOREACH (LinkData *, catalog_path_item, &other.enabled_catalog_paths) {
|
||||
LinkData *new_path_item = static_cast<LinkData *>(MEM_dupallocN(catalog_path_item));
|
||||
new_path_item->data = BLI_strdup((char *)catalog_path_item->data);
|
||||
LinkData *new_path_item = BLI_genericNodeN(BLI_strdup((char *)catalog_path_item->data));
|
||||
BLI_addtail(&enabled_catalog_paths, new_path_item);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
AssetShelfSettings::~AssetShelfSettings()
|
||||
|
|
|
@ -775,6 +775,7 @@ typedef struct AssetShelfSettings {
|
|||
AssetShelfSettings();
|
||||
/* Proper deep copy. */
|
||||
AssetShelfSettings(const AssetShelfSettings &other);
|
||||
AssetShelfSettings &operator=(const AssetShelfSettings &other);
|
||||
~AssetShelfSettings();
|
||||
#endif
|
||||
} AssetShelfSettings;
|
||||
|
|
Loading…
Reference in New Issue
This can be null (noted in doc-string), crashes when duplicating an empty 3D view.