def channelbox_symbols(box, *args):
# create buttons for each menu icon
b_manip = cmds.symbolButton(p=box.symbol_layout)
b_speed = cmds.symbolButton(p=box.symbol_layout)
b_hyper = cmds.symbolButton(p=box.symbol_layout)
# attach buttons to form layout
cmds.formLayout(box.symbol_layout, e=1, attachForm=[
(b_manip, "top", 0),
(b_manip, "bottom", 1),
(b_speed, "top", 0),
(b_speed, "bottom", 1),
(b_hyper, "top", 0),
(b_hyper, "bottom", 1),
(b_hyper, "right", 2),
],
attachNone=[
(b_manip, "left"),
(b_speed, "left"),
(b_hyper, "left")
],
attachControl=[
(b_manip, "right", 2, b_speed),
(b_speed, "right", 2, b_hyper)
])
# add the commands for each button (stored in box.sym)
cmds.symbolButton(b_manip, e=1, c=sysCmd.rpartial(box.sym["pressed"], box, "manipsState"))
cmds.symbolButton(b_speed, e=1, c=sysCmd.rpartial(box.sym["pressed"], box, "speedState"))
cmds.symbolButton(b_hyper, e=1, c=sysCmd.rpartial(box.sym["pressed"], box, "hyperbolic"))
# store the buttons themselves for updating when changed via menu options instead of button presses
box.symbols["manipsState"] = b_manip
box.symbols["speedState"] = b_speed
box.symbols["hyperbolic"] = b_hyper
# call their update function on creation to set them to their current states (because data is serialized,
# may not be default on creation)
for key in box.symbols:
box.sym["update"](box, key)
# -----------------------------------------------------------------------------------
# ----------------------------------------
# -- MODIFY BELOW THIS LINE AT OWN RISK --
# You will break many things
# ----------------------------------------
# --------------------------------------------------------------------------------------
# CORE SYSTEM : This is setup very specifically to NOT require you to modify this part
#
# If you need changes here, feel free to email me at the address provided if you feel
# that they could benefit everyone
# --------------------------------------------------------------------------------------
评论列表
文章目录