cui.setAppTitle <string> equivalent in Maya?

Anyone knows? This method changes the titlebar text of Max completely.

Thanks,
Light

[QUOTE=Light;3204]Anyone knows? This method changes the titlebar text of Max completely.
Light[/QUOTE]

The only way i know is

window("-e","-t",<text>,$gMainWindow);

it’s not persistent tho…:(:

Thanks man, I will give it a try tomorrow. You mean maya resets it when you open a new file, etc? If so, then it’s fine.

Cheers,
Light

I just tried:

maya.window ( t='new title', mainWindow=True );

But it didn’t changed anything. It resized/moved the maya window though.

Thanks,
Light

[QUOTE=Light;3218]I just tried:

maya.window ( t='new title', mainWindow=True );

But it didn’t changed anything. It resized/moved the maya window though.

Thanks,
Light[/QUOTE]

Looks like you’re missing the edit mode flag.

Thanks, I was looking for that flag, but I couldn’t find it. Are you sure it’s in the python command? I thought maybe it only exists in the MEL version.

Thanks,
Light

[QUOTE=Light;3220]Thanks, I was looking for that flag, but I couldn’t find it. Are you sure it’s in the python command? I thought maybe it only exists in the MEL version.
Thanks,
Light[/QUOTE]

yeah you should be able to do

window(e=True,t=‘title’,mainWindow=True)

Yeah when I use this:

maya.window ( e=True, t='new title', mainWindow=True )

it throws:

# Result: window1 # 
maya.window ( e=True, t='new title', mainWindow=True )
# Error: No object name specified.
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# RuntimeError: No object name specified. 

I tried mel code, it works. So if it doesn’t work in python, then I will just evaluate it as MEL in Python.

Thanks,
Light

[QUOTE=Light;3222]Yeah when I use this:

maya.window ( e=True, t='new title', mainWindow=True )

it throws:

# Result: window1 # 
maya.window ( e=True, t='new title', mainWindow=True )
# Error: No object name specified.
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# RuntimeError: No object name specified. 

I tried mel code, it works. So if it doesn’t work in python, then I will just evaluate it as MEL in Python.

Thanks,
Light[/QUOTE]

yeah the problem there is that you have to pass it a window name, so you would want to:


gMainWindow=maya.mel.eval("$window=$gMainWindow);
maya.cmds.window(gMainWindow,e=True,t='title')

Thanks Seth, that did the trick. On a similar note, is this how you can access MEL globals from python?:

gMainWindow=maya.mel.eval("$window=$gMainWindow)

If you can get them like that, can you also set them? Although I think if you set them, then MEL wouldn’t allow using python types.

Cheers,
Light

[QUOTE=Light;3224]Thanks Seth, that did the trick. On a similar note, is this how you can access MEL globals from python?:

If you can get them like that, can you also set them? Although I think if you set them, then MEL wouldn’t allow using python types.
[/QUOTE]

Yeah, you should be able to go:


my_global_value= "moo cow"
maya.mel.eval("$globalVar=\"%s\""%my_global_value)

although if you’re in a script, you may need to wrap your setter in MEL and call that instead. Not sure how that would work out.

Thanks Seth, it’s a useful trick for sure.

Cheers,
Light

Btw Seth, do you know how to get the current text in the Maya title bar? I removed the e flag and then the title flag, but it didn’t return anything.

Thanks,
Light

[QUOTE=Light;3239]Btw Seth, do you know how to get the current text in the Maya title bar? I removed the e flag and then the title flag, but it didn’t return anything.
Light[/QUOTE]

Replace the e flag with q, so maya.cmds.window(<window>,q=True,t=True).

Thanks Seth, works great.

Cheers,
Light