optionVar["RigDebugTools_GuiPosition"]

how are window prefs currently handled in maya? are they stored in optionVars or in their own structure? is this specifically something you want to achieve for Qt window positions or for maya windows too?

there's one feature that was brought up ages ago by and...@kineticfx that i really want to get into pymel: a python-only, optionVar-like file that uses python's pickle/shelve module to store complex data types. it hasn't been implemented yet because of the time associated with solving all the caveats that come with a pref file: error handling, permissions, ensuring that the file is read/written when maya opens/closes, dealing with corruption, etc. but it's a great project for someone who wants to earn their chops working on the pymel project (hint, hint)

-chad



On Feb 4, 2010, at 9:33 AM, thirstydevil wrote:

Lovin pymel for wrapping optVars into a dict.  Wondering if pymel
could wrap the window prefs in the same way?

currently I'm doing this, it's the wrong place to be storing the
data.  Qt's native way is over kill for this smallish gui.  What do
you recon?

# Could combine optVars to help remember the screen pos of the last
known pos
# We have to override the closeEvent to save the optVar tho.

if not pCore.optionVar.has_key("RigDebugTools_GuiPosition"):
           pCore.optionVar["RigDebugTools_GuiPosition"] =
(self.pos().x(),self.pos().y())
else:
           try:
               Pos =
QtCore.QPoint(pCore.optionVar["RigDebugTools_GuiPosition"]
[0],pCore.optionVar["RigDebugTools_GuiPosition"][1])
               self.move(Pos)
           except:
               pass

-Dave

--
http://groups.google.com/group/python_inside_maya

--
http://groups.google.com/group/python_inside_maya

Reply via email to