SCRIPT: override octane materials in viewport 2.0
Posted: Fri Mar 04, 2016 1:23 pm
Most of the time, octane materials display in viewport 2.0 is not usefull for nice playblast (specially in directx mode it only show a grey color).
You can override octane material with maya shaders in viewport 2.0 using my script:
You can override octane material with maya shaders in viewport 2.0 using my script:
Code: Select all
//this script adds a "hardware Shader" attribute in the "Extra Attributes" section for every octane material in your scene.
//you can then connect manually to this attribute whatever maya shader you want to see in viewport 2.0 instead of the octane material.
string $mats[] = `ls -typ octaneDiffuseMaterial -typ octaneGlossyMaterial -typ octaneMixMaterial -typ octanePortalMaterial -typ octaneSpecularMaterial`;
for ($mat in $mats) {
if (1-`attributeExists hardwareShader $mat`) {
addAttr -ln hardwareShader -usedAsColor -h 0 -attributeType float3 $mat;
addAttr -ln colorR -attributeType "float" -parent hardwareShader $mat;
addAttr -ln colorG -attributeType "float" -parent hardwareShader $mat;
addAttr -ln colorB -attributeType "float" -parent hardwareShader $mat;
print $mat;
}
}