// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: 1998 // proc int isShadingBrushAttribute( string $attr ) { if( ($attr == "illuminated") || ($attr == "castShadows") || ($attr == "brushType") || ($attr == "softness") || ($attr == "modifyColor") || ($attr == "modifyAlpha") || ($attr == "modifyDepth") || ($attr == "edgeAntialias") || ($attr == "color1R") || ($attr == "color1G") || ($attr == "color1B") || ($attr == "color2R") || ($attr == "color2G") || ($attr == "color2B") || ($attr == "transparency1R") || ($attr == "transparency1G") || ($attr == "transparency1B") || ($attr == "incandescence1R") || ($attr == "incandescence1G") || ($attr == "incandescence1B") || ($attr == "transparency2R") || ($attr == "transparency2G") || ($attr == "transparency2B") || ($attr == "incandescence2R") || ($attr == "incandescence2G") || ($attr == "incandescence2B") || ($attr == "translucence") || ($attr == "specularColorR") || ($attr == "specularColorG") || ($attr == "specularColorB") || ($attr == "specular") || ($attr == "specularPower") || ($attr == "glow") || ($attr == "glowColorR") || ($attr == "glowColorG") || ($attr == "glowColorB") || ($attr == "glowSpread") || ($attr == "hueRand") || ($attr == "satRand") || ($attr == "valRand") || ($attr == "rootFade") || ($attr == "tipFade") || ($attr == "fakeShadow") || ($attr == "shadowOffset") || ($attr == "shadowDiffusion") || ($attr == "shadowTransparency") || ($attr == "backShadow") || ($attr == "brightnessRand") || ($attr == "centerShadow") || ($attr == "depthShadowType") || ($attr == "depthShadow") || ($attr == "depthShadowDepth") || ($attr == "realLights") || ($attr == "lightDirectionX") || ($attr == "lightDirectionY") || ($attr == "lightDirectionZ") || ($attr == "flatness1") || ($attr == "flatness2") || ($attr == "leafTranslucence") || ($attr == "leafColor1R") || ($attr == "leafColor1G") || ($attr == "leafColor1B") || ($attr == "leafColor2R") || ($attr == "leafColor2G") || ($attr == "leafColor2B") || ($attr == "leafHueRand") || ($attr == "leafValRand") || ($attr == "leafSatRand") || ($attr == "leafFlatness") || ($attr == "budColorR") || ($attr == "budColorG") || ($attr == "budColorB") || ($attr == "petalFlatness") || ($attr == "flowerTranslucence") || ($attr == "petalColor1R") || ($attr == "petalColor1G") || ($attr == "petalColor1B") || ($attr == "petalColor2R") || ($attr == "petalColor2G") || ($attr == "petalColor2B") || ($attr == "flowerHueRand") || ($attr == "flowerValRand") || ($attr == "flowerSatRand") || ($attr == "mapColor") || ($attr == "mapOpacity") || ($attr == "texColorScale") || ($attr == "texColorOffset") || ($attr == "texOpacityScale") || ($attr == "texOpacityOffset") || ($attr == "frameExtension") || ($attr == "useFrameExtension") || ($attr == "leafUseBranchTex") || ($attr == "flowerUseBranchTex") || ($attr == "shaderGlow") || ($attr == "texAlpha1") || ($attr == "texAlpha2") || ($attr == "textureType") || ($attr == "mapMethod") || ($attr == "fringeRemoval") || ($attr == "texColor1R") || ($attr == "texColor1G") || ($attr == "texColor1B") || ($attr == "texColor2R") || ($attr == "texColor2G") || ($attr == "texColor2B") || ($attr == "texUniformity") || ($attr == "repeatU") || ($attr == "repeatV") || ($attr == "offsetU") || ($attr == "offsetV") || ($attr == "blurMult") || ($attr == "smear") || ($attr == "smearU") || ($attr == "smearV") || ($attr == "fractalRatio") || ($attr == "fractalAmplitude") || ($attr == "fractalThreshold") // post 5.0 shading attributes || ($attr == "thornSpecular") || ($attr == "thornBaseColorR") || ($attr == "thornBaseColorG") || ($attr == "thornBaseColorB") || ($attr == "thornTipColorR") || ($attr == "thornTipColorG") || ($attr == "thornTipColorB") || ($attr == "branchReflectivity") || ($attr == "leafReflectivity") || ($attr == "flowerReflectivity") || ($attr == "leafSpecular") || ($attr == "flowerSpecular") // bump and displacement left out( considered shape ) ) { return true; } return false; } proc blendBrushAttribute( string $source, string $source2, string $target, string $atr, float $blend, int $tgl, string $altAtr, float $scale ) { float $sFl, $sFl2, $outFl; if( $blend <= 0 ) { return; } if( $tgl == 0 ) // toggle state same in both { $sFl = getAttr( $source + "." + $atr ); $sFl2 = getAttr( $source2 + "." + $atr ); $outFl = $sFl * $blend + $sFl2 * (1-$blend); } else if( $tgl == 1 ) // toggle off in source2 { $sFl = getAttr( $source + "." + $atr ); if( $altAtr == "" ) { $sFl2 = $scale; } else { $sFl2 = getAttr( $source2 + "." + $altAtr ) * $scale; } $outFl = $sFl * $blend + $sFl2 * (1-$blend); } else // toggle off in source { $sFl2 = getAttr( $source2 + "." + $atr ); if( $altAtr == "" ) { $sFl = $scale; } else { $sFl = getAttr( $source + "." + $altAtr ) * $scale; } $outFl = $sFl * $blend + $sFl2 * (1-$blend); } setAttr ( $target + "." + $atr ) $outFl; } proc int setAttrBlendToggle( string $source, string $target, float $blend, string $attr ) { int $sTgl, $tTgl, $tgl; $sTgl = getAttr ($source +"." + $attr); $tTgl = getAttr ($target +"." + $attr); if ($tTgl == 0 && $sTgl != 0) { $tgl = 1; } else if ($sTgl == 0 && $tTgl != 0) { $tgl = 2; } else { $tgl = 0; } return $tgl; } //global proc void //brushPresetSetup(float $r, float $g, float $b, float $ir, float $ig, float //$ib, float $tr, float $tg, float $tb, int $tubes, int $textured, //int $illuminated, int $fakeShadow, int $branches, int $twigs, int $leaves, int //$flowers, int $buds, int $turbulence) global proc blendBrushAttributes( string $source, string $source2, string $target, float $shadeBlend, float $shapeBlend ) { float $blend; if( !objExists( $target) || !objExists( $source ) || !objExists( $source2) ) { warning( (uiRes("m_blendBrushAttributes.kBrushNotFound")) ); return; } if( $shadeBlend <= 0 && $shapeBlend <= 0 ) { return; // no blend required } if( $shadeBlend > .999 && $shapeBlend > .999 ) { // copyBrush $source $target; copyNode $source $target; // simple copy will do return; } int $tubeTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "tubes" ); int $branchesTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "branches" ); int $twigsTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "twigs" ); int $leavesTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "leaves" ); int $flowersTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "flowers" ); int $budsTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "buds" ); int $turbTgl = setAttrBlendToggle( $source, $source2, $shapeBlend, "turbulenceType" ); int $illumTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "illuminated" ); int $fakeShadowTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "fakeShadow" ); int $mapColorTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "mapColor" ); int $mapOpacityTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "mapOpacity" ); int $frameExtTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "useFrameExtension" ); int $leafUseTexTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "leafUseBranchTex" ); int $flowerUseTexTgl = setAttrBlendToggle( $source, $source2, $shadeBlend, "flowerUseBranchTex" ); string $atName; string $atrs[] = `listAttr -k -w -s $target`; float $sFl, $sFl2, $newWidth; int $fileMapOn = false; if( $shadeBlend > 0.1 ) { int $sourceTextured = getAttr( $source + ".mapColor" ) || getAttr( $source + ".mapOpacity" ); int $tt2 = getAttr($source2 + ".textureType"); int $mm2 = getAttr($source2 + ".mapMethod"); if( $sourceTextured ) { int $source2Textured = getAttr( $source2 + ".mapColor" ) || getAttr( $source2 + ".mapOpacity" ); int $tt1 = getAttr($source + ".textureType"); int $mm1 = getAttr($source + ".mapMethod"); if( $shadeBlend > .35 || (!$source2Textured && ($mapColorTgl == 1 || $mapOpacityTgl == 1) )) { // turning on a texture where the target is not textured // or the shadeblend is high enough if( $tt1 == 4 && $tt2 != $tt1) { $fileMapOn = true; } $tt2= $tt1; $mm2= $mm1; } } setAttr ($target + ".textureType") $tt2; setAttr ($target + ".mapMethod") $mm2; } if( $shapeBlend > 0 ) { float $w1, $w2, $wblend, $s1, $s2, $sblend; $w1 = getAttr( $source + ".brushWidth" ); $w2 = getAttr( $source2 + ".brushWidth" ); $s1 = getAttr( $source + ".globalScale" ); $s2 = getAttr( $source2 + ".globalScale" ); if( $tubeTgl == 1 && $shapeBlend > .1 ) { $w2 *= 2; // interpret width as double if turning on tubes } else if( $tubeTgl == 1 && $shapeBlend > .9 ) { $w1 *= 2; } $newWidth = $w1 * $shapeBlend + $w2 * (1-$shapeBlend); if( $tubeTgl == 0 && `getAttr ($source + ".tubes")` ) { // if both brushes have tubes ON,then base // the interpolated scale value on tubeWidth instead // of the brushWidth $w1 = getAttr( $source + ".tubeWidth1" ) + getAttr( $source + ".tubeWidth2" ); $w2 = getAttr( $source2 + ".tubeWidth1" ) + getAttr( $source2 + ".tubeWidth2" ); $wblend = $w1 * $shapeBlend + $w2 * (1-$shapeBlend); } else { $wblend = $newWidth; } // compute the blended scale factor that results in // a linear blend of the width(true width = width * globalScale) $sblend = ($s1*$w1*$shapeBlend + $s2*$w2*(1-$shapeBlend))/$wblend; setAttr ($target + ".globalScale") $sblend; } for ($atr in $atrs) { if( $atr == "brushWidth" || $atr == "globalScale" || $atr == "textureType" || $atr == "mapMethod" || $atr == "imageName" || $atr == "leafImage" || $atr == "flowerImage") { // do nothing, handled above } else if( $atr == "widthScale.widthScale_Position" || $atr == "widthScale.widthScale_FloatValue" || $atr == "widthScale.widthScale_Interp" || $atr == "leafWidthScale.leafWidthScale_Position" || $atr == "leafWidthScale.leafWidthScale_FloatValue" || $atr == "leafWidthScale.leafWidthScale_Interp" || $atr == "petalWidthScale.petalWidthScale_Position" || $atr == "petalWidthScale.petalWidthScale_FloatValue" || $atr == "petalWidthScale.petalWidthScale_Interp" || $atr == "twigLengthScale.twigLengthScale_Position" || $atr == "twigLengthScale.twigLengthScale_FloatValue" || $atr == "twigLengthScale.twigLengthScale_Interp" || $atr == "leafCurl.leafCurl_Position" || $atr == "leafCurl.leafCurl_FloatValue" || $atr == "leafCurl.leafCurl_Interp" || $atr == "petalCurl.petalCurl_Position" || $atr == "petalCurl.petalCurl_FloatValue" || $atr == "petalCurl.petalCurl_Interp" || $atr == "environment.environment_Position" || $atr == "environment.environment_Interp" || $atr == "environment.environment_ColorR" || $atr == "environment.environment_ColorG" || $atr == "environment.environment_ColorB" || $atr == "reflectionRolloff.reflectionRolloff_Position" || $atr == "reflectionRolloff.reflectionRolloff_FloatValue" || $atr == "reflectionRolloff.reflectionRolloff_Interp") { // do nothing, cannot blend ramps } else if($atr == "color2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "color1R", 1 ); } else if($atr == "color2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "color1G", 1 ); } else if($atr == "color2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "color1B", 1 ); } else if($atr == "incandescence2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "incandescence1R", 1 ); } else if($atr == "incandescence2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "incandescence1G", 1 ); } else if($atr == "incandescence2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "incandescence1B", 1 ); } else if($atr == "transparency2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "transparency1R", 1 ); } else if($atr == "transparency2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "transparency1G", 1 ); } else if($atr == "transparency2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $tubeTgl, "transparency1B", 1 ); } else if($atr == "tubesPerStep") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.5 ); } else if($atr == "tubeWidth1") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "brushWidth", 0.3 ); } else if($atr == "tubeWidth2") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "brushWidth", 0.3 ); } else if($atr == "lengthMin") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "brushWidth", 1.0 ); } else if($atr == "lengthMax") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "brushWidth", 1.0 ); } else if($atr == "elevationMin") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.0 ); } else if($atr == "elevationMax") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.0 ); } else if($atr == "azimuthMin") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.0 ); } else if($atr == "azimuthMax") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.0 ); } else if($atr == "segments") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 8 ); } else if($atr == "pathFollow") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.75 ); } else if($atr == "lengthFlex") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $tubeTgl, "", 0.8 ); } else if($atr == "numBranches") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $branchesTgl, "", 1 ); } else if($atr == "splitAngle") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $branchesTgl, "", 0 ); } else if($atr == "splitMaxDepth") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $branchesTgl, "", 1.0 ); } else if($atr == "numTwigClusters") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $twigsTgl, "", 1 ); } else if($atr == "twigLength") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $twigsTgl, "", 0 ); } else if($atr == "twigAngle1") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $twigsTgl, "", 0 ); } else if($atr == "twigAngle2") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $twigsTgl, "", 0 ); } else if($atr == "numLeafClusters") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $leavesTgl, "", 1 ); } else if($atr == "leafLength") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $leavesTgl, "", 0 ); } else if($atr == "leafBaseWidth") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $leavesTgl, "", 0 ); } else if($atr == "leafTipWidth") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $leavesTgl, "", 0 ); } else if($atr == "leafColor1R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1R", 1 ); } else if($atr == "leafColor1G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1G", 1 ); } else if($atr == "leafColor1B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1B", 1 ); } else if($atr == "leafColor2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1R", 1 ); } else if($atr == "leafColor2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1G", 1 ); } else if($atr == "leafColor2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $leavesTgl, "color1B", 1 ); } else if($atr == "numFlowers") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $flowersTgl, "", 1 ); } else if($atr == "petalLength") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $flowersTgl, "", 0 ); } else if($atr == "petalBaseWidth") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $flowersTgl, "", 0 ); } else if($atr == "petalTipWidth") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $flowersTgl, "", 0 ); } else if($atr == "petalColor1R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1R", 1 ); } else if($atr == "petalColor1G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1G", 1 ); } else if($atr == "petalColor1B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1B", 1 ); } else if($atr == "petalColor2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1R", 1 ); } else if($atr == "petalColor2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1G", 1 ); } else if($atr == "petalColor2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $flowersTgl, "color1B", 1 ); } else if($atr == "budSize") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $budsTgl, "", 0 ); } else if($atr == "budColorR") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $budsTgl, "color1R", 1 ); } else if($atr == "budColorG") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $budsTgl, "color1G", 1 ); } else if($atr == "budColorB") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $budsTgl, "color1B", 1 ); } else if($atr == "turbulence") { blendBrushAttribute( $source, $source2, $target, $atr, $shapeBlend, $turbTgl, "", 0 ); } else if($atr == "translucence") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $illumTgl, "", 1.0 ); } else if($atr == "specular") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $illumTgl, "", 0.0 ); } else if($atr == "shadowTransparency") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $fakeShadowTgl, "", 1.0 ); } else if($atr == "texOpacityScale") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapOpacityTgl, "", 0.0 ); } else if($atr == "texOpacityOffset") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapOpacityTgl, "", 0.0 ); } else if($atr == "texColorScale") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColorOffset") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 0.0 ); } else if($atr == "texColor1R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColor1G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColor1B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColor2R") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColor2G") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else if($atr == "texColor2B") { blendBrushAttribute( $source, $source2, $target, $atr, $shadeBlend, $mapColorTgl, "", 1.0 ); } else { $isShade = isShadingBrushAttribute( $atr ); if( $isShade ) $blend = $shadeBlend; else $blend = $shapeBlend; $sFl = getAttr($source + "." + $atr); $sFl2 = getAttr($source2 + "." + $atr); string $type = `getAttr -type ($source2 + "." + $atr)`; if( $type == "double" || $type == "float") { $sFl2 = $sFl2 * (1-$blend) + $sFl * $blend; } else if( $type == "long" || $type == "int") { $sFl2 = (int)($sFl2 * (1-$blend) + $sFl * $blend + 0.5); } else if( $type == "bool" ) { if( $sFl > $sFl2 ) { if( $blend > 0.1 ) { $sFl2 = $sFl; } } else if( $sFl < $sFl2 ) { if( $blend > 0.9 ) { $sFl2 = $sFl; } } } else if( $type == "enum" ) { // enums have a higher switching bias than toggles // representing less features being enabled than // discreet, yet equal, states. We still bias the // higher states a bit more. if( $sFl > $sFl2 ) { if( $blend > 0.25 ) { $sFl2 = $sFl; } } else if( $sFl < $sFl2 ) { if( $blend > 0.45 ) { $sFl2 = $sFl; } } } setAttr ($target + "." + $atr) $sFl2; } } if( $shadeBlend > 0.1 ) { string $fname; // The following logic determines when we decide // to switch file texture names. Obviously it would be // nice to be able to create partway blend between file // textures, but this would involve making the filenames // a compound array attribute(names and blendweights). // note that we will only set a texture name to // null if the shade blend is > .9 if( $fileMapOn || $mapColorTgl || $mapOpacityTgl || $frameExtTgl || $shadeBlend > 0.4 ) { $fname = getAttr( $source + ".imageName"); if( $shadeBlend > .9 || size($fname) > 0 ) { setAttr -type "string" ( $target + ".imageName" ) $fname; } } if( $leafUseTexTgl || $shadeBlend > 0.4 ) { $fname = getAttr( $source + ".leafImage"); if( $shadeBlend > .9 || size($fname) > 0 ) { setAttr -type "string" ( $target + ".leafImage" ) $fname; // force this toggles Off at a lower than normal blending // value( booleans normally switch off only at a .9 blend ) if( $leafUseTexTgl == 2 ) { setAttr ( $target + ".leafUseBranchTex" ) 0; } } } if( $flowerUseTexTgl || $shadeBlend > 0.4 ) { $fname = getAttr( $source + ".flowerImage"); if( $shadeBlend > .9 || size($fname) > 0 ) { setAttr -type "string" ( $target + ".flowerImage" ) $fname; // force this toggles Off at a lower than normal blending // value( booleans normally switch off only at a .9 blend ) if( $flowerUseTexTgl == 2 ) { setAttr ( $target + ".flowerUseBranchTex" ) 0; } } } } if( $shapeBlend > 0 ) { setAttr ($target + ".brushWidth") $newWidth; } }