属性#

属性 是一个通用术语,用来描述几何数据块中每个元素所存储的数据。例如,每个顶点都可以有一个相关的数字或矢量。属性可以通过连接一个值到 组输出 节点来改变,但也有许多节点可以改变特定属性的值。

Note

属性数据类型和域在可能的情况下被隐式转换,就像节点接口一样。

已命名属性#

Named attributes are created and used in other areas of Blender like shaders, painting, and UV mapping. In the modifier panel, a named attribute can be used for input by clicking the icon to the right of the value button. The string input input allows you to search and choose existing attributes from the modifier's input geometry.

../../_images/modeling_geometry-nodes_attribute-reference_search.png

属性查找。#

属性搜索为每个属性提供了一些上下文。菜单左侧显示属性域,然后显示属性名称。菜单右侧显示属性数据类型。

匿名属性#

../../_images/modeling_geometry-nodes_attribute-reference_attribute-field.png

法线旋转 输出是属性字段的示例,它们指的是存储在几何体上的属性。#

匿名属性是存储在没有名称的几何体上的一组通用数据。通常,在Blender界面中公开的属性都具有名称。然而,在几何节点中,属性可以通过节点接口传递。在这些情况下,将创建 属性场 输出,节点使用该输出查找输入几何体中的属性数据。

Anonymous attributes are still stored on the geometry like other attributes, and they are even automatically interpolated when the geometry changes with other nodes, except for a few cases. So generally, if the node link is still accessible, the attribute it references will be available too. However, anonymous attributes cannot be connected to a completely separate geometry that was created from a different source. To transfer attributes between separate geometries, the 采样编号 or other similar nodes like the 采样最近的表面 can be used.

属性数据类型#

属性的类型是指存储在每个元素的数据种类。

布尔:

真或假的值。

整数:

32位整数。

8位整数:

较小的整数,范围从-128到127。

浮点:

浮点数值。

矢量:

以浮点数值表示的三维矢量。

二维矢量:

以浮点数值表示的二维矢量。

颜色:

32位浮点精度的RGBA颜色。

字节颜色:

8位精度整数值的RGBA颜色。

四元数:

浮点 四元数 旋转。

上面的列表是按照最不复杂到最 "复杂" 的顺序排列的(一个整数可以比布尔值包含更多的数据,所以它更复杂)。当把独立的几何体连接在一起时,当有匹配的名称时,更复杂的数据类型是首选。当用 合并几何 连接具有命名属性的几何体时,这一点特别重要。

To store 2D Vectors (UV maps) and Byte Colors the 存储已命名属性 must be used because there are no sockets for those types.

数据转换#

通过使用几何节点,数据可以在不同类型之间进行转换。

有效转换:

  • 在颜色和矢量之间 -- 在颜色通道和矢量属性间映射。

  • 在颜色和浮点之间 -- 颜色数据被转换为等价的灰度。

  • 在浮点和整数之间 -- 整数简单转为浮点数,浮点数截短为整数。

  • 在浮点和矢量之间 -- 当浮点数转为矢量时,数值用于每个分量。当矢量转为浮点数时,取其分量的平均值。

  • 在浮点和布尔之间 -- 值大于0为真(ture),真映射为1,假(false)映射为0。

属性域#

一个属性的域指的是该属性对应的几何元素的类型。知道一个属性的域是很重要的,因为它定义了它如何在节点和阴影中插值和使用。你可以使用 电子表格编辑器 来确定属性的域。

  • 域属性与空间中的单个位置相关联:

    • 网格的顶点

    • 点云的点

    • 曲线控制点

  • 边缘 域属性是与网格的边缘相关的。

  • 域属性是与网格的面相关的。

  • 面拐角 域属性是与网格的面角相关的。一个例子是UV贴图属性。

  • 样条 域属性与一组相连的曲线控制点相关。

  • 实例 域属性存在于几何体中的 实例项 。它们可以用来在几何体数据的副本上存储不同的值。实例域属性只在几何体节点中被支持。

Attributes are automatically interpolated to other domains. For example, when the 位置节点 is connected to the selection input of the 设置材质 node, the values are interpolated from the Point domain to the Face domain. Normally, domain conversions use simple averages for values, but Boolean data type attributes have special rules for interpolation:

布尔域插值#

来自

转换

如果选择了边缘的两个顶点,则会选择边缘。

如果选择了面上的所有顶点,则会选择面。

拐角

每个角的值只是其顶点处的值的副本。

样条线

如果选择了样条所有控制点,则会选择样条。

如果选择了任何连接的边缘,则选择一个顶点。

如果选择了面部的所有边缘,则选择面部

拐角

如果选择了角的两个相邻边缘,则选择一个角。

如果选择了任何连接面,则选择顶点。

如果选择了任何连接的面,则选择边缘。

拐角

每个角落的价值只是其面部价值的副本。

拐角

如果选择了所有连接的面角,并且它不是松散的顶点,则选择一个顶点。

拐角

如果选择了相邻面上的所有角,则会选择边缘。

拐角

如果选择了面的所有角,则选择面。

样条线

每个点的值只是样条对应值的副本。

内置属性#

内置属性始终存在,无法删除。无法更改其数据类型和域。

名称

类型

注意

位置

矢量

Built-in attribute describing vertex or point locations, in the local space of a geometry. Any node that changes the location of points will adjust this attribute, like the 变换几何体 and the 设置位置.

半径

浮点数

用于设置视口中点大小的点云上的内置属性。内置在曲线上,其中它控制转换为网格时每个曲线控制点的大小,或其他操作。

id

整数

分布点于面上 创建,以便在输入网格的形状发生变化时提供稳定性,并在实例上用于创建运动模糊。值应为大值,无订单。此属性由生成随机性的节点使用,例如 随机值 。与其他内置属性不同,此属性不是必需的,可以删除。

material_index

整数

用于为网格中的每个面指定材质槽。

crease

浮点数

Edge attribute used by the Subdivision Surface modifier. The values are limited to a range of 0 and 1.

sharp_edge

布尔

Attribute determining if an edge should have flat (rather than smooth) shading enabled in the viewport or a render.

sharp_face

布尔

Attribute determining if a face should have flat (rather than smooth) shading enabled in the viewport or a render.

分辨率

整数

样条线

确定样条线的两个控制点之间的计算点数。只有NURBS和Bézier样条具有此属性,对于聚样条,值始终是一个。

循环

布尔

样条线

确定样条是否具有连接其第一个和最后一个控制点的段。

handle_left

矢量

描述曲线控制点的左手柄在曲线起始侧的位置。仅当曲线包含Bézier样条时才存在。

handle_right

矢量

描述曲线控制点的右手柄在曲线端侧的位置。仅当曲线包含Bézier样条时才存在。

命名惯例#

默认情况下不存在这些属性,但Blender的某些部分隐含使用这些属性。这些属性的数据类型可以更改,就像内置属性之外的任何属性一样。但是, Blender可能期望这些属性具有某种类型。

名称

类型

注意

velocity

矢量

用于在渲染动画时创建运动模糊。

rest_position

矢量

Holds the position of points or vertices from before a geometry is deformed procedurally. Can be created automatically before Shape Keys and Modifiers are evaluated with the Add Rest Position option.

surface_uv_coordinate

二维矢量

Used to describe curve attachment locations on a mesh surface, typically used for hair use cases.

sculpt_face_set

整数

Used by the Sculpt Face Sets Feature.

sculpt_mask

浮点数

Used by the Sculpt Masking Feature.

自定义属性#

顶点组、UV贴图和颜色属性可用作几何节点中的属性。他们被称为他们的名字。应避免命名碰撞(例如,具有相同名称的顶点组和UV地图)。如果存在命名冲突,则在几何节点中只能访问其中一个属性。

首次使用名称时,节点也可以创建具有任何其他名称的属性。

请注意,如果使用像 合并几何 这样的节点,几何节点并不总是产生诸如顶点组。同样,如果顶点组属性的数据类型从最初的 "浮点" 类型改变,该属性将不再是一个顶点组。

属性转换运算符#

../../_images/modeling_geometry-nodes_attribute-reference_convert.png

在属性编辑器的 属性 面板中找到的此运算符可以更改属性的域或数据类型。

Due to ongoing development in the area of attributes, many areas of Blender can not yet work with the generic (identified with a name, stored on any domain with any data type) attributes used by geometry nodes. That makes this operator an essential workaround in some cases where existing tools must be used with data generated from geometry nodes.

模式
泛型:

插入并转换此页面上描述的域和数据类型之间的属性。

顶点组:

更多信息见 顶点组

Note

此运算符仅适用于 原始 物体数据,不包括修改器的结果,因此几何节点添加或更改的任何属性都不会受到影响。要更改在程序上生成的属性的类型,必须应用修改器。