Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / wxpython: maya crashes when i try to shut wxpython window
  RSS 2.0 ATOM  

wxpython: maya crashes when i try to shut wxpython window
Rate this thread
 
36045
 
Permlink of this thread   Subscribe to this thread
avatar
  • Tistatos
  • Posted: 27 October 2009 12:25 PM
  • Total Posts: 44
  • Joined: 07 January 2009 01:31 PM

when i try to shut down my wxpython window maya crashes :( anybody know why?
my own research points to that the : finally: del app is the thief.

anyone that know how to solve this problem? im running 2009 on vista x64

"""
psdvwui.py
UI for Photoshop Friend

Erik Larsson
    Erik.larsson@live.com
    http://www.technical3dart.com

Description:
This is the UI Element for making texture import/export from maya easier.

REQUIRED PYTHON EXTENSIONS:
wxpython - http://www.wxpython.org/
pywin32 - http://sourceforge.net/projects/pywin32/
"""

import wx,os
import maya
.cmds as cmds
mapID 
101

exportXmapID 
110
exportYmapID 
111
exportBtn 
112

importXmapID 
120
importYmapID 
121
importBtn 
122

class MainWindow(wx.Frame):
    
""" We simply derive a new class of Frame. """
    
def __init__(selfparentidtitle):
        
wx.Frame.__init__(selfparentidtitlesize=(300,250))
        self
.CreateStatusBar()
        panel 
wx.Panel(self, -1)        
        titleFont 
wx.Font(10wx.DEFAULT, wx.NORMALwx.BOLDTrue)

        
#############################
        ##    Maya to photoshop    ##
        #############################
        
self.maya2psp wx.StaticText(panel, -1"Maya To Photoshop                              ",wx.Point(105))
        self
.maya2psp.SetFont(titleFont)
        wx
.StaticText(panel, -1"Map Size:"wx.Point(10,40))
        self
.importMapSizeX wx.TextCtrl(panel,importXmapID ""wx.Point(6035)wx.Size(40,-1))
        wx
.StaticText(panel, -1"x" wx.Point(105,37))
        self
.importMapSizeY wx.TextCtrl(panel,importYmapID ""wx.Point(12035)wx.Size(40,-1))

        self
.exportButton wx.Button(panelexportBtn"Generate PSD-file"wx.Point(10,75))

        self
.maptxt wx.StaticText(panel, -1"Maps:",wx.Point(20025))
        self
.mapList ["Diffuse" "Specular" "Normal" "Emissive"]
        self
.mapchkbx wx.CheckListBox(panelmapIDwx.Point (20040)wx.Size (7070)self.mapList)
        wx
.EVT_CHECKLISTBOX(selfmapIDself.mapCheck)
        wx
.EVT_BUTTON(selfexportBtnself.uvExport)
        
#############################
        ##    photoshop to Maya    ##
        #############################

        
self.psp2maya wx.StaticText(panel, -1"Photoshop To Maya                               ",wx.Point(10110))
        self
.psp2maya.SetFont(titleFont)

        wx
.StaticText(panel, -1"Map Size:"wx.Point(10,135))
        self
.exportMapSizeX wx.TextCtrl(panel,exportXmapID ""wx.Point(60130)wx.Size(40,-1))
        wx
.StaticText(panel, -1"x" wx.Point(105,132))
        self
.exportMapSizeY wx.TextCtrl(panel,exportYmapID ""wx.Point(120130)wx.Size(40,-1))
        self
.importButton wx.Button(panelimportBtn"Import Maps"wx.Point(10,160))
        self
.importButton wx.Button(panelimportBtn"Import Maps"wx.Point(100,160))

        self
.Show(True)

    def mapCheck(self
event):
        print 
"hej %d" event.GetInt()
    def uvExport(self
event):
        
self.importMapXint int(wx.TextCtrl.GetLineText(self.importMapSizeX0))
        self
.importMapYint int(wx.TextCtrl.GetLineText(self.importMapSizeY0))
        
print " %d" self.importMapXint

app 
wx.PySimpleApp()     

try:
    
frame=MainWindow(Nonewx.ID_ANY'Photoshop Friend')
    app
.MainLoop()
finally
:
    
del app


Replies: 0




   
  Settings Choose Theme color: