SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Programming / A way to open/close a window by a single hotkey

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
 
Thread Tools
22-01-2019, 03:37 AM   #1
Oxnard
Registered User
 
Join Date: Jan 2019
Posts: 2
A way to open/close a window by a single hotkey
Hi everyone!
I'm new to scripting in Maya, so my apologies if thats a stupid question but I can't find any working solution for me in Google.
I've recently tried to customise my UI and I encountered a problem. I wanted to make Tool Settings to appear by a hotkey, and if the window is already opened, to close it. First I tried to make a hotkey for Tool Settings window itself, but it only opens it, I can't close it that way. Next I tried to write a simple script to do this, but I can't find any way to close a window in either MEL or Python. Is there any expression to close this particular window?
Many thanks in advance!
  Reply with quote
23-01-2019, 12:25 AM   #2
Oxnard
Registered User
 
Join Date: Jan 2019
Posts: 2
I was finally able to find it. If anyone's intrested, this is the expression:

ToggleToolSettings;
getUIComponentDockControl("Tool Settings", false);
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Texture Project: By David James | #Window #Brick David Texture Upload & Collaboration system 0 20-11-2018 05:37 AM
skyscraper window reflection? timmp Maya Materials & Textures 0 12-11-2018 06:01 AM
Render View Window: multiple images djvfx Maya Basics & Newbie Lounge 5 02-11-2015 05:59 PM
Management of GUI window elements Grimt Programming 3 12-04-2014 09:10 PM
asign sliderFunction to costum window Falott Programming 2 31-07-2008 12:07 AM