View Full Version : embedding ``

11 November 2003, 03:34 AM
Ive been avoiding this since I started with MEL... and I think I've hit a wall.

Is there any way to embed the execute command single quotes? (``)

11 November 2003, 08:28 AM
What do you mean exactly? Do you mean put the backquote statement into another function call, or something like that?

11 November 2003, 12:42 PM
yeah... here's an example, though I'm not even sure if the other code is written right either

textFieldButtonGrp -en (`if (`radioButtonGrp -q -sl doBy`)`) -l "Keyframed Object:" -bl "sel" pfSelectedTFBG;

11 November 2003, 03:28 PM
(`if (`radioButtonGrp -q -sl doBy`)`)

Not sure, but do you need the outer ` 's here? "if" returns 0 or 1 anyway...

11 November 2003, 06:10 PM
textFieldButtonGrp -en (`if (`radioButtonGrp -q -sl doBy`)`) -l "Keyframed Object:" -bl "sel" pfSelectedTFBG;

A couple things. First, dwalden should be tright about the back quotes around the if statement. You shouldn't need them.

So, this could work:

textFieldbuttonGrp -en (if (`radioButtonGrp -q -sl doBoy`)) ...

If it doesn't then try this:

$choice = `radioButton -q -sl $doBoy`;
textFieldbuttomGrp -en if($choice) ...

However, I can't tell if you want the textFieldButton Group to be enabled or disabled only when it's first made, or if you want it to continually update dpepending on the radioButton Group. If you want it to continually update, then you should put a statemnt in the "change command" flag of the radioButton group to affect the enabling of the textFieldButton Group.

11 November 2003, 09:52 PM
You need to use an intermediate variable to store your true or false value in that case. Maya will see the second ` and get confused.

-- Mark

11 November 2003, 03:02 AM
mark_wilkins > That's what I figured. I'm almost happier to finally know that it's not possible than to keep thinking "I might... I'm just doing it wrong"

I ended up achieving what I wanted going a lil backwards from what I was thinking...

-numberOfRadioButtons 2
-label "Do by:"
-labelArray2 "Every Keyframe" "Every Frame"
-on1 "textFieldButtonGrp -e -en 1 pfSelectedTFBG;"
-on2 "textFieldButtonGrp -e -en 0 pfSelectedTFBG;"
-sl 1

textFieldButtonGrp -en 1 -l "Keyframed Object:" -bc "pfAddObj" -bl "sel" pfSelectedTFBG;

Instead of having the text field query the radio boxes, I had the radio boxes edit the text field. Live and learn.

Thanks for the response


CGTalk Moderation
01 January 2006, 05: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.