Message 1 of 1
Adding a dynamic menu to hotbox zone marking menu ..is it possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm trying to add a list of my scene's perspective cameras to my hotbox. This has been a feature I've always wished Maya could have...and so I'm venturing down dark twisted roads....bleh.
I can get it to list out a menu, but I have to keep executing my script to update it.
I'd also love it if I could get it to show just below the existing Hotbox -Center zone's marking menu.
Not sure if you can add something dynamically created there...yes?no?maybe?help?
Here's what I have so far....I've taken code from maya scripts folder.
Any and all help is greatly appreciated!
Thanks
I'm trying to add a list of my scene's perspective cameras to my hotbox. This has been a feature I've always wished Maya could have...and so I'm venturing down dark twisted roads....bleh.
I can get it to list out a menu, but I have to keep executing my script to update it.
I'd also love it if I could get it to show just below the existing Hotbox -Center zone's marking menu.
Not sure if you can add something dynamically created there...yes?no?maybe?help?
Here's what I have so far....I've taken code from maya scripts folder.
Any and all help is greatly appreciated!
Thanks
$panelz = `getPanel -withFocus`;
global proc buildPerspLookthruHBMenu( string $parent, string $panelz)
{
$panelz = `getPanel -withFocus`;
string $panelzType = `getPanel -to $panelz`;
if ($panelzType == "modelPanel")
{
print $panelz;
string $cameras[] = `listCameras -perspective`;
string $Ocameras[] = `listCameras -orthographic`;
// Rebuild menu
//
setParent -m $parent;
menu -e -deleteAllItems $parent;
python("from maya.app.stereo import stereoCameraRig");
for ($camera in $cameras)
{
// Prune out any children of camera rigs. Non camera
// rigs only have 1 camera.
//
int $isMono = python("stereoCameraRig.rigRoot('"+$camera+"') == ''");
if ($isMono)
{
menuItem -l $camera -command
("lookThroughModelPanel "+$camera+" "+$panelz);
}
}
python("from maya.app.stereo import stereoCameraRig");
for ($Ocamera in $Ocameras)
{
// Prune out any children of camera rigs. Non camera
// rigs only have 1 camera.
//
int $isMono = python("stereoCameraRig.rigRoot('"+$Ocamera+"') == ''");
if ($isMono)
{
menuItem -l $Ocamera -command
("lookThroughModelPanel "+$Ocamera+" "+$panelz);
}
}
}
}
buildPerspLookthruHBMenu("MayaWindow|HotboxCenter1", $panelz);