おおざっぱにジョイントの大きさをキャラクタに合わせるには、 オブジェクトのバウンディングボックスを求めてその大きさにジョイントの大きさを合わせます。
obj = pm.selected() pos = pm.exactWorldBoundingBox(obj[0])posに[-1, -2, -3, 4, 5, 6]などの形でバウンディングボックスの対角線上の点の座標が入ります。 この場合、[-1, -2, -3]と[4, 5, 6]がバウンディングボックスの対角線上の点の座標です。
import pymel.core as pm class LegWindow(object): _message = ['オブジェクトを選択してジョイント作成', 'ジョイントの位置を合わせてコントローラを作成'] def __init__(self): with pm.window(title='足リグ作成') as self.windowName: with pm.columnLayout(): self.myText = pm.text(label=self._message[0]) self.jbtn = pm.button(label='ジョイント作成', command=pm.Callback(self._makeJoint)) self.cbtn = pm.button(label='コントローラ作成', enable=False, command=pm.Callback(self._makeControlar)) pm.button(label='閉じる', command=pm.Callback(pm.deleteUI, self.windowName)) def _makeJoint(self): self.myText.setLabel(self._message[1]) self.jbtn.setEnable(False) self.cbtn.setEnable(True) def _makeControlar(self): self.myText.setLabel(self._message[0]) self.jbtn.setEnable(True) self.cbtn.setEnable(False)