Fix: GPv3: Assert in LayerTreeView::build_tree()
This was caused by 745fd2a2cb.
The issue was that there was an attempt at calling
`uncollapse_by_default` on a `LayerViewItem`
which can't be collapsed (because it can't have any children).
This then triggered the assert.
The fix removes the call to `uncollapse_by_default` for
`LayerViewItem`.
This commit is contained in:
@@ -178,6 +178,8 @@ class LayerViewItem : public AbstractTreeViewItem {
|
||||
|
||||
bool supports_collapsing() const override
|
||||
{
|
||||
/* This is a bit redundant since `LayerViewItem` can't have children. But being expplicit might
|
||||
* catch errors. */
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -392,9 +394,7 @@ void LayerTreeView::build_tree_node_recursive(TreeViewOrItem &parent, TreeNode &
|
||||
{
|
||||
using namespace blender::bke::greasepencil;
|
||||
if (node.is_layer()) {
|
||||
LayerViewItem &item = parent.add_tree_item<LayerViewItem>(this->grease_pencil_,
|
||||
node.as_layer());
|
||||
item.uncollapse_by_default();
|
||||
parent.add_tree_item<LayerViewItem>(this->grease_pencil_, node.as_layer());
|
||||
}
|
||||
else if (node.is_group()) {
|
||||
LayerGroupViewItem &group_item = parent.add_tree_item<LayerGroupViewItem>(this->grease_pencil_,
|
||||
|
||||
Reference in New Issue
Block a user