UI: Nodes: gray out sockets in non-editable linked node trees

The goal is to make it more obvious when a node tree is linked (or packed in the future).

Pull Request: https://projects.blender.org/blender/blender/pulls/145387
This commit is contained in:
Jacques Lucke
2025-09-01 22:20:33 +02:00
parent 38cb4ba232
commit 16a9bb1be7

View File

@@ -442,6 +442,9 @@ static bool node_update_basis_buttons(const bContext &C,
if (node.is_muted()) {
layout.active_set(false);
}
if (!ID_IS_EDITABLE(&ntree.id)) {
layout.enabled_set(false);
}
layout.context_ptr_set("node", &nodeptr);
@@ -524,6 +527,9 @@ static bool node_update_basis_socket(const bContext &C,
if (node.is_muted()) {
layout.active_set(false);
}
if (!ID_IS_EDITABLE(&ntree.id)) {
layout.enabled_set(false);
}
uiLayout *row = &layout.row(true);
PointerRNA nodeptr = RNA_pointer_create_discrete(&ntree.id, &RNA_Node, &node);
@@ -1156,6 +1162,9 @@ static void node_update_basis_from_declaration(
if (node.is_muted()) {
layout.active_set(false);
}
if (!ID_IS_EDITABLE(&ntree.id)) {
layout.enabled_set(false);
}
PointerRNA node_ptr = RNA_pointer_create_discrete(&ntree.id, &RNA_Node, &node);
layout.context_ptr_set("node", &node_ptr);
decl.draw(&layout, const_cast<bContext *>(&C), &node_ptr);