def channelbox_make(box_ui, _menu="jtChannelBox_Menu_Modelling"):
data = data_load()
exists = 0
if box_ui.box is not None:
del box_ui.box
else:
key = currentset_get()
_menu = _menu if not key else data[key]
if box_ui.menu_layout is not None:
exists = 1
# find the key pertaining to this menu to set as current
value = [key for key, value in data.iteritems() if value == _menu][0] if data else "None"
currentset_set(value)
# cbox.ChannelBox parameters : (layout to parent channel box to, name of file containing menus to use,
# what to name the file created to store persistent states, True/False/1/0 whether to save states or not)
box_ui.box = CBox.ChannelBox(box_ui.layout_cbox, _menu, "jtChannelBox_State_Custom", 1)
cmds.formLayout(box_ui.layout_cbox, e=1,
attachForm=[(box_ui.box.layout, "left", 1), (box_ui.box.layout, "right", 1),
(box_ui.box.layout, "bottom", 3), (box_ui.box.layout, "top", 0)])
if exists:
cmds.formLayout(box_ui.layout_cbox, e=1,
attachForm=[(box_ui.menu_layout, "bottom", 10), (box_ui.menu_layout, "right", 0),
(box_ui.menu_layout, "left", 0)],
attachControl=(box_ui.box.layout, "bottom", 10, box_ui.menu_layout))
评论列表
文章目录