def _populateSelectionField(self, channel, field, *args):
selectedChannels = None
if channel:
selectedChannels = getSelectedChannels()
if not selectedChannels:
raise RuntimeError('Please select an attribute in the channelBox.')
if len(selectedChannels) > 1:
raise RuntimeError('Please select only one attribute.')
sel = mc.ls(sl=True)
if not sel:
raise RuntimeError('Please select a node.')
if len(sel) > 1:
raise RuntimeError('Please select only one node.')
selection = sel[0]
if selectedChannels:
selection = selection+'.'+selectedChannels[0]
mc.textFieldButtonGrp(field, edit=True, text=selection)
评论列表
文章目录