diff --git a/GETOOLS_SOURCE/modules/GeneralWindow.py b/GETOOLS_SOURCE/modules/GeneralWindow.py index bf40564..e9ccccb 100644 --- a/GETOOLS_SOURCE/modules/GeneralWindow.py +++ b/GETOOLS_SOURCE/modules/GeneralWindow.py @@ -195,6 +195,8 @@ def FramesCollapse(self, value, *args): # TODO collapse function for sub frames cmds.frameLayout(self.frameExperimental, edit = True, collapse = value) # DOCKING + def DockCheckVisible(self, *args): + return cmds.dockControl(Settings.dockName, query = True, visible = True) def DockCheck(self, *args): return cmds.dockControl(Settings.dockName, query = True, exists = True) def DockDelete(self, *args): @@ -225,9 +227,10 @@ def RUN_DOCKED(self, path = "", forced = False, *args): self.directory = path if (forced == False and self.DockCheck()): # for script toggling. Comment these 3 lines if you need to deactivate toggling - self.DockDelete() - print("{0} closed".format(GeneralWindow.title)) - return + if (self.DockCheckVisible()): + self.DockDelete() + print("{0} closed".format(GeneralWindow.title)) + return self.DockDelete() self.WindowCreate()