home *** CD-ROM | disk | FTP | other *** search
- //
- // Copyright (C) 1997-2000 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 8 Dec 1997
- //
- //
- // Procedure Name:
- //
- // clipFX
- //
- // Description:
- // This script adds a menu called ClipFX and then scans a directory called
- // ClipFX which must be located in your scripts directory. The ClipFX menu
- // contains items that execute any scripts found in the ClipFX directory.
- //
- // Warning: You must create a directory called ClipFX
- // and placed it in your ~/maya/scripts/ directory. You should
- // move or symbolically link any scripts that you'd like to have
- // listed in the ClipFX menu into this directory.
- //
- //
- // Tip: An easy way to set up your ClipFX directory is by executing
- // the following commands:
- /*
- mkdir ~/maya/scripts/ClipFX/
- cd ~/maya/scripts/ClipFX/
- ln -s ../*.mel .
- */
- //
- //
- global proc clipFX()
- {
- // If the ClipFX menu exists then delete it so we can make a new one.
- //
- global string $clipFXmenu;
- if (`menu -exists $clipFXmenu`)
- deleteUI $clipFXmenu;
-
- // Create the ClipFX menu and build the name of the ClipFX directory.
- //
- string $name = "ClipFX";
- global string $gMainWindow;
- $clipFXmenu = `menu -p $gMainWindow -to true -l $name`;
- string $directory = `getenv("HOME")` + "/maya/scripts/" + $name + "/";
-
- // Make an array of the script files in the ClipFX directory but remove
- // the .mel from the script file names.
- //
- string $scripts[];
- string $listing = `system("ls " + $directory + "*.mel | " +
- "sed -e 's/.*\\///' -e 's/.mel//'")`;
- tokenize($listing, "\n", $scripts);
-
- // If there were no scripts found then print an error message.
- //
- if (size($scripts) < 1)
- error("No scripts found in " + $directory + "\n");
-
- // Make a menu item for each script file that sources that script file and
- // then executes it.
- //
- string $script;
- for ($script in $scripts)
- menuItem -p $clipFXmenu -l $script
- -c ("source \"" + $name + "/" + $script + ".mel\"; " + $script);
- }
-
-