//=========================================================================== //maya2q3 - export .md3 files from maya //Copyright (C) 2005 HermitWorks Entertainment Corporation // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either version 2 //of the License, or (at your option) any later version. //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. // //You should have received a copy of the GNU General Public License //along with this program; if not, write to the Free Software //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //=========================================================================== proc AEQ3ShaderFillList( string $list, string $items[] ) { string $s; for( $s in $items ) { if( $s == "dismiss" ) $s = "dismiss "; textScrollList -e -a $s $list ; } } global proc AEQ3ShaderFilterShaders( string $ftl, string $te ) { string $text = `textField -q -tx $te` ; string $shaders[] = `maya2q3 -sl -f $text` ; textScrollList -e -ra $ftl ; AEQ3ShaderFillList( $ftl, $shaders ); } global proc AEQ3ShaderBrowseShadersLayout( ) { string $parent = `setParent -q` ; formLayout -e -w 300 $parent; string $te = `textField` ; string $ftl = `textScrollList -nr 6 -ams false` ; string $tl = `textScrollList -nr 24 -ams false` ; string $shaders[] = `maya2q3 -sl` ; AEQ3ShaderFillList( $tl, $shaders ); textScrollList -e -dcc ("layoutDialog -dis `textScrollList -q -si " + $tl + "`") $tl ; textField -e -cc ("AEQ3ShaderFilterShaders( \"" + $ftl + "\", \"" + $te + "\" )") $te ; textScrollList -e -dcc ("layoutDialog -dis `textScrollList -q -si " + $ftl + "`") $ftl ; string $ba = `button -l "Select" -c ("layoutDialog -dis `textScrollList -q -si " + $tl + "`")` ; string $bc = `button -l "Cancel" -c "layoutDialog -dis \"dismiss\""` ; formLayout -e -af $te "top" 8 -af $te "left" 8 -af $te "right" 8 -ac $ftl "top" 8 $te -af $ftl "left" 8 -af $ftl "right" 8 -ac $tl "top" 8 $ftl -af $tl "left" 8 -af $tl "right" 8 -af $tl "bottom" 38 -ac $ba "top" 8 $tl -af $ba "left" 8 -ap $ba "right" 8 50 -af $ba "bottom" 8 -ac $bc "top" 8 $tl -ap $bc "left" 8 50 -af $bc "right" 8 -af $bc "bottom" 8 $parent ; } global proc AEQ3ShaderBrowseShaders( string $attrName ) { string $opt = `layoutDialog -t "Select Shader" -ui "AEQ3ShaderBrowseShadersLayout"` ; if( $opt != "dismiss" ) { if( $opt == "dismiss " ) $opt = "dismiss" ; setAttr -typ "string" $attrName $opt ; } } global proc AEQ3ShaderNameNew( string $shaderAttrib ) { setUITemplate -pst attributeEditorTemplate ; rowLayout -nc 3 shaderNameLayout ; text -l "Shader Name" ; textField shaderNameField ; symbolButton -image "navButtonBrowse.xpm" browser ; setParent .. ; setUITemplate -ppt ; AEQ3ShaderNameReplace $shaderAttrib ; } global proc AEQ3ShaderNameReplace( string $shaderAttrib ) { connectControl shaderNameField $shaderAttrib ; button -e -c ("AEQ3ShaderBrowseShaders " + $shaderAttrib) browser ; } global proc AEQ3ShaderTemplate( string $nodeName ) { //AEswatchDisplay $nodeName ; editorTemplate -bsl ; //editorTemplate -ac "shaderName" ; editorTemplate -ccu "AEQ3ShaderNameNew" "AEQ3ShaderNameReplace" "shaderName" ; editorTemplate -bl "Display Attributes" -collapse 0 ; editorTemplate -ac "animTime" ; editorTemplate -ac "dispColor" ; editorTemplate -el ; // From parent editorTemplate -s "outColor" ; editorTemplate -s "outTransparency" ; editorTemplate -s "outMatteOpacity" ; editorTemplate -s "outGlowColor" ; editorTemplate -s "enableHwShading" ; //AEdependNodeTemplate $nodeName ; editorTemplate -aec ; editorTemplate -esl ; }