PDA

View Full Version : has anyone build dockable file dialog box ?


DEVILSAN
10-30-2012, 06:50 AM
I am wondering if some one has made a dockable file open dialog box or do I have to make it from scratch?
http://forums.cgsociety.org/attachment.php?attachmentid=169655&stc=1
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...?

NaughtyNathan
10-30-2012, 10:44 AM
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.

bk3d
10-30-2012, 05:12 PM
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.

DEVILSAN
10-30-2012, 06:24 PM
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...

http://forums.cgsociety.org/attachment.php?attachmentid=169665&stc=1
http://forums.cgsociety.org/attachment.php?attachmentid=169666&stc=1

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.xpm')

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='mainLayout',
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...

DEVILSAN
11-04-2012, 06:27 PM
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..

http://www.devilsan.com/uploads/9/9/4/6/9946022/388198360.png (http://goo.gl/lXrEK)

I am not an experienced programmer but I guess I can build logic, http://goo.gl/lXrEK building an explorer functionality was pretty easy.

PozestStar
11-04-2012, 09:59 PM
Wow, this looks really interesting :thumbsup:

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.

DEVILSAN
11-05-2012, 05:41 AM
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:wavey:

CGTalk Moderation
11-05-2012, 05:41 AM
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.