global proc doColladaSetup () { string $gShelfTopLevel; string $oldpath = `pwd`; chdir "/"; chdir "/Program Files/AliasWavefront/Maya7.0"; chdir "/Program Files/Alias/Maya7.0"; chdir "%MAYA_PATH70%"; string $mayapath = `pwd`; string $bitmap = $mayapath + "/extras/icons/colladaExport.bmp"; string $colladapath = $mayapath + "/bin/plug-ins/COLLADA.mll"; string $cgfxpath = $mayapath + "/bin/plug-ins/cgfxShader.mll"; string $animexportpath = $mayapath + "/bin/plug-ins/animImportExport.mll"; //////////////////PLUGINS///////////////////// //auto load collada pluginInfo -edit -autoload true $colladapath; //load collada waitCursor -state on; $ignoreUpdateCallback = true; catch( `loadPlugin $colladapath`); $ignoreUpdateCallback = false; waitCursor -state off; //auto load anim import/export pluginInfo -edit -autoload true $animexportpath; //load anim import/export waitCursor -state on; $ignoreUpdateCallback = true; catch( `loadPlugin $animexportpath`); $ignoreUpdateCallback = false; waitCursor -state off; //////////////////SHELVES///////////////////// //TODO: add and populate XL tools shelf //polygon shelf export button string $polyshelf[] = `shelfLayout -q -childArray "Polygons"`; int $a = 0; string $polyexists = "no"; while ($a < size($polyshelf)) { if (`shelfButton -query -label $polyshelf[$a]` == "Export Collada (.dae)") { $polyexists = "yes"; } $a = ($a + 1); } if ($polyexists == "no") { shelfButton -parent Polygons -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "Export Collada (.dae)" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "" -image $bitmap -image1 $bitmap -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "colladaExport" -actionIsSubstitute 0 colladapoly; } //animation shelf export button string $animshelf[] = `shelfLayout -q -childArray "Animation"`; int $a = 0; string $animexists = "no"; while ($a < size($animshelf)) { if (`shelfButton -query -label $animshelf[$a]` == "Export Collada (.dae)") { $animexists = "yes"; } $a = ($a + 1); } if ($animexists == "no") { shelfButton -parent Animation -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "Export Collada (.dae)" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "" -image $bitmap -image1 $bitmap -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "colladaExport" -actionIsSubstitute 0 colladaanim; } chdir "/"; chdir $oldpath; confirmDialog -message "Collada setup complete.\nMaya will now close." -button "OK" -defaultButton "OK"; eval `quit -force`; } global proc colladaSetup () { scriptJob -runOnce 1 -conditionFalse busy "doColladaSetup"; }