2012年9月1日 星期六

快速建立 blendshape 小程式




Maya 的 Blendshape 功能 (Animation Menu --> Create Deformers --> Blend Shape) 有個不方便的地方就是 : 設定裡沒有一個選項是可以讓 weight 的預設值為 1 的 ! (或是其時有但我從沒發現過?!?)

於是在這我提供一段小程式來協助大家快速建立 blendshape 並且把 weight 設為 1 :

MEL:

{

 $origin = "world";

$blendNode = `blendShape -origin $origin`;

setAttr ($blendNode[0]+".weight[0]") 1;

}

  



pymel:

import pymel.core as pm
origin = 'world'

blendNode = pm.blendShape(origin=origin)[0]

blendNode.weight[0].set(1)


若 blendshape 座標想從世界座標改為物件相對座標,那就把 origin 從 "world" 改為 "local"




5 則留言:

  1. 你好 請教如果要學習maya script,您會建議直接從python 開始嗎?或是要先從mel? 謝謝

    回覆刪除
  2. Hi.
    看你學 script 的用途. 如果只是想把一些過程自動化,那學 mel就夠了(畢竟在 maya 環境裡 mel 應該是比較好學)。但如果是想自己寫一些工具來輔助製作流程,那建議直接從 python 開始會比好,因為 python 的程式功能遠大於 Mel.

    回覆刪除
  3. 您好,請問要做臉部表情的動畫,一定要用 blendshape 來製作嗎?用MAYA做表情動畫的流程是如何的呢?

    回覆刪除
    回覆
    1. Hi,
      臉部表情不一定要用 blendshape 做,也可以使用 joints/clusters 去做。或兩個結合在一起 (joints + pose space deformation). 網路上應該有蠻多教學可以參考。

      刪除
  4. Citizen Titanium Watch is a premium premium model
    The used ford edge titanium model also provides a titanium earrings hoops premium model, with a titanium bracelet dual platinum smith titanium strap that is easily adjustable for a variety ford edge titanium of gaming games. The

    回覆刪除