MEL 5個以内の子の一時unparentツール

最初に親と子を解除したいもの(ジョイント等)を選択追加して1〜5個の子を選択し
unparent5のボタンをクリックすると親と子を解除します。
parent5のボタンをクリックすると元に戻します。


select -cl;
string $window = `window -widthHeight 10 10`;
setParent ..;
showWindow $window;
deleteUI -window $window;


window -fw -t "Unparent" -rtf 1;
columnLayout -adjustableColumn true;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 34
-height 34
-manage 1
-visible 1
-preventOverride 0
-align "center"
-label "UnParent 1 Add select 1-5"
-labelOffset 0
-font "tinyBoldLabelFont"
-imageOverlayLabel "UnParent5"
-image "commandButton.xpm"
-image1 "commandButton.xpm"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "string $Ha_01[]= `ls -sl`;\rPickWalkUp;\rstring $Ha_02[]= `ls -sl`;\r\r\rselect -r $Ha_01[0];\rUnparent;\r\rselect -r $Ha_01[1];\rUnparent;\r\rselect -r $Ha_01[2];\rUnparent;\r\rselect -r $Ha_01[3];\rUnparent;\r\rselect -r $Ha_01[4];\rUnparent;\r\rselect -r $Ha_01[5];\rUnparent;\r"
-sourceType "mel"
-actionIsSubstitute 0
-commandRepeatable 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 34
-height 34
-manage 1
-visible 1
-preventOverride 0
-align "center"
-label "Parent"
-labelOffset 0
-font "tinyBoldLabelFont"
-imageOverlayLabel "Parent5"
-image1 "commandButton.xpm"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "\rselect -r $Ha_01[0];\rselect -tgl $Ha_02[0];\rParent;\r\rselect -r $Ha_01[1];\rselect -tgl $Ha_01[0];\r\rParent;\r\rselect -r $Ha_01[2];\rselect -tgl $Ha_01[0];\r\rParent;\r\rselect -r $Ha_01[3];\rselect -tgl $Ha_01[0];\r\rParent;\r\rselect -r $Ha_01[4];\rselect -tgl $Ha_01[0];\r\rParent;\r\rselect -r $Ha_01[5];\rselect -tgl $Ha_01[0];\r\rParent;\r\r"
-sourceType "mel"
-actionIsSubstitute 0
-commandRepeatable 1
;
setParent..;
showWindow;