フィールド

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

../../_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.

フィールドの視覚化

ソケットの形状は、どのソケットがフィールドで、どのソケットが通常のデータであるかを伝えるために使用されます。可能なソケットの形状は3つあり、それぞれが "フィールドステータス" を視覚化します:

Circle(円):

ソケットには単一の実数値が必要であり、フィールド入力を受け入れることはできません。出力ソケットの場合、これはノードが常に単一の値を出力することを意味します。

Diamond(ダイアモンド):

ソケットはフィールド入力を受け入れるか、フィールドを出力します。これらのソケットには一定の単一値を接続できますが、出力は要素ごとに変化しないことがよくあります。

ドット付きダイアモンド:

ソケットはフィールドにすることができますが、現在は単一の値です。これは、多くの異なる結果を持つフィールドの代わりに、単一の値が計算される場所を追跡できるため便利です。また、 ソケットの検証 がフィールド入力名の代わりに値を表示することも意味します。

../../_images/modeling_geometry-nodes_fields_constant.png

ソケットの形状はドット付きのダイアモンドです。つまり、フィールドはすべての要素で同じ値になります。すべてのポイントが5m上に移動します。

../../_images/modeling_geometry-nodes_fields_varying.png

ソケットの形状はダイアモンドで、フィールド入力にはさまざまな入力があります。つまり、値は要素ごとに異なる可能性があります。この場合、すべてのポイントのオフセットがポイントの位置であるため、位置は2倍になります。

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つのノードソケット間で接続が確立されると、ノード接続は破線で描画されます。非フィールドソケットをフィールドソケットに接続するのを間違えた場合、接続はエラーがあることを示す赤い実線で描画されます。

ノードタイプ

ノードは、通常はジオメトリを渡すデータフローノードと、要素ごとのデータを操作するフィールドノードの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(位置設定)ノードへの入力フィールドは実際の位置を使用せず、その匿名属性のコピーを使用します。