maya 2010 mia_material_x bump bug fix

david | dj mod,mel script,mentalray,rendering | Thursday, October 15th, 2009

In maya 2010, if you connect a bump map to a mia_material_x shader and later change your mind and delete the bump map or break the connection, the shader will no longer render as you expect and the hypershade swatch will turn black.

If you use the channel box to  inspect the mia_material_x attributes you will see that after you disconnected the bump map the bump attributes were left set to 0,0,1. To fix the problem you simply need to reset them to 0,0,0.

It is interesting to note that the same thing happens to the bump attributes in maya 2009, but in 2009 it does not affect swatch generation or rendering.

To avoid the inevitable annoyance that this new behaviour is likely to cause I made a change to AEmia_material_xTemplate.mel. AETemplate scripts control the way the attribute editor functions for specific nodes. In this case I added a few lines of code to reset the bump attributes if you disconnect a bump map.

The modified AEmia_material_xTemplate.mel will help with future bump disconnections but you will need to check the  attributes manually if you notice problems in older scene files. It is not obvious if you look in the attribute editor window; you will need to use the channel box.

The modified AEmia_material_xTemplate.mel is on my downloads page.

As with all modifications, please do not overwrite your existing copy. Put it in your local scripts folder.

UPDATE 16 Oct 2009:  I've discovered there is a common situation when my fix fails. It will not work if you disconnect your bump2d node by deleting the connection line in the hypershade unless you have opened the attribute editor with the shader selected. I'm trying to figure out a fix for this too, and will post here if I do.

UPDATE 17 Oct 2009: I've updated the download to include a 2nd script called hyperUserInit.mel. This fixes the problem I mentioned yesterday. (You need both scripts.)

1 Comment »

  1. Hi David
    I just want to say thank you, setting the BumpZ to 0, solve 1/2 problem, so the corrected script are awesome! thanks for that!
    /Rachid

    Comment by rachid — October 18, 2009 @ 3:05 am

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck