PDA

View Full Version : Really simple MEL question thats driving me nuts


Hezza
05-15-2006, 05:12 PM
Hi there, I'm trying to setup a facial control system and i've got about 20 curve objects that i want to group individually with a + Grp suffix.

example squintCtrl i want to group under squintCtrlGrp

Now the time i've spent trying to figure this out, i could have manually gone through and typed all the correct names in, but thats not the point anymore, i will conquer this !! :scream:

Here's what i've been trying (this is just to do each one seperately)

-------------------
string $curveName[];
$curveName = `selectedNodes`;
group -n ($curveName + "Gro")
-------------------

But it returns an error
// Error: group -n ($name3 + "Grp"); //
// Error: Illegal operation "+" on data of type string[]. //

The selected node name is definately going into the variable $curveName as i can print $curveName correctly

Now i know i've used the + operation to add on prefix's and suffix's tp strings before, but for the life of me i can't figure out whats going on.

Please any help is greatly appreciated,

Hez

Goon
05-15-2006, 05:25 PM
($curveName[0] + "Grp")

Hezza
05-15-2006, 05:28 PM
Cheers, worked a treat :) Can't beleive it was something so simple, i tried declaring the string without the [] but it wouldn't let me, forgot to put the [0] in

Thanks again
Hez

TimMurphy
05-15-2006, 10:25 PM
Using

========
($curveName[0] + "Grp")
========

will group the first curve but to group all of them under seperate groups try

========
string $curveName[];
$curveName = `selectedNodes`;
for ($curNode in $curveName)
group -n ($curNode + "Grp") $curNode;
========

Tim.

Hezza
05-16-2006, 04:00 PM
Thanks for the reply Tim, i'd already done it the longer way as i was egar to get on with it but ta for explaining. I new it was possible to use an array to count through the selection but it'd have taken me another hour to try and figure it out. (I'm very new to MEL :) )

I tried what you said tho and it works lovely, its now saved under my scripts.

I've nearly finished setting up the head, had some major issues with blendshapes and the clamp command, things not adding up to 1 and what not, it was those pesky brakets not being in the right place.

http://www.hezza.co.uk/misc/UITest.avi

http://www.hezza.co.uk/head/renders.jpg

Cheers again guys
Hez

CGTalk Moderation
05-16-2006, 04:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.