diff --git a/source/blender/makesdna/DNA_node_tree_interface_types.h b/source/blender/makesdna/DNA_node_tree_interface_types.h index d928b568686..57aae560cf8 100644 --- a/source/blender/makesdna/DNA_node_tree_interface_types.h +++ b/source/blender/makesdna/DNA_node_tree_interface_types.h @@ -246,10 +246,7 @@ typedef struct bNodeTreeInterface { /* const_cast to avoid a const version of #find_parent_recursive. */ const bNodeTreeInterfacePanel *parent = const_cast(root_panel).find_parent_recursive(item); - if (parent == nullptr || parent == &root_panel) { - /* Panel is the root panel. */ - return 0; - } + BLI_assert(parent != nullptr); return parent->item_position(item); } /** @@ -277,19 +274,11 @@ typedef struct bNodeTreeInterface { } /** * Find the panel containing the item. - * \param include_root: Allow #root_panel as a return value, - * otherwise return nullptr for root items. * \return Parent panel containing the item. */ - bNodeTreeInterfacePanel *find_item_parent(const bNodeTreeInterfaceItem &item, - bool include_root = false) + bNodeTreeInterfacePanel *find_item_parent(const bNodeTreeInterfaceItem &item) { - bNodeTreeInterfacePanel *parent = root_panel.find_parent_recursive(item); - /* Return nullptr instead the root panel. */ - if (!include_root && parent == &root_panel) { - return nullptr; - } - return parent; + return root_panel.find_parent_recursive(item); } /** diff --git a/source/blender/makesrna/intern/rna_node_tree_interface.cc b/source/blender/makesrna/intern/rna_node_tree_interface.cc index bce6cc8ae99..f62f8f3153c 100644 --- a/source/blender/makesrna/intern/rna_node_tree_interface.cc +++ b/source/blender/makesrna/intern/rna_node_tree_interface.cc @@ -850,7 +850,6 @@ static void rna_def_node_interface_item(BlenderRNA *brna) RNA_def_property_pointer_funcs( prop, "rna_NodeTreeInterfaceItem_parent_get", nullptr, nullptr, nullptr); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); RNA_def_property_ui_text(prop, "Parent", "Panel that contains the item"); prop = RNA_def_property(srna, "position", PROP_INT, PROP_NONE);