Friday, November 2, 2012

How to fix mia_material_x bump bug

Hi, there.

If you are using mental ray shader in maya like mia_material_x for example, you might be notice that when you disconnect your bump node, your mia_material_x will give you a wrong result. That's because when you disconnect your bump node, the vector value of this bump parameter does not set back to zero. Even though mental ray already have write a script to fix this issue, but sometime the issue still there if you are not using the latest version(I don't know why). To fix that, you can just use a simple mel script to set the vector value back to zero.



string $selShader[] = `ls -sl`;
for($i in $selShader){
    setAttr ($i + ".standard_bumpZ") 0;
}


*mi_metallic_paint: flake_bumpZ
 mia_material_x:  overall_bumpZ / standard_bumpZ
 misss_fast_shader_x: bumpZ
 misss_fast_skin_maya: normalCameraZ
(replace red text if you are using different material)

Just select your shader(s), then execute above mel script.
Hope it helpful to you. Cheers! :)




當你在maya使用mental ray材質時,有時會發現把bump節點斷開時材質的顯示會變不正常。這是因為bump節點的vector沒有正常歸零。雖然mental ray已經有寫了修補的script,可是不知道為什麼有時後仍是沒有作用(新版好像就比較正常了)。為了解決這個惱人的問題可以透過手動執行mel的方式來修正,只要選擇材質(可多選)再執行上面的mel即可。根據不同類型的材質可以替換掉相對應的bump名稱。

有遇到相同問題的人可以試試。:)



No comments:

Post a Comment