Help with Python Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
Hopefully this post will reach someone but i could really use some help with a scripting project i'm doing for school
Basically i wanted to create a Maya to Unreal importer tool that would also adjust Maya's scenes so that importing the FBX to Unreal will be seamless
I've already made up the UI and i'm not looking for someone to just outright do it for me as i would like to learn how to do it myself but i definitely don't plan on perusing scripting as a career choice so i've listed some of my questions below and hopefully someone can point me in the right direction. (I would ask my teacher but he's hard to get ahold of and always busy, not to mention that he just repeats your question to you multiple times in order to get you to solve it yourself)
- I want to create a file browser that will allow me to save the current file as either a .FBX or a .OBJ file (i had created a radial button command to have the user switch between the two but have not added the functionality yet) I had looked at the cmds.fileDialogue and cmds.fileDialogue2 commands but i cant make heads or tails of how to get them to export a file to a .FBX format.
- I haven't found any documentation on Script editing the maya workspace to match up with the documents linked here: https://knowledge.autodesk.com/support/maya/getting-started/caas/CloudHelp/cloudhelp/2018/ENU/Maya-D...
If anyone could help me out with this i would greatly appreciate it.
Thanks!
What i have so far:
def export(*args):
def importFile(*args):
def setSceneNew(*args):
def setSceneCurrent(*args):
def unrealExport(*args):
def browseFunction(*args):
#UI
cmds.window(title='Unreal Scene Tool', w=400) # Window Title and width
cmds.rowColumnLayout( numberOfColumns=1, columnAlign=(1, 'center'), columnAttach=(2, 'both', 0), columnWidth=(2, 150) ) #Row layout
cmds.text('Set up a new Unreal compatable scene')#text explaining to the user what this button does
cmds.button(label='Set Up New Scene') #Button that sets up a new scene with Unreal Perameters
cmds.separator( height=20, style='doubleDash' ) #seperates the first section from the second
cmds.text('Set up current scene to Unreal perameters') #explains to users what this function does
cmds.button(label='Set Scene Perameters') #activates functions
cmds.separator( height=20, style='doubleDash') #seperates the second section from the third
cmds.text('Export', fn='boldLabelFont', al='center')
cmds.text('Import your file to an Unreal Project:')
cmds.setParent('..')
cmds.rowColumnLayout(nc=3)
cmds.text('Select your maya file: ')
cmds.textField('openFilefield',w=300)
cmds.button(label='Browse')
cmds.setParent('..')
cmds.rowColumnLayout(nc=3)
cmds.text('Select your Unreal Project: ')
cmds.textField('selectDestination',w=300)
cmds.button(label='Set Project')
cmds.setParent('..')
cmds.rowColumnLayout(nc=3)
cmds.text('Export File Type? ')
cmds.radioCollection()
cmds.radioButton( label='.FBX' )
cmds.radioButton( label='.OBJ' )
cmds.setParent('..')
cmds.rowColumnLayout(nc=1)
cmds.button(label='Export to Unreal')
cmds.separator( height=20, style='doubleDash') #seperates the second section from the third
cmds.rowColumnLayout(nc=1)
cmds.text('Import', al='center', fn='boldLabelFont')
cmds.rowColumnLayout(nc=3)
cmds.text('Import your model into maya scene ')
cmds.textField('openFilefield',w=300)
cmds.button(label='Browse')
cmds.setParent('..')
cmds.rowColumnLayout(nc=1)
cmds.button(label='Import to Maya')
cmds.showWindow()UI preview:w