节点组

../../../_images/interface_controls_nodes_groups_example.png

节点组示例。

Grouping nodes can simplify a node tree by allowing instancing and hiding parts of the tree.

Conceptually, grouping nodes allows you to specify a set of nodes that you can treat as though it were "just one node". Node groups are similar to functions in programming, they can be reused in many places in a node tree and can be customized by changing the "parameters" of the node group.

As an example: If you have created a material that you would like to use with different inputs e.g. diffuse color: red plastic, green plastic. You could create different materials with Make Single User for each different color with a copy of the tree part describing the plastic material. If you like to edit the material you would need to redo the edit on all materials. A better method of reuse is to create node groups, exposing only the variable inputs (e.g. diffuse color).

Also nested node groups are supported. I.e. a node group can be inserted or created inside another node group.

Note

所有节点系统都禁止递归节点组以防止无限递归。节点组永远不能包含自身。

界面

当一个节点组被创建时,新的 组输入组输出 节点被生成,以表示进入和离开该组的数据流。此外,来自未选择的节点的输入套接字的连接将被连接到 组输入 节点上的新套接字。同样地,来自未被选中的节点的输入套接字的出站连接将被连接到新的 组输出 节点。

If you want to pass an additional parameter into the group, a socket must be added to the Group Input node. Therefore drag a connection from the hollow socket on the right side of the Group Input node to the desired input socket on the node requiring an input. The process is similar for the Group Output regarding data you want to be made available outside the group.

面板

参考

模式

所有模式

面板

Sidebar ‣ Group ‣ Interface

../../../_images/interface_controls_nodes_groups_interface-panel.png

用于编辑节点组的界面。

Sockets can be added, re-ordered, or removed, descriptive names can be added and the details of the input data value defined here.

If you have multiple inputs or outputs, they can be re-ordered by selecting the socket in the list. And then moving them up or down with the arrow buttons on the right side of the panel. The plus button will add an unconnected socket of the same type as the selected socket or a value socket if there is no selection. The minus button will remove the selected socket. The triangle at the bottom of the list has filtering functions to help finding nodes if the group has a large number of sockets.

名称

要在节点的界面上显示的套接字的名称。

提示

The message displayed when hovering over socket properties. Currently only supported for Geometry Node Editor

默认

The value to use when nothing is connected to the node socket. Note, this will not affect the current node but will affect instances of the node.

最小值,最大值

The minimum and maximum value for the UI button shown in the node interface. Note, this is not a minimum or maximum for the data that can pass through the node. If a socket passes a higher value than the maximum it will still pass into the node unchanged.

隐藏值

即使插口没有连接,也会隐藏插口的值。

编辑节点组

参考

模式

所有模式

菜单

节点 ‣ 编辑组

标题栏

进入父级节点树

快捷键

Tab, Ctrl-Tab

With a node group selected, Tab expands the node to a frame, and the individual nodes within it are shown. You can move them around, play with their individual controls, re-thread them internally, etc. just like you can if they were a normal part of the editor view. You will not be able, though, to thread them to a node outside the group; you have to use the external sockets on the side of the node group. While Tab can be used to both enter and exit a group, Ctrl-Tab only exits.

../../../_images/render_cycles_optimizations_reducing-noise_glass-group.png

展开后的节点组示例。

制作节点组

参考

模式

所有模式

菜单

节点 ‣ 创建组

快捷键

Ctrl-G

To create a node group, select the nodes you want to include, then press Ctrl-G, Group ‣ Make Group. A node group will have a green title bar. All selected nodes will now be contained within the node group. Default naming for the node group is "NodeGroup", "NodeGroup.001" etc. There is a name field in the node group you can click into to change the name of the group. Change the name of the node group to something meaningful.

创建节点组的方法如下:选择要包含的节点,然后按 Ctrl-G组 ‣ 创建组 。节点组将具有绿色标题栏。而所有选定的节点都将包含在该节点组中。节点组的默认名称为 NodeGroup , NodeGroup.001 等。节点组的名称可以通过点击进行更改。尽量将节点组的名称更改为有意义的名称。将节点组从一个blender文件附加到另一个blender文件时,blender不会区分材料节点组或复合节点组,因此建议使用一些命名约定,以便可以轻松区分这两种类型。

Tip

What not to include in node groups:

Remember that the essential idea is that a group should be a reusable, self-contained software component. Material node groups should not include:

Input nodes

If you include a source node in your group, you will end up having the source node appearing twice: once inside the group, and once outside the group in the new material node tree.

Output node

If you include an output node in the group, there will not be an output socket available from the group!

拆散

参考

模式

所有模式

菜单

节点 ‣ 取消编组

快捷键

Ctrl-Alt-G

The Ctrl-Alt-G tool removes the group and places the individual nodes into your editor workspace. No internal connections are lost, and now you can link internal nodes to other nodes in your workspace.

分离 P

将所选节点与节点组分开。

复制

复制到父级节点树,并保持节点组完好。

移动

从组中删除,移动至父级节点树。

插入节点组

参考

模式

所有模式

菜单

节点 ‣ 插入节点组

选择一组节点,以目标组节点为结尾,按 节点 ‣ 插入组 将把这些节点移入该组。被移动的节点被收集到他们自己的组中,以保留他们的连接环境,有他们自己的组输入和输出节点。该组现有的输入和输出节点被更新为新的插座,如果有的话,来自新的节点。节点组必须被编辑为包含一个 组输入 和一个 组输出 节点。

Appending Node Groups

参考

编辑器

顶部标题栏

模式

所有模式

菜单

File ‣ Link/Append

Once you have appended a Node Tree to your blend-file, you can make use of it in a node editor by pressing Shift-A, Add ‣ Group, then selecting the appended group. The "control panel" of the Group include the individual controls for the grouped nodes. You can change them by working with the Group node like any other node.