0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

usdShade material(Material binding)のメモ

Last updated at Posted at 2022-12-11

USD の material:binding ようわからん...

##https://openusd.org/release/wp_usdshade.html#usdshade-material-assignment

基本

rel (Relationship) でマテリアルノードのパスを指定します.

def Mesh "bora" {
  rel material:binding = </Material/diffuse>
}

ターゲットとなるパスは一個だけです.
ちなみに USDA 上では相対パスも指定できますが(e.g. <../diffuse>), USDC(crate binary)では絶対パスしか扱えないため, 読み込み時に絶対パスへと変換されます(USDA でよんで USDA で print(e.g. usdcat)すると絶対パスになっています)

variant?

  rel material:binding:preview = </Material/diffuse/preview>

のように suffix でプレビュー用マテリアルなど設定できます.

collection

material のターゲットパスを複数持てます.

rel material:binding:collection:boras = [</Material/diffuse/bora1>, </Material/diffuse/bora2>]

material:binding:collection:NAMENAME はトークンのみでさらなるネームスペースを追加するのはできないです.

評価順(Strength)

def Xform "muda" {
  rel material:binding = </Material/specular>

  def Mesh "ari" {
  }

  def Mesh "bora" {
    rel material:binding = </Material/diffuse>
  }
}

のように親(祖先)の Prim にマテリアルをアサインすることができます. この場合親で定義されているが子で定義されていない場合(ari), 基本は親の設定を見ますが, これを bindMaterialAs で親が強いようにするのもできるようです.
Collection とか instance を考えての対応のようです.

詳細は UsdShade Material Assignment の URL にある GetBoundMaterial の pseudo code を参照ください

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?