Geometry Nodes: Rename "Operator" context to "Tool"

"Tool" is a more friendly word with mostly the same meaning within
Blender. Eventually it should be possible to create active tools with
node groups anyway, so the distinction isn't even helpful.

See #101778
This commit is contained in:
Hans Goudey 2023-08-03 10:50:54 -04:00
parent 4718c084e6
commit 733f90bd24
5 changed files with 7 additions and 7 deletions

@ -244,7 +244,7 @@ class NewGeometryNodeTreeAssign(Operator):
def execute(self, context):
space = context.space_data
if space and space.type == 'NODE_EDITOR' and space.geometry_nodes_type == 'OPERATOR':
if space and space.type == 'NODE_EDITOR' and space.geometry_nodes_type == 'TOOL':
group = geometry_node_group_empty_new()
space.node_tree = group
return {'FINISHED'}

@ -128,7 +128,7 @@ static void get_context_path_node_geometry(const bContext &C,
SpaceNode &snode,
Vector<ui::ContextPathItem> &path)
{
if (snode.flag & SNODE_PIN || snode.geometry_nodes_type == SNODE_GEOMETRY_OPERATOR) {
if (snode.flag & SNODE_PIN || snode.geometry_nodes_type == SNODE_GEOMETRY_TOOL) {
context_path_add_node_tree_and_node_groups(snode, path);
}
else {

@ -1670,7 +1670,7 @@ typedef enum eSpaceNode_ShaderFrom {
/** #SpaceNode.geometry_nodes_type */
typedef enum SpaceNodeGeometryNodesType {
SNODE_GEOMETRY_MODIFIER = 0,
SNODE_GEOMETRY_OPERATOR = 1,
SNODE_GEOMETRY_TOOL = 1,
} SpaceNodeGeometryNodesType;
/** #SpaceNode.insert_ofs_dir */

@ -7458,10 +7458,10 @@ static void rna_def_space_node(BlenderRNA *brna)
0,
"Modifier",
"Edit node group from active object's active modifier"},
{SNODE_GEOMETRY_OPERATOR,
"OPERATOR",
{SNODE_GEOMETRY_TOOL,
"TOOL",
0,
"Operator",
"Tool",
"Edit any geometry node group for use as an operator"},
{0, nullptr, 0, nullptr, nullptr},
};

@ -34,7 +34,7 @@ static void geometry_node_tree_get_from_context(
const bContext *C, bNodeTreeType * /*treetype*/, bNodeTree **r_ntree, ID **r_id, ID **r_from)
{
const SpaceNode *snode = CTX_wm_space_node(C);
if (snode->geometry_nodes_type == SNODE_GEOMETRY_OPERATOR) {
if (snode->geometry_nodes_type == SNODE_GEOMETRY_TOOL) {
*r_ntree = snode->nodetree;
return;
}