フィールド

基本的に、フィールドは関数です: つまり、任意の数の入力を単一の出力に変換できる一連の命令です。フィールドの結果は、さまざまな入力データを使用して何度も計算できます。これらはジオメトリノード全体で使用され、要素(メッシュの頂点、面、など)ごとに異なる結果を持つ計算を可能にします。

../../_images/modeling_geometry-nodes_fields_title.png

ノードへのフィールド入力。

For example, in the figure above, the field connected to the "Set Position" node depends on two inputs, Position and Index, and transforms them into a vector using a single instruction.

フィールドの視覚化

../../_images/modeling_geometry-nodes_fields_visualization.webp

If a node connection is coming from a field socket, it will be drawn as a dashed line. Otherwise, it will be drawn as a solid line instead.

If you make the mistake of connecting a non-field socket to a field socket, the connection will be drawn as a solid red line indicating that there is an error.

Tip

Often it is desired to extract a single value from a field. While it doesn't make sense conceptually to simply change a field into a single value, the Sample Index Node or the Attribute Statistic(属性統計)ノード can be used to retrieve a single value from a field evaluated on a geometry.

ノードタイプ

ノードは、通常はジオメトリを渡すデータフローノードと、要素ごとのデータを操作するフィールドノードの2つのカテゴリに分類できます。フィールドノードは、ジオメトリデータをノードツリーに取り込む入力ノード、またはそのデータを操作する関数ノードにすることができます。

データフローノード

ジオメトリ入力とジオメトリ出力を持つノードは、ほとんどの場合、データフローノードになります。つまり、Geometry Nodes(ジオメトリノード)モディファイアーから出力されるジオメトリデータを実際に変更します。

関数ノード

Nodes with diamond socket inputs and outputs are field nodes, and resemble the instructions that will be evaluated by data flow nodes. Examples of function nodes are the math nodes and also more complex nodes like the Geometry Proximity(ジオメトリ近接)ノード.

Input(入力)ノード

Input nodes provide data to the field evaluation process. By themselves, they mean nothing; they must be evaluated within the context of a data flow node (geometry) to actually output a value. Examples of input nodes are the built-in attribute input nodes like Position and ID, but also selection nodes like Endpoint Selection.

フィールド入力は、 匿名属性 の形式で、 Distribute Points on Faces などのジオメトリを処理する他のノードから取得される場合もあります。

フィールドコンテキスト

すべてのフィールドノードは、接続されているデータフローノードのコンテキストで機能します。コンテキストは通常、ジオメトリコンポーネントタイプと属性ドメインで構成されており、入力ノードから取得するデータを決定します。

よくある誤解の1つは、複数の場所で使用されている同じフィールドノードツリーが同じデータを出力するだろうということです。これは必ずしも正しくはありません。フィールドノードツリーはすべてのデータフローノードに対して評価され、異なるジオメトリまたは変更されたジオメトリからデータを取得する可能性があるためです。

../../_images/modeling_geometry-nodes_fields_flow-1.png

Here, the Set Position node's input field is evaluated once. To evaluate the field, the node traverses backwards to retrieve the inputs from the field input nodes.

../../_images/modeling_geometry-nodes_fields_flow-2.png

2番目のSet Position(位置設定)ノードが追加されると、同じフィールドノードツリーがデータフローノードごとに1回ずつ、2回評価されます。2番目のSet Position(位置設定)ノードでは、ジオメトリ入力の最初のノードからの位置がすでに変更されているため、結果は異なります。

../../_images/modeling_geometry-nodes_fields_flow-3.png

ただし、多くの場合、ジオメトリを変更した後でも同じフィールド値を使用する必要があります。 Capture Attribute(属性キャプチャ)ノード はフィールドを評価し、結果をジオメトリの 匿名属性 にコピーします。

ここで、Capture Attribute(属性キャプチャ)ノードは初期位置のコピーを保存します。Capture Attribute(属性キャプチャ)ノードのフィールド入力の評価は、まったく異なるステップであることに注意してください。後で、Set Position(位置設定)ノードへの入力フィールドは実際の位置を使用せず、その匿名属性のコピーを使用します。