def loadAnim(self): # bring up file open box to allow selection of an # animation file animFilename = askopenfilename( defaultextension = '.mb', filetypes = (('Maya Models', '*.mb'), ('All files', '*')), initialdir = '/i/beta', title = 'Load Animation', parent = self.component('hull') ) if not animFilename or animFilename == 'None': # no file selected, canceled return # add directory where animation was loaded from to the # current model path so any further searches for the file # can find it fileDirName = os.path.dirname(animFilename) fileBaseName = os.path.basename(animFilename) fileBaseNameBase = os.path.splitext(fileBaseName)[0] fileDirNameFN = Filename(fileDirName) fileDirNameFN.makeCanonical() getModelPath().prependDirectory(fileDirNameFN) for currActor in self['actorList']: # replace all currently loaded anims with specified one # currActor.unloadAnims(None, None, None) currActor.loadAnims({fileBaseNameBase:fileBaseNameBase}) self.clearActorControls() self.createActorControls()