// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // AEpfxToonTemplate // // Description Name; // Creates the attribute editor controls for the pfxToon Node // // Input Value: // nodeName // // Output Value: // None // global proc AEpfxToonWidthmapNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEpfxToonTemplate.kLineWidthMap")) -at $attrName widthControl; setUITemplate -ppt; } global proc AEpfxToonWidthmapReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName widthControl; } global proc AEpfxToonOpacitymapNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEpfxToonTemplate.kLineOpacityMap")) -at $attrName opacityControl; setUITemplate -ppt; } global proc AEpfxToonOpacitymapReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName opacityControl; } global proc AEpfxToonLineOffsetNew (string $attrName ) { setUITemplate -pst attributeEditorTemplate; attrNavigationControlGrp -label (uiRes("m_AEpfxToonTemplate.kLineOffsetMap")) -at $attrName lineOffsetControl; setUITemplate -ppt; } global proc AEpfxToonLineOffsetReplace (string $attrName ) { attrNavigationControlGrp -edit -at $attrName lineOffsetControl; } global proc AEpfxToonCheckResample( string $node ) { int $on = `getAttr ($node + ".profileLines")`; if( $on ){ $on = `getAttr ($node + ".resampleProfile")`; } if( !$on ){ $on = `getAttr ($node + ".creaseLines")`; if( $on ){ $on = `getAttr ($node + ".resampleCrease")`; } if( !$on ){ $on = `getAttr ($node + ".borderLines")`; if( $on ){ $on = `getAttr ($node + ".resampleBorder")`; } if( !$on ){ $on = `getAttr ($node + ".intersectionLines")`; if( $on ){ $on = `getAttr ($node + ".resampleIntersection")`; } } } } editorTemplate -dimControl $node "minSegmentLength" (!$on); editorTemplate -dimControl $node "maxSegmentLength" (!$on); editorTemplate -dimControl $node "screenSpaceResampling" (!$on); } global proc AEpfxToonCheckSmoothProfile( string $node ) { int $on = `getAttr ($node + ".profileLines")`; if( $on ){ $on = `getAttr ($node + ".smoothProfile")`; } editorTemplate -dimControl $node "tighterProfile" (!$on); } global proc AEpfxToonCheckProfile( string $node ) { int $on = `getAttr ($node + ".profileLines")`; editorTemplate -dimControl $node "profileLineWidth" (!$on); editorTemplate -dimControl $node "depthOffset" (!$on); editorTemplate -dimControl $node "profileColor" (!$on); editorTemplate -dimControl $node "profileWidthModulation" (!$on); editorTemplate -dimControl $node "smoothProfile" (!$on); editorTemplate -dimControl $node "profileBreakAngle" (!$on); AEpfxToonCheckSmoothProfile( $node ); AEpfxToonCheckResample( $node ); } global proc AEpfxToonCheckCrease( string $node ) { int $on = `getAttr ($node + ".creaseLines")`; editorTemplate -dimControl $node "creaseLineWidth" (!$on); editorTemplate -dimControl $node "creaseAngleMin" (!$on); editorTemplate -dimControl $node "creaseAngleMax" (!$on); editorTemplate -dimControl $node "hardCreasesOnly" (!$on); editorTemplate -dimControl $node "backfacingCreases" (!$on); editorTemplate -dimControl $node "creaseColor" (!$on); editorTemplate -dimControl $node "creaseWidthModulation" (!$on); editorTemplate -dimControl $node "creaseBreakAngle" (!$on); AEpfxToonCheckResample( $node ); } global proc AEpfxToonCheckFlushBorders( string $node ) { int $borderOn = `getAttr ($node + ".borderLines")`; int $on = $borderOn &&(`getAttr ($node + ".removeFlushBorders")`); editorTemplate -dimControl $node "flushTolerance" (!$on); editorTemplate -dimControl $node "flushAngleMax" (!$on); } global proc AEpfxToonCheckBorder( string $node ) { int $on = `getAttr ($node + ".borderLines")`; editorTemplate -dimControl $node "borderLineWidth" (!$on); editorTemplate -dimControl $node "borderColor" (!$on); editorTemplate -dimControl $node "borderWidthModulation" (!$on); editorTemplate -dimControl $node "borderBreakAngle" (!$on); editorTemplate -dimControl $node "removeFlushBorders" (!$on); AEpfxToonCheckResample( $node ); AEpfxToonCheckFlushBorders( $node ); } global proc AEpfxToonCheckIntersection( string $node ) { int $on = `getAttr ($node + ".intersectionLines")`; editorTemplate -dimControl $node "intersectionLineWidth" (!$on); editorTemplate -dimControl $node "intersectionAngleMin" (!$on); editorTemplate -dimControl $node "intersectionAngleMax" (!$on); editorTemplate -dimControl $node "intersectionColor" (!$on); editorTemplate -dimControl $node "intersectionWidthModulation" (!$on); editorTemplate -dimControl $node "intersectionBreakAngle" (!$on); editorTemplate -dimControl $node "selfIntersect" (!$on); AEpfxToonCheckResample( $node ); } global proc AEpfxToonCheckScreenspace ( string $node ) { int $sOn = `getAttr ($node+".screenspaceWidth")`; int $dim = !$sOn; editorTemplate -dimControl $node "distanceScaling" $dim; editorTemplate -dimControl $node "minPixelWidth" $dim; editorTemplate -dimControl $node "maxPixelWidth" $dim; } // // Procedure Name: // AEbrushTemplate // global proc AEpfxToonTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -suppress "useObjectColor"; editorTemplate -suppress "objectColor"; editorTemplate -suppress "objectColorRGB"; editorTemplate -suppress "drawOverride"; editorTemplate -suppress "brush"; editorTemplate -suppress "renderToons"; editorTemplate -suppress "curveMode"; editorTemplate -suppress "leafCurveMode"; editorTemplate -suppress "flowerCurveMode"; editorTemplate -suppress "lineModifier"; editorTemplate -suppress "inputSurface"; editorTemplate -interruptOptimize; // PfxToon Render // editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kCommonToonAttr")) -collapse 0; editorTemplate -addControl "displayInViewport"; editorTemplate -addControl "profileLines" "AEpfxToonCheckProfile"; editorTemplate -addControl "borderLines" "AEpfxToonCheckBorder"; editorTemplate -addControl "creaseLines" "AEpfxToonCheckCrease"; editorTemplate -addControl "intersectionLines" "AEpfxToonCheckIntersection"; editorTemplate -addControl "lineWidth"; editorTemplate -callCustom "AEpfxToonWidthmapNew" "AEpfxToonWidthmapReplace" "lineWidthMap"; editorTemplate -addControl "lineOffset"; editorTemplate -callCustom "AEpfxToonLineOffsetNew" "AEpfxToonLineOffsetReplace" "lineOffsetMap"; editorTemplate -addControl "lineEndThinning"; editorTemplate -addControl "lineExtend"; editorTemplate -addControl "lineOpacity"; editorTemplate -callCustom "AEpfxToonOpacitymapNew" "AEpfxToonOpacitymapReplace" "lineOpacityMap"; editorTemplate -addControl "lightingBasedWidth"; editorTemplate -addControl "occlusionWidthScale"; editorTemplate -addControl "localOcclusion"; editorTemplate -addControl "occlusionTolerance"; editorTemplate -addControl "depthBias"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kProfileLines")) -collapse 1; editorTemplate -addControl "profileColor"; editorTemplate -addControl "profileLineWidth"; editorTemplate -addControl "profileWidthModulation"; editorTemplate -addControl "profileBreakAngle"; editorTemplate -addControl "depthOffset"; editorTemplate -addControl "smoothProfile" "AEpfxToonCheckSmoothProfile"; editorTemplate -addControl "tighterProfile"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kCreaseLines")) -collapse 1; editorTemplate -addControl "creaseColor"; editorTemplate -addControl "creaseLineWidth"; editorTemplate -addControl "creaseWidthModulation"; editorTemplate -addControl "creaseBreakAngle"; editorTemplate -addControl "creaseAngleMin"; editorTemplate -addControl "creaseAngleMax"; editorTemplate -addControl "hardCreasesOnly"; editorTemplate -addControl "backfacingCreases"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kBorderLines")) -collapse 1; editorTemplate -addControl "borderColor"; editorTemplate -addControl "borderLineWidth"; editorTemplate -addControl "borderWidthModulation"; editorTemplate -addControl "borderBreakAngle"; editorTemplate -addControl "removeFlushBorders" "AEpfxToonCheckFlushBorders"; editorTemplate -addControl "flushTolerance"; editorTemplate -addControl "flushAngleMax"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kIntersectionLines")) -collapse 1; editorTemplate -addControl "intersectionColor"; editorTemplate -addControl "intersectionLineWidth"; editorTemplate -label (uiRes("m_AEpfxToonTemplate.kIntersectWidthModulation")) -addControl "intersectionWidthModulation"; editorTemplate -addControl "intersectionBreakAngle"; editorTemplate -addControl "intersectionAngleMin"; editorTemplate -addControl "intersectionAngleMax"; editorTemplate -addControl "selfIntersect"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kCurvatureBasedWidthScaling")) -collapse 1; editorTemplate -addControl "curvatureModulation"; AEaddRampControl ($nodeName+".curvatureWidth"); editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kLineResampling")) -collapse 1; editorTemplate -addControl "resampleProfile" "AEpfxToonCheckResample"; editorTemplate -addControl "resampleCrease" "AEpfxToonCheckResample"; editorTemplate -addControl "resampleBorder" "AEpfxToonCheckResample"; editorTemplate -addControl "resampleIntersection" "AEpfxToonCheckResample"; editorTemplate -addControl "minSegmentLength"; editorTemplate -addControl "maxSegmentLength"; editorTemplate -addControl "screenSpaceResampling"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kScreenspaceWidthControl")) -collapse 1; editorTemplate -addControl "screenspaceWidth" "AEpfxToonCheckScreenspace"; editorTemplate -addControl "distanceScaling"; editorTemplate -addControl "minPixelWidth"; editorTemplate -addControl "maxPixelWidth"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kStrokeAttributes")) -collapse 1; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kDisplayQuality")) "displayPercent"; editorTemplate -addControl "drawAsMesh"; editorTemplate -addControl "sampleDensity"; editorTemplate -addControl "seed"; editorTemplate -addControl "drawOrder"; editorTemplate -addControl "surfaceOffset"; editorTemplate -addControl "pfxRandomize"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kControlCurves")) -collapse 1; editorTemplate -addControl "controlCurve"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kMeshOutput")) -collapse 1; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kColorPerVertex")) "meshVertexColorMode"; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kHardEdges")) "meshHardEdges"; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kOutputQuads")) "meshQuadOutput"; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kPolyLimit")) "meshPolyLimit"; editorTemplate -addControl "cameraPoint"; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kMeshVertexDetails")) -collapse 1; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kMainVertexBuffer")) "mainVertBufSize"; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kLeafVertexBuffer")) "leafVertBufSize"; editorTemplate -addControl -label (uiRes("m_AEpfxToonTemplate.kFlowerVertexBuffer")) "flowerVertBufSize"; editorTemplate -endLayout; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kNurbsOutput")) -collapse 1; editorTemplate -addControl "degree"; editorTemplate -addControl "curveAlign"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEpfxToonTemplate.kRenderStats")) -collapse 1; editorTemplate -addControl "motionBlurred"; editorTemplate -addControl "primaryVisibility"; editorTemplate -endLayout; // include/call base class/node attributes AEshapeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }