Use the env command. This stores a list of all currently declared global variables. Then parse through the list comparing the name of the variable that you are checking against the list. Return a 1 if that is in the list and a 0 otherwise.
- What's New in Maya 2025
- Maya 2025 Release Notes
- Maya Installation Help
- Getting Started
- Basics
- Managing Scenes, Files, and Projects
- Interoperability
- USD for Maya
- Flow Retopology for Maya
- Modeling
- Animation
- Character Animation
- Unreal Live Link for Maya
- Character Effects and Environment Building
- Motion Graphics
- Simulation and Effects
- Bifrost for Maya
- Working in Bifrost
- Bifröst Fluids for Maya
- Lighting and Shading
- LookdevX
- Rendering
- Arnold for Maya
- Customizing Maya
- Keyboard Shortcuts
- Environment Variables
- Scripting
- Scripting
- Script Editor
- MEL and Expressions
- MEL Overview
- Run MEL commands
- Values and variables
- Arrays, vectors, and matrices
- Good MEL style
- Controlling the flow of a script
- Attributes
- Procedures
- Animation expressions
- I/O and user interaction
- Debugging, optimizing, and troubleshooting
- Creating interfaces
- About particle expressions
- MEL script nodes
- Advanced MEL programming
- Advanced animation expressions topics
- MEL Command Syntax
- Useful functions
- FAQ on MEL
- Tasks
- Scripting and syntax
- What is the operator for raising to a power?
- How can I find out what variables have been declared?
- How do I list all global variables?
- How can I change an integer to a string?
- Can I specify a dynamic matrix?
- How do I execute a statement created at runtime?
- What is the difference between eval, backquotes, and ()?
- How can I stop a MEL script that is running?
- Why does a conversion error occur when I am expecting a flag argument to be a float?
- Modeling
- Animation, dynamics, and rendering
- Example scripts
- MEL Windows and Editors
- Python
- Dash
- Running venv with mayapy
- Technical Documentation