has anyone build dockable file dialog box ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  10 October 2012
Red face has anyone build dockable file dialog box ?

I am wondering if some one has made a dockable file open dialog box or do I have to make it from scratch?

If I have to build it all from scratch then I'd need some pointers, I do not want the bottom File name part and file type part, I am more interested in a dropdown in which text can be entered choose a different path , and the file folder view at the bottom of it....

the optionMenuGrp lets build drop down but text is not editable, and how do I show icon images in iconTextScrollList like shown above in the file/folder browser

I would guess it is doable using PyQt but is it doable just with cmd module...?
Attached Images
File Type: png fileopener.png (22.3 KB, 71 views)

Last edited by DEVILSAN : 10 October 2012 at 05:56 AM.
 
  10 October 2012
A file dialog has to be modal, and you can't have a dockable modal dialog, it just doesn't make any sense... I don't think you can do this with the standard cmd set.
 
  10 October 2012
Ditto. I think you can only dock window UI elements.

Taken straight from the Maya dockControl help:
Create a dockable control, also known as tool palette or utility window. Dock controls are secondary windows placed in the dock area around the central control in a main window. Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked). Dock control consists of a title bar and the content area. The titlebar displays the dock control window title, a float button and a close button. Depending on the state of the dock control, the float and close buttons may be either disabled or not shown at all.
 
  10 October 2012
Red face

Originally Posted by bk3d: Ditto. I think you can only dock window UI elements.

Taken straight from the Maya dockControl help:
Create a dockable control, also known as tool palette or utility window. Dock controls are secondary windows placed in the dock area around the central control in a main window. Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked). Dock control consists of a title bar and the content area. The titlebar displays the dock control window title, a float button and a close button. Depending on the state of the dock control, the float and close buttons may be either disabled or not shown at all.


well man, I know the basic stuff, their is no need of making something that already exist, so what I am making is going to load up when maya is launched with the current project scene loaded to select the maya file and open. its not big of a pain to click the open button to load the maya file, however its make a lot easier if u have multiple drive or a slow(fragmented) disk then this is window will be helpful as later case will slow the process of loading the file open dialog..

I have made a basic GUI, the only problem I know have it works in maya 2013 but the GUI doesnt shows up correctly in 2010...




I put the code her if anyone board smart enough to point out what I am doing wrong..

import maya.cmds as cmds
import maya.mel as mel
import os,sys

class BaseInitializer(object):
      def __init__(self):
          self.prjDir = cmds.workspace(fn=True) #returns project directory
          pass

class GUI(BaseInitializer):
      def __init__(self):
          BaseInitializer.__init__(self)
          self.widgets={}
          self.winName="minime"
          self.dock=""

          self.v=mel.eval('getApplicationVersionAsFloat')
          if self.v>= 2011: self.dock=True
          else: self.dock=False

          self.createUI(self.winName,self.dock)

      def createUI(self,winName,dock):
          """
        Creates dockable GUI if maya version above 2011
        else creates flying window
        """
          if self.dock:
             if cmds.dockControl(self.winName,exists=True):
                print "dock exist", self.winName
                cmds.deleteUI(self.winName)
          else:
               if cmds.window(self.winName, exists=True):
                  cmds.deleteUI(self.winName)
          print "WindowName: ", self.winName
          print "state of dock: ", dock
          self.widgets["window"] = cmds.window(self.winName, title = "Mini Me", width = 300, height = 350)
          #create main layout
          self.widgets["mainLayout"]=cmds.columnLayout("mainLayout")
          self.widgets["rowColumnLayout"]= cmds.rowColumnLayout('rowColumnLayout',nc=3,
          cw=[(1,50),(2,185),(3,30)],columnOffset=[(1,"both",5),(2,"both",5)])
          #adding controls
          self.widgets["lookinLabel"]=cmds.text('lookinLabel',label="Look in")
          self.widgets["location"]=cmds.textField('location',tx=self.prjDir,h=20)
          self.widgets["browsBtn"]=cmds.iconTextButton('browsBtn',image1='fileOpen.x  pm')

          self.widgets["fileLayout"]=cmds.rowColumnLayout('fileLayout', h=250,nc=1, parent='mainLayout',columnOffset=(1,"both",5))
          self.widgets["fileLister"]=cmds.iconTextScrollList('fileLister',h=250, allowMultiSelection=False,append=('one', 'two', 'three' ) )

          #layout for buttons
          self.widgets['btnLayout']=cmds.rowColumnLayout('btnLayout',nc=2,parent='mai  nLayout',
          cw=[(1,130),(2,130)],columnOffset=[(1,"both",6),(2,"both",5)])
          self.widgets["setPrjBtn"]=cmds.button('setPrjBtn',label='Set Project')
          self.widgets["openBtn"]=cmds.button('openBtn',label='Open Selected')
      
          #Show the window
          if self.dock:
             cmds.dockControl(self.winName, label="Mini Me", area="left",allowedArea="left", content=self.widgets["window"])
          else:
               cmds.showWindow(self.widgets["window"])
          pass

class Actions():
      def __init__(self):
          pass


I gave it a name of minime since its a small tool with minimal functionality..
I greatly appreciate your input...
Attached Images
File Type: png minime.PNG (6.9 KB, 58 views)
File Type: png minime2010.PNG (10.0 KB, 56 views)
 
  11 November 2012
well I implemented my own version of something that I wanted, not exactly the functionality of dialog box alot simpler as file explorer but some added feature for maya artist..



I am not an experienced programmer but I guess I can build logic, http://goo.gl/lXrEK building an explorer functionality was pretty easy.
 
  11 November 2012
Wow, this looks really interesting

Did you ever figure out how to fix that issue with the window not appearing correctly in 2010? If so, I'd like to know how you did it.
 
  11 November 2012
no, while I was working on it developed another snag that restricts this app to run on 2010, and moreover if its not dockable then whats it will open up like modal dialog box, other than the features I have added it would just be a sacrifice not to be ablt to use in 2010 but hey its a python script and if u r or anyone one on 2010 is a geek to understand the logic can build one for 2010 give me credits of primary author.. he he
 
  11 November 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:49 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.