From d826284a7613c0b6093b54d1da42e7ed65d8cd19 Mon Sep 17 00:00:00 2001 From: Markus Lipp Date: Wed, 12 Jun 2019 16:51:20 +0200 Subject: [PATCH] CE-NONE: always initialize blendmode correctly --- src/client/node/PRTMaterialNode.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/node/PRTMaterialNode.cpp b/src/client/node/PRTMaterialNode.cpp index 00feab30..4ef42e4d 100644 --- a/src/client/node/PRTMaterialNode.cpp +++ b/src/client/node/PRTMaterialNode.cpp @@ -408,10 +408,9 @@ MStatus PRTMaterialNode::compute(const MPlug& plug, MDataBlock& block) mShadingCmd += "setAttr ($shName+\".initgraph\") true;\n"; mShadingCmd += "connectAttr -force ($shName + \".outColor\") ($sgName + \".surfaceShader\");\n"; - if (matInfo.opacityMap.size() == 0 && matInfo.opacity >= 1.0) { - mShadingCmd += "$shadingNodeIndex = `shaderfx -sfxnode $shName -getNodeIDByName \"Standard_Base\"`;\n"; - mShadingCmd += "shaderfx - sfxnode $shName - edit_stringlist $shadingNodeIndex blendmode 0;\n"; - } + MString blendMode = (matInfo.opacityMap.size() == 0 && matInfo.opacity >= 1.0) ? "0": "1"; + mShadingCmd += "$shadingNodeIndex = `shaderfx -sfxnode $shName -getNodeIDByName \"Standard_Base\"`;\n"; + mShadingCmd += "shaderfx - sfxnode $shName - edit_stringlist $shadingNodeIndex blendmode "+ blendMode +";\n"; //ignored: ambientColor, specularColor setAttribute(mShadingCmd, matInfo.diffuseColor, 3, "diffuse_color");