Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Collecting names from "SHOW" dropdown menu

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
bandrzejewski
416 Views, 6 Replies

Collecting names from "SHOW" dropdown menu

Dear ones!
Do any of you know how to collect the names of nodes that are displayed in the "SHOW" window dropped down in the viewport menu by  mel or pymel?

bandrzejewski_0-1612813824332.png

Thanx for help 🙂

6 REPLIES 6
Message 2 of 7

Under the Select>AllByType you can see the type listing, and with EchoAllCommands you can get the mel analogue which can be injected into py.

SelectAllNURBSSurfaces;
select -r `listTransforms "-type nurbsSurface"`;
ls -selection -type "transform";
// Result: nurbsSphere1 nurbsSphere3 nurbsSphere2 nurbsSphere4 //


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 3 of 7

Thank you for your answer!
Maybe my English is not perfect, but I don't want to list objects of a given type from the scene, but just to list the types of objects that appear in the SHOW menu.

I can ask the nurbsCurves checkbox state by
modelEditor -q -nurbsCurves modelPanel4;
// Result: 1 //


but how to ask - which of the types in the list have status 1 to have Result e.g:
nurbsCurves, nCloths, motionTrails, greasePencils ...
...and so on

Message 4 of 7

You might be looking for

modelEditor -q -nurbsSurfaces modelPanel4;
modelEditor -e -nurbsSurfaces false modelPanel4;
modelEditor -q -nurbsSurfaces modelPanel4;

Look up into command reference for modelEditor, there's also Py version.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 5 of 7

Nope, because it returns me the state of "nurbsSurfaces" checkbox , not the name of its flag.

Believe me, if it were so easy, I wouldn't ask 🙂 I am currently analyzing the core Maya scripts to find .mel which builds the viewport menus 🙂
Thanks anyway 🙂

Message 6 of 7

well.. for my perspView

popupMenu -q -ia MainPane|viewPanes|modelPanel4|modelPanel4|menu26
// Result: menuItem3550 menuItem3551 showAllItem showNoneItem menuItem3552 showControllersItem showNurbsCurvesItem showNurbsSurfacesItem showNurbsCVsItem showNurbsHullsItem showPolymeshesItem showSubdivSurfacesItem showPlanesItem showLightsItem showCamerasItem showImagePlaneItem showJointsItem showIkHandlesItem showDeformersItem showDynamicsItem showParticleInstancersItem showFluidsItem showHairSystemsItem showFolliclesItem showNClothsItem showNParticlesItem showNRigidsItem showDynamicConstraintsItem showLocatorsItem showDimensionsItem showPivotsItem showHandlesItem showTexturesItem showStrokesItem showMotionTrailsItem showPluginShapesItem showClipGhostsItem showGreasePencilsItem showPluginObjectsItem_gpuCacheDisplayFilter menuItem3553 showManipulatorsItem showGridItem showHUDItem showHoldOutsItem showSelectionItem menuItem3554 menuItem3555 // 

 Turn on echo all commands to find the panel you need. Command reference is your friend there.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 7 of 7

oh ... and it looks promising 🙂

import maya.cmds as cmds
list = cmds.popupMenu("MainPane|viewPanes|modelPanel1|menu14",q=1,ia=1) # name of window
for obj in list:
    if 'show' in obj:
        if 'All' in obj or 'None' in obj:pass
        else:print obj[4].lower()+obj[5:-4]

 It works FINE !!!! 
GREAT!!!

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

Post to forums  

Autodesk Design & Make Report