Expressions within MEL

I have written a Script that duplicates a curve 17 times (18 pieces), turns all into soft objects and rotates each 20 degrees multiplicated with its index (so all 18 pieces shape a circle). Now I have written an expression, but there is a variable, thet needs to be multiplicated with the index, too, and thats the problem. When you use eval command, you use quotation marks, wherein you use dynExpression command, again with quotation marks, so that MAYA interprets the second marks as the end of the string of the eval command. Anybody knows a sollution ?!?

Force be with you, the Koernel !!!

Found out a workaround for that problem, but it is not a real sollution (maybe it

you have to use the escape character to tell maya that your quotes are nested and that the quotation mark in question is the start of another set, not the end of the first.........

i would concatenate the second command with quotes into a string variable and then use that variable in the first command.

to get a set of quotes in a built command without having mel see them as what mel normally sees quotes as,...

(this is an example of a very similar problem from FS_KEYPOSER for irix found on the "animation" mel stack on this site)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$makethis = ("system " +""" + "touch " + $startPath + "/POSES/" + $NAME +""" + ";" );

eval $makethis;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

notice the """ this allows the quote to be seen as a character to be recorded in a string, not as a "".

i know this is not exactly what you need, but there should be a way to get what you want without a workaround by somehow using the escape sequence to tell mel how to see your quotes

hope this helps...

therrell
FATHOM STUDIOS
Atlanta

Also: look at the expression command in the script window when you create an expression. This will show you the proper (and very convoluted) syntax.

Thomas Briggs
## Never confuse motion with action
www.mainnet.com/tbriggs

Yes, I have done this, but the script editor writes: dynExpression " blah, blah, blah "; This quotationmarks were the problem. I think therrells sollution is up to now the one and only.

Force be with you, the Koernel !!!

i'm a senior working on my thesis in computer animation. i'm taking a mel scripting class that is required for graduation and i'm really having problems in it due to the massive time involved working on my thesis. for the mel class, we have a final project to do in which we have to create a user interface window with a slider that controls an objects attributes. what i was going to to do is make a slider that controls the rate in which my main character's heart beats (from my thesis). i'm really in the dark as to how to do this and i really have no time to sit down and try and figure it out, so if anyone out there can give me a hand with this, it'd be greatly appreciated. reply quickily, because the due date is in a week and half. thanks again.

Here's a function I wrote for my own thesis project (in architecture) that takes a list of joint names, gets some of their attribute values then constructs a window with sliders and collapsable frames to control the attribute settings.

DM

// ......................................................................
//
// function : drawU2kParamControl
//
// date : 991201
// desc. :
// inputs : (string) list of joints connecting bays
// (string) name of IKhandle at end of skeleton
// outputs : (int) returns 1 if successful
// ......................................................................

global proc int drawU2kParamControl(string $_jointList[],string $_ikHandleName)
{
// constants
string $jointList[] = $_jointList;
string $ikHandleName = $_ikHandleName;
string $thisWindow = "Unite Parameter Contol Panel";

// variable declarations
string $cmdString;
string $joint;		// current joint
int $count,$i;

// WINDOW DESCRIPTION
window -menuBar true -t $thisWindow -rtf true -w 430 -h 400 $thisWindow;

	// window contents
	rowColumnLayout 
		-numberOfRows 3 
		-rowHeight 1 50 -rowHeight 2 400 -rowHeight 3 50 
		-rowSpacing 1 3	-rowSpacing 2 3
		-width 430
		toolOptions;

	// tool information zone
	rowColumnLayout -numberOfColumns 2 -cw 1 150 -cs 1 10 -cs 2 10 toolInfo;
		text -label "Tool Options" -al right;
		textField -tx "Unite 2K Generator" -w 220;

	// scrollable parameter input region
	scrollLayout -width 430 -cr true -p toolOptions u2kOptions;
		columnLayout -adjustableColumn true -rowSpacing 5;

			// GENERATE A FRAME LAYOUT FOR EACH JOINT
			for ($i=0;$i					{
				$joint = $jointList[$i];
				$cmdString = "Bay Control: " + $joint;
				frameLayout -label $cmdString -mh 5 -cll true -borderStyle "etchedOut";
					columnLayout;
					text -l "  Position " -al right;
					$cmdString = $joint + ".tx";
					attrFieldSliderGrp -min (-100) -max 100 -label "Translate X" -cal 1 right -at $cmdString;
					$cmdString = $joint + ".ty";
					attrFieldSliderGrp -min (-50) -max 50 -label "Translate Y" -cal 1 right -at $cmdString;
					$cmdString = $joint + ".tz";
					attrFieldSliderGrp -min (-50) -max 50 -label "Translate Z" -cal 1 right -at $cmdString;

					text -l "  Rotation " -al right;
					$cmdString = $joint + ".rz";
					attrFieldSliderGrp -min 0 -max 360 -label "Rotate Z" -cal 1 right -at $cmdString;
						setParent ..;
					setParent ..;
				}

			$cmdString = "Bay Control: " + $ikHandleName;
				frameLayout -label $cmdString -mh 5 -cll true -borderStyle "etchedOut";
					columnLayout;
					text -l "  Position " -al right;
					$cmdString = $ikHandleName + ".tx";
					attrFieldSliderGrp -min -50 -max 50 -label "Translate X" -cal 1 right -at $cmdString;
					$cmdString = $ikHandleName + ".ty";
					attrFieldSliderGrp -min -50 -max 50 -label "Translate Y" -cal 1 right -at $cmdString;
					setParent ..;
					setParent ..;


	// window control buttons
	// rowColumnLayout -numberOfRows 1 -p toolOptions windowControlButtonsRegion;
		// button -l "Reset" -w 150 -h 75;
		// button -l "Close" -w 150 -h 75;
		// setParent ..;

showWindow;

return (1);

} // drawU2kParamControl