2012年6月26日 星期二

切換貼圖的方法之一 ( a practical way to switch texture in rig file)


某些角色或物件或場景可能只差在於貼圖長得不一樣,所以需要在 rig 檔案裡做切換貼圖的功能。要達到這件事有好幾種方法,例如使用 condition node, 或 file sequence 當 input等。個人覺得以下這方法(使用 choice node 當切換機) 還不錯用,也是最近才發現的一個 node.


首先在 hypershade 裡選 utilities -> choice node (此稱為 choice1)。



選取 choice 1, 然後在 attribute editor 裡的 Extra Attributes->Input 按下 Add New Item (要切換幾個貼圖就按幾次)。



接下來先產生 N 個 file node  (file2,file3,file4) 當 input 以及 一個 file node  (file1) 當 output. 然後使用 connection editor 把每一個 input file node 的 fileTextureName 屬性 連結到 choice1 的 input (input[0] 或 input[1] 或 input[2] ) 




然後把 choice1 的 output  屬性連結到 file1 的 fileTextureName 上. 連完之後就看你要把 file1 的 outColor 連到 材質的哪一個屬性 (例如 color 或 specular 或  bump 等).



choice node 的切換屬性叫做 selector, 你可以把 某個控制器的屬性連到 choice1.selector 的屬性上,就可以輕鬆達到切換貼圖的功能。


(還有,記得要把 N 個 input file node 的 貼圖路徑填好,否則你不管怎麼切換都會是一片黑底XD ).

5 則留言:

  1. 讚~!葉教授

    by Jacky

    回覆刪除
  2. 大大想請教個問題~maya不知有沒有辦法直接找到"反Norma"的模型,我知道cleanup/conform可找到局部的~我希望是可以直接找到~再麻煩大大幫忙~~感激不進^^

    回覆刪除
  3. 請教個問題如果前面的屬性是用layeredTexture(裡面有3層) 然後裡面以連2張連續動態貼圖 連上去會變成雜訊XD
    在connection editor 要哪個連到那個><?? 感謝

    回覆刪除
    回覆
    1. 這我就不清楚了 XD ,可能要實際看 hypershade connection 才有辦法判斷問題出在哪,或是否maya本身的限制。

      刪除