>
> cmds.textField( name, edit=True, enterCommand=('x'))
enterCommand requires a callable function, similar to how you are doing it
already with your button. Right now you are effectively just setting the
enterCommand to the string value 'x' which it will then try to run a
callable called x(). I see you have some global values set. Where do you
ultimately want to derive your x value from? A gui widget?
On Mon, Jul 23, 2012 at 2:20 AM, Daz <[email protected]> wrote:
> Hello
>
> I have a bit of a problem with python atm. Not sure if I'm missing 1 value
> or everything is wrong but I cant get it to work...
>
> I want to create a simple memu to be able control render settings and
> other values using my UI... here is what I got so far...
>
>
>
> import maya.cmds as cmds
>
> x=4
> y=0
> d=0
> f=0
>
>
> if cmds.window('DazTools', exists=True):
> cmds.deleteUI('DazTools', window=True)
>
> cmds.window ('DazTools', h=50, w=100)
> cmds.showWindow('DazTools')
>
> cmds.rowColumnLayout( numberOfColumns=2, columnAttach=(1, 'right', 0),
> columnWidth=[(1, 100), (2, 250)] )
>
> def st(*args):
> cmds.setAttr('miDefaultOptions.maxSamples', x)
>
>
> cmds.text( label='name' )
> name = cmds.textField()
> cmds.textField( name, edit=True, enterCommand=('x'))
>
> cmds.button('Standard', c=st)
>
>
>
> I'm not sure how it should be but I thought that I have to create overall
> 'x' value for python to be able to call back to the 'x' and know what to
> type in my settings. I initially will preset it to how I want using master
> 'x' at the top but let user change it as he go deep in to the settings...
>
> Any hints what I'm doing wrong here?
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe