cmds.ls(type='displayLayer')
list of display layers
cmds.editDisplayLayerMembers('layer2', q=1)
members of a specified layer
Have you got a super simple UI demo with button presses, spinners, checkbox?
Rollout RL_Test "Test"
(
button btn_A "A"
checkbox chk_B "B"
spinner spn_C "C" type:#integer range:[0,100,0]
on btnA pressed do print "A"
on chk_B changed state do print "B"
on spn_C changed val do print "C"
)
CreateDialog RL_Test
Something tells me it’s not as simple in Maya with Python, do I need to get QT4 installed?
def buttonPush(*args): print args
def spinnerChange(*args): print args
cmds.window(width=150, title = "Test")
cmds.columnLayout(adj=1)
cmds.button(label='Button', command = lambda *args: buttonPush("pressed"))
cmds.floatField(w=48, pre=3, minValue = 0.0, maxValue = 100.0, step = 0.01, cc = lambda *args: spinnerChange("spin"))
cmds.checkBox(label='Check', onc = lambda *args: buttonPush("on"), ofc = lambda *args: buttonPush("off"), )
cmds.showWindow()
with pymel it can be organized better
With all due respect to DenisT,
I differ to agree pymel is bad. Ever since I started using pymel it’s osome. One best thing about pymel is it returns all node objects rather than string values as cmds does. I take full advantage of the pymel and cmds as when needed and according to the kind of script I work on. Pymel is just osome and as fast as cmds and other stuff.
Does Maya allow you to have multiple objects with the same name like max?
Nope, as far as I know, at least not in the same group if you have groups
import maya.cmds as cmds
import pymel.core as pm
cmds.file(f=1,new=1)
for x in xrange(100000): cmds.createNode('polyCube')
t1 = cmds.timerX()
nodes = cmds.ls(type='polyCube')
t2 = cmds.timerX(startTime = t1)
print "cmds:", len(nodes), t2
t1 = cmds.timerX()
nodes = pm.ls(type='polyCube')
t2 = cmds.timerX(startTime = t1)
print "pymel:", len(nodes), t2
just only 100 times slower
Cheers for you help Denis,
What’s the equivalent of the ‘Group’ Ui in maya, looks like you’ve got it in your examples
for original maya ui the most close control to max group control is not collapsible framelayout with border.
in my example above i use my own group control written using Qt (PySide)