def init(self): self.dir = mxs.getDir(mxs.name('publicExchangeStoreInstallPath')) ui_file = QFile( os.path.join(self.dir, 'AnimRef', 'Contents', 'interface', 'interface.ui')) ui_file.open(QFile.ReadOnly) self.ui = QUiLoader().load(ui_file, self) ui_file.close() layout = QtWidgets.QHBoxLayout() layout.addWidget(self.ui) layout.setMargin(4) self.setLayout(layout)
def quickpreview(): '''Create a quick preview''' preview_name = path.join(rt.getDir(rt.Name("preview")), "quickpreview.avi") view_size = rt.getViewSize() anim_bmp = rt.bitmap(view_size.x, view_size.y, filename=preview_name) for t in range(int(rt.animationRange.start), int(rt.animationRange.end)): rt.sliderTime = t dib = rt.gw.getViewportDib() rt.copy(dib, anim_bmp) rt.save(anim_bmp) rt.close(anim_bmp) rt.gc() rt.ramplayer(preview_name, "")
''' Lists all the files in a folder ''' import os from pymxs import runtime as rt # pylint: disable=import-error PY_SCRIPTS_DIR = os.path.join(rt.getDir(rt.Name("scripts")), 'python') for root, dirs, files in os.walk(PY_SCRIPTS_DIR, topdown=False): for name in files: print(name)
def render(): '''Render in the renderoutput directory.''' output_path = os.path.join(rt.getDir(rt.Name("renderoutput")), 'foo.jpg') if os.path.exists(output_path): os.remove(output_path) rt.render(outputFile=output_path)