
文系の blender 4.1 はじめての Geometry Node | Read ノード
ここでは、ジオメトリノードで頻出する、Index, Position, Normal 等、各 Read ノードについて簡単に紹介します。
環境 Blender 4.1.0 , Mac Mini M1 OS 14.4
Index | インデックス
Index ノードは、接続先(下の例では Grid)の構成要素の識別番号を出力する。
ここではインスタンスだが、接続先がジオメトリであれば頂点の、カーブであればコントロールポイント … 等の構成要素の番号を出力する

スプレッドシート画面をみると、この例では 80 個あるインスタンスに、それぞれ、0 〜 79 番の Index が割り当てられている。

単純な整数値の数列の出力なので、要素の拡大、回転、選択(Selection)等さまざまな用途に利用することも可能だ。
動的な数列による出力は、フィールド値と呼ばれ、ソケットは菱形。






Position | 位置
Index ノードと同様に、接続先の各要素の位置情報、X, Y , Z の値を出力する。

下の例では、Position ノードから、接続先の Grid の 60 個のインスタンスの位置情報が出力されている。
その出力から、Separate XYZ で X の値のみ抽出し、Absolute で正の値に変換、Multiply で値を 3 倍し、その値でインスタンスを拡大している。


下の例では、各インスタンスと、右寄りに置かれたエンプティオブジェクトとの距離を Distance ノードで計算し、同じくインスタンスのスケールに反映させている。


Normal | ノーマル
接続先のジオメトリの面、頂点、辺などのノーマル(法線)のベクトルを出力する。
下はよくあるノード。球オブジェクトの頂点に、四角錐のオブジェクトを配置した。デフォルトでは四角錐はすべて同じ向きに配置される。


Normal ノードから、上の球の面のノーマル情報が出力され、Align Euler to Vector ノードで角度に変換、四角錐の回転に反映させた。
Align Euler to Vector は、4.2 より、Align Rotation to Vector に改称される予定


ノーマルの Z は面の向きが上を向いている場合、正の値、下を向いている場合、負の値なので、下では、
Separate XYZ ノードで Normal の Z 値のみ抽出
Greater Than ノードで、ゼロより大きい場合は 1 (True)、小さい場合は 0 (false)を出力、値を Selection に渡す。
Selection で、True のインスタンスのみ選択。

XYZ分離 数式 - 大きい

Selection は、ブーリアン型ソケットで、True (選択する)、False (選択しない)のいずれかの処理を行う。数値を渡された場合、ゼロあるいはそれ以下が false 、それ以外は true 扱いになる。
Radius | 半径
ジオメトリの(カーブならばコントロールポイントの)半径プロパティを出力する。すでに設定されている半径に操作を加えることができる。


右のNurbPathの各ポイントには手動で Radius が設定されている。
Named Attribute | 名前付き属性
Store Named Attribute ノードで保存された、数値、ベクトル、カラーなどのデータを出力する。
Store Named Attribute
下のオブジェクトの、Z 軸のみ反転させた頂点のデータをStore Named Attribute ノードで保存、ReverseZ と名前を付けた。


ReverseZ という属性が作成され、Z 値は -1 倍されている。

Named Attribute
上のノードの右部分。オブジェクトを複製し、複製には、Named Attribute に ReverseZ を指定し、頂点の位置に反映させた。

下が複製されたオブジェクト。Z 軸のみ反転している。

ミラーモディファイアと同じ。本来はこのような操作に Named Attribute は必要ないのだろうが、現状でのわたしの知識範囲では、より現実的な利用方法を見いだせなかった。
なお、Named Attributeで保存されたデータは、Attributeノードから、シェーダーエディタでも利用できる。
まとめ
これまでにプログラムを組んだ経験があると、ジオメトリノードでどことなく違和感がある、接続元もなく、唐突に出てきてなにが出力されるのか心もとない、と感じるノードが Read ノードかもしれません。
ただ、ジオメトリノードには欠かせないノードであることは確かで、応用範囲も広そうです。参考まで。