If you wanna test it yourselves Right click on an item in the treeview
// Error: <function callback at 0x0000000018F4F048> “layer 2”; //
// Error: Line 1.1: Syntax error //
// Error: <function callback at 0x0000000018F4F048> “layer 7”; //
// Error: Line 1.1: Syntax error //
#====================================================#
LIBRARIES TO IMPORT
#====================================================#
import pymel.core as pm
from maya import cmds
#====================================================#
WINDOW CREATION AND HANDLING
#====================================================#
def checkErrors(*args):
print args
return True
window = pm.window()
layout = pm.formLayout()
control = pm.treeView( parent = layout, numberOfButtons = 1, abr = False, cmc = checkErrors )
pm.popupMenu()
pm.menuItem()
pm.menuItem()
pm.menuItem()
pm.formLayout(layout,e=True, attachForm=(control,‘top’, 2))
pm.formLayout(layout,e=True, attachForm=(control,‘left’, 2))
pm.formLayout(layout,e=True, attachForm=(control,‘bottom’, 2))
pm.formLayout(layout,e=True, attachForm=(control,‘right’, 2))
pm.showWindow( window )
pm.treeView( control, e=True, addItem = (“layer 1”, “”))
pm.treeView( control, e=True, addItem = (“layer 2”, “”))
pm.treeView( control, e=True, addItem = (“layer 3”, “”))
pm.treeView( control, e=True, addItem = (“layer 4”, “”))
pm.treeView( control, e=True, addItem = (“layer 5”, “”))
pm.treeView( control, e=True, addItem = (“layer 6”, “”))
pm.treeView( control, e=True, addItem = (“layer 7”, “layer 2”))
pm.treeView( control, e=True, addItem = (“layer 8”, “layer 2”))
pm.treeView( control, e=True, addItem = (“layer 9”, “layer 2”))
pm.treeView( control, e=True, addItem = (“layer 10”, “layer 8”))
pm.treeView( control, e=True, addItem = (“layer 11”, “layer 2”))
pm.treeView( control, e=True, addItem = (“layer 12”, “”))
pm.treeView( control, e=True, addItem = (“layer 13”, “layer 10”))