Cleanup: replace tree type by tree_idname

Pull Request: https://projects.blender.org/blender/blender/pulls/139018
This commit is contained in:
Habib Gahbiche
2025-05-17 13:25:59 +02:00
parent 45eb746250
commit 4b207be8f9

View File

@@ -696,8 +696,11 @@ void NODE_OT_add_collection(wmOperatorType *ot)
static bool node_add_image_poll(bContext *C)
{
const SpaceNode *snode = CTX_wm_space_node(C);
return ED_operator_node_editable(C) &&
ELEM(snode->nodetree->type, NTREE_SHADER, NTREE_TEXTURE, NTREE_COMPOSIT, NTREE_GEOMETRY);
return ED_operator_node_editable(C) && STR_ELEM(snode->tree_idname,
"ShaderNodeTree",
"CompositorNodeTree",
"TextureNodeTree",
"GeometryNodeTree");
}
/** Node stack animation data, sorts nodes so each node is placed on top of each other. */