节点组
节点组示例。
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.
例如:如果你创建了一个想要使用不同输入的材质(例如:漫反射颜色,红色塑料和绿色塑料)。你可以对不同材质进行单独处理。但如果你想编辑材料属性,则需要重新编辑所有材料。而使用节点组,仅需要改变变量输入即可(例如,漫反射颜色)。
节点组还支持嵌套。也就是说可以在一个节点组中插入或创建另一个节点组。
Note
所有节点系统都禁止递归节点组以防止无限递归。节点组永远不能包含自身。
界面
When a node group is created, new Group Input and Group Output nodes are generated to represent the data flow into and out of the group. Furthermore connections to input sockets coming from unselected nodes will become attached to new sockets on the Group Input node. Similarly, outgoing connections to input sockets of unselected nodes will become attached to the new Group Output node.
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 ‣ Inputs, Sidebar ‣ Group ‣ Outputs
用于编辑节点组的界面。
可以添加,重新排序或删除接口,可以添加描述性名称以及此处定义的输入数据值的详细信息。
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 name of the socket to display in the node’s interface.
提示
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.
隐藏值
Hide the socket value even when the socket is not connected.
编辑节点组
参考
菜单
节点 ‣ 编辑组
标题栏
进入父级节点树
快捷键
Tab, Ctrl-Tab
选择节点组后, Tab 键可以将节点扩展为一个框,并显示其中的各个节点。可以把这些节点当作编辑器视图的其他正常节点一样,移动节点,修改控制选项,重新梳理其中的节点等。但是,你无法将它们连接到组外的节点;你必须使用节点组一侧的外部接口。Tab 可用于进入和退出节点组,但 Ctrl-Tab 只能退出节点组。
展开后的节点组示例。
制作节点组
参考
菜单
节点 ‣ 创建组
快捷键
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.
When appending node groups from one blend-file to another, Blender does not make a distinction between material node groups or composite node groups. So it is recommended to use some naming convention that will allow you to distinguish between the two types.
Tip
不能 用于节点组的节点:
Remember that the essential idea is that a group should be a reusable, self-contained software component. Material node groups should not include:
输入节点
如果在组中包含源节点,则最终会使源节点出现 两次 :一次出现在组内,一次出现在新材质节点树中的组外。
输出节点
如果在组中包含输出节点,那么,该组就 不会 有输出接口!
拆散
参考
菜单
Node ‣ Ungroup
快捷键
Ctrl-Alt-G
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
将所选节点与节点组分开。
复制
复制到父级节点树,并保持节点组完好。
移动
从组中删除,移动至父级节点树。
插入节点组
参考
菜单
Node ‣ Group Insert
Selecting a set of nodes, ending with the destination group node, and pressing Node ‣ Group Insert will move those nodes into that group. The moved nodes are collected into a group of their own to preserve their connection context, having their own group input and output nodes. The group’s existing input and output nodes are updated with new sockets, if any, from the new nodes. The node group must be edited to contain a single Group Input and a single Group Output node.
添加节点组
参考
编辑器
顶部标题栏
菜单
文件 ‣ 并联 / 追加
将节点树添加到blender文件后,可以通过按 Shift-A, Add ‣ Group 来选择附加组,并在节点编辑器中使用它。该组的 “控制面板” 包括各个分组的节点控件。你可以像处理任何其他节点一样使用组节点来更改它们。