Skip to content

Instantly share code, notes, and snippets.

@Roumenov
Created November 10, 2019 16:33
Show Gist options
  • Save Roumenov/6993ad82183f30a0f71eb484cef27dfa to your computer and use it in GitHub Desktop.
Save Roumenov/6993ad82183f30a0f71eb484cef27dfa to your computer and use it in GitHub Desktop.
playing with how maya builds windows, layouts, and controls
import pymel.core as pm
def primitiveWindow(name = 'primitiveWindow'):
if pm.window(name, query=True, exists=True):
pm.deleteUI(name)
pm.window(name)
pm.showWindow(name)
mainColumn = pm.columnLayout()
radioFrame = pm.frameLayout(label='choose radio')
pm.rowLayout(numberOfColumns=3, parent=radioFrame)
pm.radioCollection('objectCreationType')
for x in range(3):# populates the current parent layout until it's full
pm.radioButton(label='radio%s' % x, parent=radioFrame)
pm.setParent(mainColumn)
frame = pm.frameLayout('sliders')
pm.floatSlider()
pm.intSlider()
pm.intField('objectCount', value=3)
primitiveWindow(name = 'primitiveWindow')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment