View Full Version : Cams in marking menu

05 May 2005, 11:37 AM
I am trying to do something fairly simple, but it’s
being a bastard. I want all the perspective cams in a
scene to be under marking menu/hotbox, mapped to a
hotkey. This needs to be dynamic, so when a new cam is
being created in the scene, or a different scene is
opened, the marking menu should update accordingly.

What I wrote works to a certain extent, in that it
only ads the latest created camera.

What am I missing here?

string $allPerspCams[] = `listCameras -p`;
int $numberOfCams = `size $allPerspCams`;
string $editor=modelPanel ("-q", "-me", `getPanel -wf`);

for ($eachCam in $allPerspCams)
-label $eachCam
-divider 0
-subMenu 0
-command "lookThroughModelPanel $eachCam $editor"
-altModifier 0
-optionModifier 0
-commandModifier 0
-ctrlModifier 0
-shiftModifier 0
-optionBox 0
-enable 1
-data 0
-radialPosition "N"
-enableCommandRepeat 1
// -image "commandButton.xpm"
-echoCommand 0
-italicized 0
-boldFont 0
("menuEditorMenuItem" + $eachCam);


setParent -m ..;

05 May 2005, 11:39 AM
you have -radialPosition "N" there. This means any camera it finds will be assigned to the North position of the marking menu.
You'll need to find out which radialPosition is empty and put the new camera in that one.

05 May 2005, 01:39 PM
i tried making it work from the spacebar hotbox centre, but it wasn't playing ball.

05 May 2005, 05:18 PM
look on for a MEL script called alienCameras

05 May 2005, 10:00 PM
thankyou for saving me the time of reinventing the wheel, and not sticking it on my reel for people to say "thats already out"

05 May 2005, 12:40 PM

Thanks for the tip. I am in the process of cannibalizing it.


05 May 2005, 03:00 PM
Almost there...One more problem:

I’m the process of writing a script that dynamically creates marking menus. The thing is, I want the “stuff” (say, selected cameras or available character sets) to appear in the north position of the marking menu, all after each other - or on top of each other if you will. Murphy’s Law states that I will be able to place my items everywhere, except the position where I want.

I can place my items in all directions of the wind using the:
-radialPosition flag: "N","NE","E","SE","S","SW","W","NW"

If I ignore that flag, all the items will be neatly stacked in the S(outh) position.

I can’t for the life of me figure out how to get the stacked in the North position.

Any takers?

CGTalk Moderation
05 May 2005, 03: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.