「The name of the power that moves you is not important. What is important is that you are moved. Awe is the foundation of religion. No other motivation can free you from the limits of personal achievement. Nothing else can teach you the Art of Flight.」
「The name of the power that moves you is not important. What is important is that you are moved. Awe is the foundation of religion. No other motivation can free you from the limits of personal achievement. Nothing else can teach you the Art of Flight.」

blenderでFlowMap生成ツールを作ってみた。

165words 2026-03-19(Updated: 2026-03-24)

実現機能

  • 指定した位置・方向から流れるflowmapをワンクリックでテクスチャにする。
  • flowmapの方向やディストーションをパラメータで変える

image-20260320141913446

アルゴリズム

Flowmap

Flow方向の構成:

  • ArrowDirection:矢印で定義した方向
  • Offset:
    • 矢印の位置に対して、オブジェクト上の各点がどこにあるか
    • 中心に向かう/外に広がる流れを作る(PosworldPosarrowPos_{world} - Pos_{arrow}
  • Noise:ランダムな揺らぎを加えて、流れを自然に歪ませる
VFlow=k1Varrow+k2Voffset+k3Vnoise\vec{V}_{Flow} = k_1 \vec{V}_{arrow} + k_2 \vec{V}_{offset} + k_3 \vec{V}_{noise}

そのうち、k2k_2は流れの集まり方や広がり方を決めます。

  • < 0:中心に集まる
  • > 0:中心から広がる
  • = 0:中心がなくなり、全ての点が同じ方向に向く

シームレスサンプリング

Flowmapの欠点として、ずっとサンプリングし続けると歪みすぎて不自然になってしまいます。

そこで今更ながら、2010年にValveが出した「時間差を付けて二回サンプリングして、Mixする」方法を習得しました。

image-20260320155557676

blender-API

blenderアドオンのAPIに関してはchatGPTと相談しながら学んだので、これからノートにまとめていこうと思うのですが、落とし穴を一つメモしときます。

スクリプトでペアレント操作する時、本来の見た目を変えないための設定:

#--arrowをobjの子にしつつ、見た目を変えない--
    arrow.matrix_world = obj.matrix_world
    arrow.parent = obj
    arrow.matrix_parent_inverse = obj.matrix_world.inverted()

MparentinvertedchildM^{child}_{parent-inverted}を挟むことで親オブジェクトの変換を打ち消す

Mworldchild=MworldparentMparentinvertedchildMlocalchildM^{child}_{world} = M^{parent}_{world}\cdot {M^{child}_{parent-inverted}}\cdot M^{child}_{local}

showcase

軽くレンダリング

洗面台のモデル:

"Sink" (https://skfb.ly/6twoA) by JuanG3D is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).

最後に

改善点

  • 3D Curl Noiseに挑戦してみたい
  • 現在は2Dテクスチャに書き込むので、複雑な造形に対応できない

参考記事

https://issekinichou.wordpress.com/tag/flow-map/

https://logicalbeat.co.jp/blog/18907/

https://www.linkedin.com/pulse/curl-noise-explorations-illugen-nicholas-seavert-svjve/