Pymel / Python Coding

qt designer with maya and pymel

overview

Use qt designer to create GUI in maya. qt designer saves out a .ui file which can either be free floating or a docked gui in maya.

qt designer

file > new > Main Window
drag and drop ‘ push button’
click ‘green cross button’ to add dynamic property – type = string

property_editor

property name = +command ( for python) -command (for mel script)
put in script in dynamic property window. put in quotes
eg “pm.sphere()”

dynamic_props

maya
pymel script to add docked gui or use pm.showWindow() for free floating

import pymel.core as pm
dialog1 = pm.loadUI(f=”C:/test.ui”)
allowedAreas = [‘right’, ‘left’]
pm.showWindow()
pm.dockControl(area=’left’,content=dialog1,allowedArea=allowedAreas,l=’gui_name’)

Comments are closed.