global proc STSMoveDo(string $Length,string $Target) { float $Height = `floatField -q -value $Length`; string $nameTarget = `textField -q -text $Target`; ConvertSelectionToVertices; string $nameAllVert[] = `ls -sl -fl`; if (`selectType -q -polymeshVertex`) { int $checkSize = `size $nameAllVert`; if ($checkSize != 0){ string $forVert; SelectToggleMode; string $nameMainObj[] = `ls -sl`; for ($forVert in $nameAllVert) { select $forVert; float $vertXform[] = `xform -q -ws -t`; string $nameGeom = $nameTarget; spaceLocator -n "Helper"; move -ws $vertXform[0] $vertXform[1] $vertXform[2]; select $nameGeom "Helper"; geometryConstraint -weight 1; normalConstraint -weight 1 -aimVector 0 1 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0; select "Helper"; select `ls -sl -dag`; select -d "Helper" `ls -sl -s`; doDelete; select "Helper"; float $normalMove = $Height; move -r -os -wd -y $normalMove ; float $vertXform[] = `xform -q -ws -t`; doDelete; select $forVert; move -ws $vertXform[0] $vertXform[1] $vertXform[2]; } SelectVertexMask; select $nameAllVert; hilite $nameMainObj[0]; } } } global proc STSMove() { if (`window -exists ShapeToShapeMove`) {deleteUI ShapeToShapeMove;} string $window = `window -title "Shape To Shape Move" -iconName "STSMove" ShapeToShapeMove`; columnLayout -adjustableColumn true; setParent ..; rowColumnLayout -numberOfColumns 2; text -label "height:"; global string $Length; string $Length = `floatField -v 0`; text -label "Name target obj:"; global string $Target; string $Target = `textField`; setParent ..; columnLayout -adjustableColumn true -rowSpacing 3; separator -height 5 -style "single"; separator -height 3 -style "none"; button -label "STSMove" -c ("STSMoveDo($Length,$Target)"); button -label "Pick Name From Scene" -c ("STSpickName($Target)"); setParent ..; showWindow $window; } global proc STSpickName(string $Target) { string $newNameObjs[] = `ls -sl -fl`; string $newName = $newNameObjs[0]; textField -e -text $newName $Target; }