ah your talking about where it says the camera name in the bottom middle of hte hud? ya guess i could figure out what section of the hud that is in and query for the contents. Thanks EDIT: @haiddasalami that may not be possible the maya.cmds.headsUpDisplay() command requires the hud objects name as a argument, and i don't…
Sorry guys, I don't get email from this board and long weekend here, but thanks for the pointers, will dive into some of these scripts. Really appreciate the help! :)
string $cameras[] = `ls -cameras`;for ($camera in $cameras) { int $isRenderable = `getAttr ($camera+".renderable")`; if ($isRenderable == 1){ //Do whatever you want here print $camera; }} Damn rusty as hell in MEL now haha. Basically each camera has a renderable flag.
ya think i will stick to my method when i know the user will have the viewport as the active pane. since to accomplish that via python mel.eval() needs to be used to get the global variable that is needed. my script that im using this with is a zbrush style viewport snap, so it actually is a safe assumption that it is…
global proc string findNewCurrentModelView() { global string $gMainPane; string $mainPaneCtls[]; string $visPanels[]; string $panelName; string $panelCtl, $edCtl; string $modelEd; int $nArr; int $i; string $newViewFound; string $newView; // // First try to find something in the main pane. // if ($gMainPane != "") {…
@haiddasalami is there anything similar for the camera used as the viewport camera? currently i have to do this hack job import maya.cmds as cmdsdef getCurrentCamera(): ''' gets the current maya viewport camera ''' pan = cmds.getPanel(wf=True) cam = cmds.modelPanel(pan, q=True, camera=True) return camdef…
no good way but here is a really hackish way. edit: will have to post later for you appeenty my phone can't copy and paste python and have it formatted correctly. it is still a big hack job to do since you are actually quwrory the viewport ui element.