Oct 2009
1 / 3
Oct 2009
Nov 2009

I would like to build an optionMenu that will list any objects that i have selected within the scene

I am able to build a GUI containing the optionMenu controll but cannot figure out how to pass the names of the selected objects into the -label flag for the menuItem command.

Any ideas?

  • created

    Oct '09
  • last reply

    Nov '09
  • 2

    replies

  • 3.4k

    views

  • 1

    user

string $window = window;
$selection=ls -sl;
columnLayout;
optionMenu -label "Objects" -changeCommand "print #1";
for ($item in $selection)
menuItem -label $item;
showWindow $window;

THANK YOU JOOJAA !

I knew it had to be something simple ! Everything that I was trying felt a bit too complicated.

I had originally tried to create a function to return a list of names, using a for loop, before I set up any commands related to the window itself. I then tried to stick to call to the function in after the optionMenu command.

Thanks again for the help !

Paul

Suggested Topics

Want to read more? Browse other topics in Maya or view latest topics.