Nodes: Panel declarations for grouping sockets #108649

Merged
Lukas Tönne merged 27 commits from LukasTonne/blender:node-socket-categories into main 2023-06-14 18:02:46 +02:00
2 changed files with 3 additions and 6 deletions
Showing only changes of commit d7aa257d2d - Show all commits

View File

@ -269,7 +269,7 @@ class NODE_OT_socket_category_add(NodeSocketCategoryOperator, Operator):
tree = snode.edit_tree
categories = tree.socket_categories
# Remember index to move the item
# Remember index to move the item.
LukasTonne marked this conversation as resolved Outdated

Period at the end of the comment.

Period at the end of the comment.
dst_index = min(categories.active_index + 1, len(categories))
categories.new("Category")
categories.move(len(categories) - 1, dst_index)

View File

@ -542,10 +542,7 @@ void ntreeBlendWrite(struct BlendWriter *writer, struct bNodeTree *ntree);
/** \name Node Tree Interface
* \{ */
/**
* Run this after relevant changes to categories
* to ensure sockets remain sorted by category.
*/
/** Run this after relevant changes to categories to ensure sockets remain sorted by category. */
void ntreeEnsureSocketCategoryOrder(bNodeTree *ntree);
LukasTonne marked this conversation as resolved Outdated

This comment fits on one line

This comment fits on one line
Review

This is currently in the public API because the NODE_OT_tree_socket_move operator works directly on DNA and needs to call this after it moves sockets. That operator should also use an API method so the update function does not need to be exposed. I suggest a separate fix.

This is currently in the public API because the `NODE_OT_tree_socket_move` operator works directly on DNA and needs to call this after it moves sockets. That operator should also use an API method so the update function does not need to be exposed. I suggest a separate fix.
void ntreeRemoveSocketInterface(bNodeTree *ntree, bNodeSocket *sock);
@ -598,7 +595,7 @@ void ntreeClearSocketCategories(bNodeTree *ntree);
/**
* Move a socket category up or down in the node tree.
* \param index Index to which to move the category.
* \param index: Index to which to move the category.
*/
void ntreeMoveSocketCategory(bNodeTree *ntree, bNodeSocketCategory *category, int new_index);