On this page 此页面上 |
Attributes 属性¶
Attributes are named values stored on vertices, points, primitives, and objects. Point color, position, UV coordinates , spline weight (), and normal, for example, are stored as point attributes.W
属性是存储在顶点、点、基本体和对象上的命名值。例如,点颜色、位置、UV 坐标 、样条线权重()和法线存储为点属性。W
-
Houdini sets some point attributes that you can use in expressions. For example, you could set the per-point color based on the vertical position () of the point.
PY
Houdini 设置了一些可以在表达式中使用的点属性。例如,可以根据点的垂直位置()设置逐点颜色。PY
-
You can set certain attributes manually, and if the attributes are present, they will be used by Houdini. For example, the dynamics solvers and rendering engines will often use certain attributes on the geometry if they exist.
您可以手动设置某些属性,如果属性存在,它们将被 Houdini 使用。例如,动力学解算器和渲染引擎通常会使用几何体上的某些属性(如果存在)。 -
You can also set your own custom attributes to be used by node expressions, scripts, exporters, etc.
您还可以设置自己的自定义属性,以供节点表达式、脚本、导出器等使用。
The surface nodes in the Attributes group of the tab menu set different types of attributes. You can also set or create arbitrary attributes using the Attribute SOP
选项卡菜单的“属性”(Attributes)组中的曲面节点设置不同类型的属性。还可以使用属性 SOP 设置或创建任意属性.
To see the attributes on a node’s geometry, click on the node in the network editor and choose Spreadsheet to open the geometry spreadsheet for the node.
要查看节点几何体的属性,请在网络编辑器中单击该节点,然后选择 “工作表 ” 以打开该节点的几何体电子表格 。
Geometry components 几何部件¶
You can create and set attributes using the generic Attribute Create surface node, or the Vertex, Point, and
Primitive nodes. You can attach attributes to vertices, points, and primitives (e.g. polygon faces), or the entire piece of geometry (called the detail level).
可以使用常规的“属性创建”(Attribute Create)曲面节点或“顶点”(Vertex)、“点”(Point)和“基本体”(Primitive)节点来创建和设定属性 。您可以将属性附加到顶点、点和基本体(例如多边形面)或整个几何体(称为细节级别)。
Attribute precedence 属性优先级¶
When two components in the same geometry have an attribute with the same name, the attribute on the “lower level” of geometry is used:
当同一几何体中的两个组件具有同名属性时,将使用几何体“较低级别”上的属性:
-
Vertex attributes override:
顶点属性覆盖:-
Point attributes, which override:
点属性,覆盖:-
Primitive attributes, which override:
基本属性,覆盖:-
Detail (whole geometry) attributes
细节 (整个几何体)属性
-
-
-
Applying nodes based on attribute values
基于属性值应用节点¶
Most surface nodes have a Group field that lets you enter a named group or pattern to select the components the node should apply to. This field recognizes special syntax that allow you to select components by the value of an attribute. For example, in a Point node’s Group field, selects all points whose attribute is greater than .@foo>5
foo
5
大多数曲面节点都有一个 “组”(Group) 字段,允许您输入命名组或阵列以选择节点应应用到的组件。此字段识别允许您按属性值选择组件的特殊语法。例如,在“ 点” 节点的“ 组” 字段中,选择属性大于的所有点。@foo>5
foo
5
See the section on manually specifying groups for more information.
有关详细信息,请参阅手动指定组一节。
Dictionary attributes 字典属性¶
Since Houdini 18.5, SOP geometry supports dictionary attributes, an attribute type where each element (point, vertex, primitive/face, or the whole geometry/detail) can store a set of key/value pairs. Dictionary attributes can be used to store:
从 Houdini 18.5 开始,SOP 几何支持字典属性,一种每个元素(点,顶点,基元/面,或整个几何/细节)都可以存储一组键/值对的属性类型。字典属性可用于存储:
-
Complex “blind” element data, such as game engine data, or data for a foreign geometry format that Houdini does not support natively.
复杂的“盲”元素数据,例如游戏引擎数据,或 Houdini 本机不支持的外国几何格式的数据。 -
Metadata about geometry on the detail (whole geometry).
有关详图上几何图形的元数据(整个几何图形)。 -
Parameter values of the node that creates different elements for debugging. You could even store a node network as geometry by representing nodes with points, and their wires and parameters in a dictionary point attribute. See the
Attribute From Parms SOP
创建用于调试的不同元素的节点的参数值。您甚至可以将节点网络存储为几何体,方法是用点表示节点,并在字典点属性中表示节点的关联和参数。参见参数 SOP 中的属性.
You can also create a dictionary array attribute, where the attribute value is an array of dictionaries, rather than a single dictionary.
还可以创建字典数组属性,其中属性值是字典数组 ,而不是单个字典。
Dictionary keys are strings. Dictionary values can be strings, numbers, arrays, or a (nested) dictionary. Dictionary attributes essentially have the same data model as JSON. In fact, UI such as the geometry spreadsheet displays the contents of a dictionary attribute like a JSON-encoded string.
字典键是字符串。字典值可以是字符串、数字、数组或(嵌套的)字典。 字典属性本质上具有与 JSON 相同的数据模型 。实际上,像几何图形电子表格这样的 UI 显示字典属性的内容,就像 JSON 编码的字符串一样。
Currently, support for dictionary attributes is mostly in Python, VEX, and VOPs. You can manipulate dictionary attributes on geometry using VEX snippets in Attribute Wrangle, or with a
Python SOP. There is also simple support for reading key values in parameter expressions.
目前,对字典属性的支持主要在 Python、VEX 和 VOP 中。您可以使用属性矩形中的 VEX 片段或 Python SOP 操作几何体上的字典属性 。还支持在参数表达式中阅读键值。
Language 语言 |
Support 支持 |
---|---|
VEX/VOPs |
See the documentation for the VEX dict type for more information on working with types in VEX. |
Python |
|
Expressions 表达式 |
|
Tip 尖端
The Attribute Create node only creates an empty dictionary attribute. Currently, the best way to set dictionary values in a geometry network is with a
Python SOP or
Attribute Wrangle
“ 属性创建 ”节点仅创建空字典属性。目前,在几何网络中设置字典值的最佳方法是使用
Python SOP 或
属性矩形.
Intrinsic attributes 内在属性¶
Intrinsic attributes are computed values derived from the geometry that you can access as if they were attributes.
内部属性是从几何体中导出的计算值 ,您可以像访问属性一样访问这些计算值。
Examples of intrinsic attributes
固有属性的示例
Detail 详细 |
|
Number of points in the geometry |
Detail/primitive 细节/原始 |
|
Bounding box of the geometry |
Primitive 原始 |
|
Surface area of the geometry. |
Primitive 原始 |
|
Amount of memory used by the primitive. |
To... 去... | Do this 这么做 |
---|---|
See the available intrinsic attributes |
|
Use intrinsic attributes |
|
Tip 尖端
Despite the name, some “intrinsic” attributes can actually be written to, causing Houdini or Mantra to change some internal setting. For example, you can set the intrinsic attribute on a packed primitive.intrinsic:unexpandedfilename
尽管名称,一些“内在”属性实际上可以写入,导致胡迪尼或曼特拉改变一些内部设置。例如,您可以在打包的基元上设置内部属性。intrinsic:未扩展文件名
Tip 尖端
Bounding box intrinsic attributes, like or are returned in (xmin, xmax, ymin, ymax, zmin, zmax) order.intrinsic:bounds
intrinsic:packedbounds
边界框固有属性,如或,按(xmin,xmax,ymin,ymax,zmin,zmax)顺序返回。intrinsic:bounds
内部:压缩边界
Higher and lower precision storage
高低精度存储¶
You can choose the numeric precision of attributes you create with the Attribute Create node, and/or convert attributes to higher precision types (at the cost of more memory) or lower precision types (to save memory) using the
Attrib Cast SOP node.
您可以选择使用“属性创建”节点创建的属性的数值精度 ,和/或使用“属性转换 SOP”节点将属性转换为更高精度类型(以更多内存为代价)或更低精度类型(以节省内存)
。
See Attrib Cast for information on the available storage types and limitations.
有关可用存储类型和限制的信息,请参见属性投射。
Indexing and limit variables
索引和限制变量¶
You may see the following “pseudo-attributes” in VEX snippets. They represent the number of the current element being processed (for example, the point number), and the total number of elements in the geometry/list. See indexing and limit variables in VEX snippets for more information.
您可能会在 VEX 片段中看到以下“伪属性”。它们表示正在处理的当前元素的编号(例如,点编号)以及几何/列表中元素的总数。有关详细信息,请参阅 VEX 代码段中的索引和限制变量 。
@elemnum
, , , @ptnum
@primnum
@vtxnum
@elemnum
,@ptnum
@primnum
@vtxnum
Represents the number of the current element when a VEX snippet is run.
表示运行 VEX 代码段时当前元素的编号。
@numelem
, , , @numpt
@numprim
@numvtx
@numelem
,@numpt
@
numvtx @numvtx
Represents the total number of elements in the geometry/list when a VEX snippet is run.
表示运行 VEX 片段时几何图形/列表中的元素总数。
Common attributes 共同属性¶
Each type of node will use certain attributes if they exist (or in some cases require them to exist), and may create/set attributes as part of their operation. See the documentation for individual nodes to see the attributes they use/set.
每种类型的节点将使用某些属性(如果它们存在)(或者在某些情况下要求它们存在),并且可以创建/设置属性作为其操作的一部分。请参阅各个节点的文档以查看它们使用/设置的属性。
The following lists a number of attributes that by convention are read/written by multiple node types.
下面列出了许多属性,按照约定,这些属性可由多个节点类型读取/写入。
|
vector 向量 |
Point position. The viewport uses this to lay out the points of the model in 3D space. You can overwrite this attribute to move the point. |
|
vector 向量 |
Normal direction. You can overwrite this attribute to change the normal. |
|
vector 向量 |
Velocity. The renderer uses this attribute to know where to add motion blur. This attribute is not computed automatically, but several nodes, especially particle DOPs, can set/use it. You can add velocity to points using the |
|
int |
A unique element ID. This is not the same as the element number (for example, the point number). This is an attribute you can, for example, assign to points to keep track of them even if the point numbers change (which can happen if the number of points change). Particle DOPs often set/use this attribute. |
|
string 字符串 |
Set this value on primitives, such as volumes or packed primitives, to find them in code by name. Some nodes set/read this attribute. |
|
int |
Nodes that break up geometry into pieces will often set this attribute so that you can tell which polygonal faces are part of the same piece. Faces in the same piece will share the same value in their attribute. Other nodes may use this attribute to operate on pieces. |
|
float 浮子 |
Uniform scaling factor. This is used in different ways in different places. For particle/point rendering, it controls the size of the particle/point (in world space units) at render time. For instancing, you can use it to uniformly scale the instanced geometry. |
|
vector 向量 |
Whereas is a single uniform scaling factor in all axes, this attribute lets you scale non-uniformly along each axis separately. |
|
float 浮子 |
When rendering open curves, sets the line width (in world space units) at render time. If this attribute does not exist, Mantra renders the open curve as a thin line instead of a ribbon with thickness. |
|
float 浮子 |
Level of detail. This may be used in instancing. |
|
vector 向量 |
When displaying particles using sprint images, this gives additional sprite scaling over . |
|
float 浮子 |
When displaying particles using sprint images, this gives sprite rotation (around camera angle) in degrees. |
视口显示属性
|
int |
If this detail attribute is 1, the geometry always appears as wireframe in the viewport. If this detail attribute is -1, the geometry always appears as shaded in
the viewport. For guide geometry, which are normally only drawn as
wireframe, this allows them to also be drawn as shaded when using any of
the shaded viewport modes. |
|
int |
If this detail attribute is 1 and a attribute is present, curves
will be drawn as ribbons and shaded. |
|
int |
If this detail attribute is 0, the geometry always appears without lighting. This is currently ignored for guide geometry. |
|
int |
If this detail attribute is not 0, all points will be rendered as sprites, even if they are connected to geometry. Normally only unconnected points are rendered. This is currently ignored for guide geometry. |
|
int |
If this detail attribute is not 0, unconnected points will be drawn as spheres rather than as the render properties or as sprites. can cause connected points to also be drawn this way. |
|
int |
If this detail attribute is not 0, the geometry will be drawn in X-Ray mode (visible even when it is hidden behind other geometry). |
|
float 浮子 |
Controls the cusp angle used for generating normals when the geometry does not have any normals. 180 will produce entirely smooth point normals. |
|
string 字符串 |
Specifies a texture for sprites. This is only valid on unconnected points, or if is 1. |
|
int |
If this attribute is set to 1, turns on blending when drawing sprites. When set to 0, no depth sorting or blending occurs, greatly increasing the draw performance of sprites. Turning off blending is good for opaque sprites like vellum grains. |
|
float 浮子 |
When is 0, discard all pixels with an alpha value less than this cutoff value. 0 discards no pixels, while 1 only keeps fully opaque pixels. Values between 0.5-0.75 are generally good for opaque sprites with antialiased edges. |
视口体积显示属性
The following detail attributes control how the viewport renders volume
primitives. The viewport can display these primitives as fog, height fields, or
isosurfaces (signed distance fields). To query this property, you can read the
primitive intrinsic attribute. The detail attributes listed
in this section apply to fog volumes, and some of them also affect the viewport
display of height fields.volumevisualmode
以下细节属性控制视口渲染体积基本体的方式。视口可以将这些基元显示为雾、高度场或等值面(带符号的距离场)。若要查询此属性,可以读取基元内部属性。本部分中列出的细节属性适用于雾体积,其中一些属性还影响高度场的视口显示。 体积视觉模式
A volume visualization set can have the following 4 components.
体积可视化套件可包含以下4个组件。
|
For fog, this component contains the optical thickness of the smoke. With
height fields, this main volume should store the elevation at each voxel. |
|
The color field. This component can be used with both fog (to color the
smoke) and height fields (to texture the terrain). |
|
With fog, this component contains the intensity of emission (or internal
glowing). For height fields, this component acts like a visualization
stencil - the viewport only draws parts of the height field where the
value is at least . |
|
This component can be used with fog volumes to color the internal emission. |
The in the attribute names in this section can be one of the above 4 strings.
You can use the *
Volume Visualization SOP to set or modify these attributes.
本节中属性名称中的可以是上述 4 个字符串之一。您可以使用 *
Volume Visualization SOP 来设置或修改这些属性。
|
string 字符串 |
Name of the volume containing data for the respective component. |
|
vector2 向量2 |
Range of volume values that gets remapped to the 0..1 range. |
|
string 字符串 |
Contains a string representation of the ramp that
remaps the respective volume values. If no string is present, no ramp is used to
remap the values. |
|
int |
Flags how the ramp is applied to the remapped volume values.
When set to , the ramp is evaluated at the modulus of the volume’s value
with . This can be useful to create a checkerboard or striped effect to
better see large ranges of values. |
|
int |
Limits the visualization resolution of volumes. When set to a
positive value and the volumes are high resolution, the volumes are resampled to
this size before rendering. |
|
float 浮子 |
Acts as a multiplier for emission intensity. Higher values
increase the brightness of the internal glow (for example, the flames in a fire). |
|
float 浮子 |
Controls the intensity of self-shadowing from all light sources. Larger values
result in darker self-shadows. |
|
float 浮子 |
Controls the intensity of self-shadowing from ambient light sources. Note that
the default headlight is treated as an ambient source for fog volumes. The default value of this attribute is set by Ambient Occlusion under the
viewport display options. |
|
float 浮子 |
Controls the size of the occlusion map texture when shading for ambient light
sources. Larger values (up to 1) are slower to shade, but produce higher
quality results. |
|
float 浮子 |
Specifies how often the density texture is sampled when calculating
self-shadowing from ambient light sources. Smaller values (down to 1) are
slower to shade, but produce higher quality results. |
|
vector 向量 |
Controls the color of the shadows cast by the smoke. The complements of these
values act like additional density multipliers for the light of each color (red,
green, or blue). |
The viewport can additionally approximate scattering of light within fog
volumes. This feature is experimental and may be changed or removed in future
versions of Houdini.
此外,视口还可以近似雾体积内的灯光散射。此功能是实验性的,可能会在未来的 Houdini 版本中更改或删除。
|
float 浮子 |
Specifies the proportion of light that is absorbed by the volume (as opposed to
being scattered out). A value of 1 signals that no scattering takes place.
A value of 0 suggests that all light that interacts with
the smoke is scattered. |
|
int |
Scattering is approximated by an iterative process, and this attribute
stores the number of refinement iterations that are performed. Larger values
produce more accurate results, but take longer to compute. |
When working with fog volumes, you can force the viewport to instead draw its
motion vectors or normals. This behavior is also controlled through detail
attributes.
使用雾体积时,可以强制视口改为绘制其运动向量或法线。此行为也通过详图属性进行控制。
|
int |
The viewport will draw screen-space motion vectors for the fog when this
attribute is non-zero. The vector volumes will be used to
read the velocities. |
|
int |
The viewport will draw screen-space normals for the fog when this attribute
is non-zero. If both and are non-zero,
the viewport will draw the normals. |
|
vector 向量 |
The attribute on the current point. This is set/used by some particle DOPs. It represents a change to the particle’s position computed by adding up all the forces acting on the particle. |
||||||||||||||||
|
vector 向量 |
Conventional name for an attribute containing each point’s rest position, used by various nodes.
Some shaders can use this rather than , so procedural textures will stick even if you deform your geometry. |
||||||||||||||||
|
vector 向量 |
The attribute on the current point. This is set/used by the |
||||||||||||||||
|
vector 向量 |
Represents the up vector of a particle’s local space. This is used for instancing geometry onto a point. You can overwrite this attribute to change the particle’s orientation. |
||||||||||||||||
|
vector 向量 |
Obsolete, used by old POPs. The new DOP particle nodes use the attribute instead. |
||||||||||||||||
|
vector4 矢量4 |
Obsolete. Used by old POPs to store the particle’s previous position. |
||||||||||||||||
|
vector4 矢量4 |
Quaternion orientation of a particle. Allows fully specifying rotation, whereas only orients along a single axis. If this exists, it is used for instancing geometry onto a point. |
||||||||||||||||
|
vector4 矢量4 |
An additional offset-quaternion applied after all other attributes, used when instancing geometry onto a point. |
||||||||||||||||
|
int |
Detail attribute storing the largest particle ID, allowing Houdini to create new particle ids efficiently. |
||||||||||||||||
|
int |
A bit field encoding different pieces of information about a particle’s state (for example, whether it is alive, whether it is stopped, whether it collided in the previous frame, etc). Various particle DOPs read and write this attribute. The value is the sum of the following flags:
|
Most shaders will use the override attributes to change how elements with these attributes are shaded.
大多数着色器将使用覆盖属性来更改具有这些属性的元素的着色方式。
|
vector 向量 |
Diffuse color override. The viewport uses this to color OpenGL geometry. |
|
float 浮子 |
Alpha transparency override. The viewport uses this to set the alpha of OpenGL geometry. |
|
vector 向量 |
Specular color override. |
|
vector 向量 |
Reflect color override. 反射颜色替代。 |
|
vector 向量 |
Transmit color override. |
|
vector 向量 |
Emission color override. |
|
float 浮子 |
Roughness override. 粗糙度超驰。 |
|
float 浮子 |
Fresnel coefficient override. |
|
float 浮子 |
Shadow intensity override. |
|
float 浮子 |
Shadow bias override. 暗影偏移解除。 |
|
vector 向量 |
The UV coordinates of the point/vertex. The first two elements of this vector contain the current U and V coordinates. Note that is Houdini’s conventional attribute name for storing texture coordinates. You can store texture coordinates in other attributes and have multiple UV layouts on the same geometry. Most texture-related nodes have a field to let you specify the name of the UV attribute to use. |
|
string 字符串 |
The node path to the material to use to shade this primitive. Overrides the object’s material. |
|
string 字符串 |
The attribute on the current point, containing a path to the geometry instanced on the point. This can be a file path to a geometry file, or an path to a geometry object or node. You can overwrite this attribute to change the instanced geometry. |
|
string 字符串 |
Detail/primitive. The name of a RenderMan shader. |
See also 另见 |