Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   mel scripts (https://simplymaya.com/forum/showthread.php?t=25066)

mpepperhouse 13-02-2007 01:26 PM

mel scripts
 
hi,
i downloaded the plane explosion tutorial and there are mel scripts that come with it. the thing is i do not know how to load these into maya so they appear in the shelf? can someone help me with this? a notepad file says to set the project to this file but i tried with no joy. what am i doing wrong?

update: i have managed to get it onto the shelf by copying and pasting the script into the script editor. i then saved it to the shelf but, when i click on it, it says synatx error. i tried again and then, just nothing happened.
where am i going wrong....thanks :)

much appreciated. :)

publicFunction 13-02-2007 03:11 PM

Try running the scripts on there own and not thru the shelf. If you get the same issue, then it's time for some reverse engneering of the script. IF not then remove the MEL icons from the shelf and recreate them.

mpepperhouse 15-02-2007 08:50 AM

hi, thanks for replying.
i deleted the icons on the shelf and started again, but still getting a syntax error.
i do not know anything about scripting so can you tell me what reverse engineering means?
as i say it is the mel script i downloaded from this website for the explosion tutorial.

thanks :)

publicFunction 15-02-2007 08:53 AM

I don't have that tutorial, so I cant access the MEL script. Reverse engineering would require good knowledge of MEL. In the script editor can you copy and paste the error in full.

mpepperhouse 15-02-2007 08:57 AM

this is the script.....i cant say i know what any of it means.....i have maya.6.5




//detachSeparate.mel v1.1
//Jeff Dobson 7/2/01
//jeffdobs@swbell.net
//
//DESCRIPTION: This script will effectively detach and separate selected faces from a poly mesh.
//Advantages of this script over Maya's built in detach/separate is that this script doesn't create
//a third parent node. It also allows you to break off only the selected faces as opposed to exploding
//every sub-mesh of an object.
//SETUP: Create a shelf button or hotkey with the command detachSeparate;
//ICON: detachSeparate.bmp
//HISTORY: 7/20/01 - v1.1 -- Changed duplicate command to -un from -rr. Fixes bug that leaves an extra
// shape node when script is run on an object with an extrude in its history.


global proc detachSeparate()
{
string $nameSplitSkip[];
string $faceNum[];
string $temp[];
string $newObj[];
string $newFaceSel[];

string $origFaceSel[] = `filterExpand -ex 1 -sm 34`;
string $origObjShape[] = `listRelatives -p $origFaceSel`;
string $origObj[] = `listRelatives -p $origObjShape`;

//Get my selected face numbers into $faceNum
for ($step = 0, $skip = 0; $step < size($origFaceSel); $step++, $skip++)
{
tokenize $origFaceSel[$step] "." $temp;
$nameSplitSkip[$skip] = $temp[0];
$skip++;
$nameSplitSkip[$skip] = $temp[1];
clear $temp;
}

for ($step2 = 0, $skip2 = 1; $step2 < (size($nameSplitSkip)/2); $step2++, $skip2 = $skip2 + 2)
{
$faceNum[$step2] = $nameSplitSkip[$skip2]; //every other value
}

//Dupe original object
$newObj = `duplicate -un $origObj[0]`;
delete -ch $newObj[0];
string $newAllFaces[] = `ls ($newObj[0] + ".f[*]")`;

//Make new array for face selection on $newObj
for ($step3 = 0; $step3 < size($faceNum); $step3++)
{
$newFaceSel[$step3] = ($newObj[0] + "." + $faceNum[$step3]);
}
;
// Error: //
// Error: Syntax error //

mpepperhouse 15-02-2007 10:07 AM

i have tried a new mel script and the same happens. there must be something i am doing wrong but have no ida what. perhaps not installing it correctly....hmmm, puzzles me :confused:


All times are GMT. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018