Node panels: Enable new node group interfaces #1

Closed
Lukas Tönne wants to merge 14 commits from node-panels-final into node-panels-rna

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 9 additions and 0 deletions
Showing only changes of commit 2cb1aa06ee - Show all commits

View File

@ -145,6 +145,7 @@ static void node_socket_interface_free(bNodeTree * /*ntree*/,
static void ntree_init_data(ID *id) static void ntree_init_data(ID *id)
{ {
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id); bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
ntree->tree_interface.init_data();
ntree->runtime = MEM_new<bNodeTreeRuntime>(__func__); ntree->runtime = MEM_new<bNodeTreeRuntime>(__func__);
ntree_set_typeinfo(ntree, nullptr); ntree_set_typeinfo(ntree, nullptr);
} }

View File

@ -1086,6 +1086,12 @@ void bNodeTreeInterfacePanel::copy_from(
} }
} }
void bNodeTreeInterface::init_data()
{
/* Root panel is allowed to contain child panels. */
root_panel.flag |= NODE_INTERFACE_PANEL_ALLOW_CHILD_PANELS;
}
void bNodeTreeInterface::copy_data(const bNodeTreeInterface &src, int flag) void bNodeTreeInterface::copy_data(const bNodeTreeInterface &src, int flag)
{ {
this->root_panel.copy_from(src.root_panel.items(), flag); this->root_panel.copy_from(src.root_panel.items(), flag);

View File

@ -212,6 +212,8 @@ typedef struct bNodeTreeInterface {
#ifdef __cplusplus #ifdef __cplusplus
/** Initialize data of new interface instance. */
void init_data();
/** Copy data from another interface. /** Copy data from another interface.
* \param flag: ID creation/copying flags, e.g. LIB_ID_CREATE_NO_MAIN. * \param flag: ID creation/copying flags, e.g. LIB_ID_CREATE_NO_MAIN.
*/ */