Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MEL command - add a list of items into menuItem labels?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
403 Views, 1 Reply

MEL command - add a list of items into menuItem labels?

string $selection[] = `ls -sl` ;


---

 

optionMenu -label "----";

menuItem -label "$selection[0]";

menuItem -label "$selection[1]";

menuItem -label "$selection[2]";

 

now my problem is .. sometimes the $selection may have, say 5 items .. sometimes it may have 10.

 

help me

1 REPLY 1
Message 2 of 2
TechToast
in reply to: Anonymous

You just need a "for" loop like this:

 

for ($object in $selection)

    menuItem -label $object;

 

Mike

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report