Quantcast
Channel: ArnoldRenderer – Arnold Support Corner
Viewing all articles
Browse latest Browse all 140

[MtoA] MayaFile node uses a default color for missing textures

$
0
0

Here’s something important to remember when you’re debugging a scene…

By default, the MayaFile node uses a default color if a texture is missing.

MayaFile_Use_Default_Color

This means the render won’t abort because of missing textures, and you won’t see ERRORs like these in the Arnold log for missing texture files:

ERROR   |   [texturesys] OpenImageIO could not open "sourceimages/noicon.tx" as tx: Could not open file "sourceimages/noicon.tx"
ERROR   |   [texturesys] Invalid image file "sourceimages/noicon.tx"

So missing textures can easily go unnoticed.

If you need to disable Use Default Color for testing, an easy way is to export an ASS file and then render it with kick -set MayaFile.useDefaultColor false.

I suppose you could also modify the Maya scene file directly:

import maya.cmds as cmds
import os

def set_useDefaultColor(b):
    filenodes=cmds.ls(type="file")
    for item in filenodes:
        cmds.setAttr( "%s.aiUseDefaultColor" % item, b )

set_useDefaultColor( False )

And finally, you can change the default value of the Use Default Color parameter by adding this to shaders/mtoa_shaders.mtd:

[node MayaFile]
	[attr useDefaultColor]
		default		BOOL	false

Viewing all articles
Browse latest Browse all 140

Trending Articles