

Self._showUserMessage_("No Objects are selected.

# error handling in case nothing got selected SelectedObjects = cmds.ls(selection=True) #Ĭmds.textFieldButtonGrp(self.textfieldGroupName, edit=True, text=str(directoryPath)) It provides basic functionality for recreating the window and voids duplicates. This part of the code sets up the general UI elements inside of a layout. If(cmds.windowPref(self.windowName, query=1, exists=1)): If(cmds.window(self.windowName, query=True, exists=True)): # deletes old window and preference, if it still exists TextFieldUserMessage = 'textFieldUserMessage'ĮxporterWindow = cmds.window(self.windowName, title="FBX exporter", iconName=self.windowName, widthHeight=(280, 120))Ĭmds.columnLayout(lumnLayoutName, w=375, adjustableColumn=False, parent=self.windowName )Ĭmds.textField(self.textfieldName,placeholderText='Enter Optional File Name', text='',parent=lumnLayoutName, width=150)Ĭmds.textFieldButtonGrp(self.textfieldGroupName,placeholderText='Directory Path',label='Save Location', cw3=, text='', buttonLabel='Browse', buttonCommand=self._openDirectoryBrowser_, parent=lumnLayoutName)Ĭmds.button(self.exportButtonName, label="Export", parent=lumnLayoutName, width = 322, command = self.startExport)Ĭmds.separator(parent=lumnLayoutName, height=10)Ĭmds.text(self.textFieldUserMessage,visible=False, parent=lumnLayoutName) TextfieldGroupName = 'directoryPathTextfield' # deletes the construction history and exports them into a specified # it puts each object on the origin point, freezes the transform, # FBX exporter class which can export multiple poly objects First, for easier readability and accessibility, I always declare class member on the top and not just somewhere in the code by typing self.myVariable. It is overall straight forward, only a few things I want to point out. By no means, this one covers all export capabilities which maya offers but it has some nice ideas and concepts which are worth showing to you.įor this one I’ve used the built-in maya GUI. Hey guys, so this is a very simple but useful example of how to easily build an fbx exporter for maya with python.
