Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / cmds.confirmDialog() command in Maya 2011 (bug?)
  RSS 2.0 ATOM  

cmds.confirmDialog() command in Maya 2011 (bug?)
Rate this thread
 
61305
 
Permlink of this thread  
avatar
  • Total Posts: 8
  • Joined: 31 October 2008 04:07 PM

Hey guys,
Just copy and paste this text from cgtalk.com:

I’m trying to create confirm dialog window using cmds.confirmDialog() command. So one of the flags I’m using is - messageAlign. Non of the arguments is working properly for me. It does not matter which of the arguments I’m using “center”, right” or “left” the message is aligned on right side of dialog window.
In Maya 2010 it’s working fine

I noticed that not only confirmDialog() is affected by this bug(?) but also another commands.
e.g. this code won’t work properly:

import maya.cmds as cm
if cm.window("windowTemp"exists=True):
    
cm.deleteUI("windowTemp")
            
windowWidth 300
windowHeight 
=400
cm
.window("windowTemp"width=windowWidthheight=windowHeighttitle="Title"sizeable=False )
        
cm.scrollLayout(hst=0)
topClmnLaout cm.columnLayout(adj=Truers=3)
        
scrollWidth windowWidth 30
        
textWidth 
80
columnWidth 
100
cm
.rowColumnLayout(nc=4columnAttach=(1,"right",0), columnWidth=[(1textWidth),(2columnWidth),(4columnWidth)])
        
cm.text(label="XYZ: ")
cm.radioCollection()
        
cm.radioButton("XY"label="XY"select=False)
cm.radioButton("YZ"label="YZ"select=True)
cm.radioButton("XZ"label="XZ"select=False)
        
        
cm.setParent(topClmnLaout)
cm.separator()
        
cm.showWindow("windowTemp")

I think it’s not command problem, it’s a value problem. Python doesn’t “understand” values : “left”, right, “center”



Replies: 0
avatar

Seems like nobody code a GUI in Maya - Python. :))



Replies: 0
avatar
  • ldunham1
  • Posted: 24 October 2011 10:58 PM

same issue in mel.

its not that python doesn’t “understand” ‘left’, ‘right’ etc as its accepting the values, but just not applying them.

same applies in 2012, it’s never really bothered me tbh, anything i’m picky about for a gui i’d create in qt anyway, and for a confirm dialog as long as i got the message across it didn’t matter.

as for the example you provided, it does work, but the script is wrong. When you use a radioButtonGrp the first instance is the label, which may have been correctly used;

columnAttach=(1,"right",0)

as (im assuming) they wanted the label to align right, then the columnWidth is only being applied on the label, first and last radioButton, so the second button’s width becomes default (textWidth) which makes it look wrong.
what it wanted (im assuming again) was actually this

import maya.cmds as cm
if cm.window("windowTemp"exists=True):
    
cm.deleteUI("windowTemp")
            
windowWidth 300
windowHeight 
=400
cm
.window("windowTemp"width=windowWidthheight=windowHeighttitle="Title"sizeable=False )
        
cm.scrollLayout(hst=0)
topClmnLaout cm.columnLayout(adj=Truers=3)
        
scrollWidth windowWidth 30
        
textWidth 
80
columnWidth 
100
cm
.rowColumnLayout(nc=4columnAttach=(1,"left",0), columnWidth=[(1columnWidth),(2columnWidth),(3columnWidth),(4columnWidth)])
        
cm.text(label="XYZ: ")
cm.radioCollection()
        
cm.radioButton("XY"label="XY"select=False)
cm.radioButton("YZ"label="YZ"select=True)
cm.radioButton("XZ"label="XZ"select=False)
        
        
cm.setParent(topClmnLaout)
cm.separator()
        
cm.showWindow("windowTemp")

which states the label and all 3 radioButtons width’s.

//**EDIT
my silly mistake claiming

When you use a radioButtonGrp the first instance is the label,

what i mean to say was, “as your using text label plus the radio button group in the same layout”



Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0
avatar

Thank you now it is clear for me.



Replies: 0