PDA

View Full Version : embedding ``


Doogie
11-17-2003, 02: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? (``)

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

Doogie
11-17-2003, 11:42 AM
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;

dwalden74
11-17-2003, 02:28 PM
(`if (`radioButtonGrp -q -sl doBy`)`)

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

ajk48n
11-17-2003, 05: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.

mark_wilkins
11-19-2003, 08: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

Doogie
11-20-2003, 02: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...


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

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

-Paul

CGTalk Moderation
01-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.