// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== global proc string[] createOffsetControls (float $pos[], float $scale, int $createRotateControl, int $createTranslateControl) { string $names[]; string $rotateControl, $translateControl; if ($createRotateControl) { $rotateControl = `createNode transform -name "OffsetRotateControl#"`; createNode nurbsCurve -name "OffsetRotateControlShape#" -parent $rotateControl; // The following magic numbers were generated by actually modelling the geometry in Maya. So if you want to // edit the generated shape, re-model the curve in Maya and dump the numbers in here. setAttr -keyable off ".v"; setAttr ".cc" -type "nurbsCurve" 3 126 1 no 3 131 0 0 0 0.26519408301351888 0.26519408301351888 0.26519408301351888 3.5132976486881446 3.5132976486881446 3.5132976486881446 16.869891039336494 16.869891039336494 23.380159092986595 23.380159092986595 29.598275430000001 29.598275430000001 29.598275430000001 35.816391769150883 35.816391769150883 42.326659822800977 42.326659822800977 55.683253213449319 55.683253213449319 55.683253213449319 58.931356779123973 58.931356779123973 58.931356779123973 59.196550862137485 59.196550862137485 59.196550862137485 63.408354125027202 63.408354125027202 63.408354125027202 67.620157387916905 67.620157387916905 67.620157387916905 67.885351470930431 67.885351470930431 67.885351470930431 71.133455036605056 71.133455036605056 71.133455036605056 84.490048427253399 84.490048427253399 91.000316480903507 91.000316480903507 97.218432817916906 97.218432817916906 97.218432817916906 103.43654915310938 103.43654915310938 109.94681720675945 109.94681720675945 123.30341059740779 123.30341059740779 123.30341059740779 126.55151416308242 126.55151416308242 126.55151416308242 126.81670824609593 126.81670824609593 126.81670824609593 131.02851150898562 131.02851150898562 131.02851150898562 135.24031477187532 135.24031477187532 135.24031477187532 135.50550885488883 135.50550885488883 135.50550885488883 138.75361242056351 138.75361242056351 138.75361242056351 152.11020581121181 152.11020581121181 158.62047386486194 158.62047386486194 164.83859020791692 164.83859020791692 164.83859020791692 171.05670654310939 171.05670654310939 177.56697459675945 177.56697459675945 190.92356798740781 190.92356798740781 190.92356798740781 194.17167155308243 194.17167155308243 194.17167155308243 194.43686563609594 194.43686563609594 194.43686563609594 198.64866889898559 198.64866889898559 198.64866889898559 202.86047216187535 202.86047216187535 202.86047216187535 203.12566624488886 203.12566624488886 203.12566624488886 206.37376981056349 206.37376981056349 206.37376981056349 219.73036320121179 219.73036320121179 226.24063125486191 226.24063125486191 232.4587475979169 232.4587475979169 232.4587475979169 238.67686393706776 238.67686393706776 245.18713199071789 245.18713199071789 258.54372538136624 258.54372538136624 258.54372538136624 261.79182894704087 261.79182894704087 261.79182894704087 262.05702303005438 262.05702303005438 262.05702303005438 266.26882629294408 266.26882629294408 266.26882629294408 270.48062955583379 270.48062955583379 270.48062955583379 129 0.73348622951963516 -0.16000000000000084 -0.66000000000000303 0.73929033537990851 -0.16000000000000084 -0.6533333333333361 0.74509444124018176 -0.16000000000000084 -0.64666666666666928 0.750898547100455 -0.16000000000000089 -0.64000000000000234 0.69704457573332368 -0.10576889006680346 -0.71747301419028164 0.62610940643896773 -0.058722289529051758 -0.78468244352992833 0.54088332871984024 -0.020000000000000063 -0.83999999999999986 0.91312558029108004 -0.020000000000000268 -0.60255574289799751 1.0842077396314502 -0.02000000000000033 -0.13845321717911607 0.89586112589689826 -0.02000000000000024 0.48987050175400954 0.77161670040751373 -0.020000000000000576 0.67228019438679021 0.43208591975095934 -0.020000000000000392 0.9234808152049313 0.22689274033036552 -0.020000000000000281 0.99522236780218787 0.020000000309908686 -0.020000000000000174 0.9995810521956735 0.02 -0.22689274018929245 0.99522236785151075 0.019999999999999945 -0.43208591969394083 0.92348081524711612 0.019999999999999862 -0.77161670040751318 0.67228019438679076 0.019999999999999712 -0.89586112589689826 0.48987050175400948 0.020000000000001059 -1.0842077396314502 -0.13845321717911671 0.019999999999998731 -0.91312558029108049 -0.60255574289799774 0.019999999999999914 -0.54088332871983957 -0.8400000000000003 0.058722289529051022 -0.62610940643896706 -0.78468244352992877 0.10576889006680619 -0.6970445757333249 -0.71747301419027976 0.16000000000000003 -0.75089854710045723 -0.63999999999999979 0.16000000000000003 -0.74509444124018387 -0.64666666666666661 0.16000000000000003 -0.73929033537991073 -0.65333333333333343 0.16000000000000003 -0.7334862295196376 -0.66000000000000048 0.093505729673454413 -0.65892067886588956 -0.75974140548982416 0.038992148527220251 -0.55534262184869421 -0.84151177720917192 -1.4352133302553154e-016 -0.4333503397026503 -0.90000000000000002 -0.038992148527217926 -0.5553426218486891 -0.84151177720917447 -0.0935057296734534 -0.6589206788658919 -0.75974140548982128 -0.1600000000000007 -0.73348622951963516 -0.66000000000000303 -0.1600000000000007 -0.73929033537990851 -0.6533333333333361 -0.1600000000000007 -0.74509444124018176 -0.64666666666666928 -0.1600000000000007 -0.750898547100455 -0.64000000000000234 -0.1057688900668033 -0.69704457573332368 -0.71747301419028164 -0.058722289529051612 -0.62610940643896773 -0.78468244352992833 -0.019999999999999945 -0.54088332871984024 -0.83999999999999986 -0.020000000000000066 -0.91312558029108004 -0.60255574289799751 -0.020000000000000087 -1.0842077396314502 -0.13845321717911607 -0.020000000000000042 -0.89586112589689826 0.48987050175400954 -0.020000000000000406 -0.77161670040751373 0.67228019438679021 -0.020000000000000295 -0.43208591975095934 0.9234808152049313 -0.020000000000000233 -0.22689274033036552 0.99522236780218787 -0.02000000000000017 -0.020000000309908689 0.9995810521956735 -0.2268927404505382 -0.020000000000000046 0.99522236776017103 -0.4320859197995317 -0.019999999999999941 0.92348081516899494 -0.77161670040751229 -0.019999999999999792 0.67228019438679176 -0.89586112589689848 -0.019999999999999737 0.4898705017540092 -1.0842077396314496 -0.019999999999999647 -0.13845321717911543 -0.9131255802910806 -0.019999999999999726 -0.6025557428979974 -0.54088332871984057 -0.019999999999999896 -0.83999999999999986 -0.62610940643896562 -0.058722289529050203 -0.78468244352992988 -0.69704457573332546 -0.10576889006680464 -0.7174730141902792 -0.75089854710045512 -0.1600000000000005 -0.64000000000000223 -0.74509444124018209 -0.16000000000000053 -0.64666666666666872 -0.73929033537990885 -0.16000000000000053 -0.65333333333333554 -0.73348622951963571 -0.16000000000000053 -0.66000000000000225 -0.6589206788658919 -0.093505729673452664 -0.75974140548982139 -0.5553426218486911 -0.038992148527217427 -0.84151177720917369 -0.43335033970265102 1.5092659602892234e-016 -0.90000000000000002 -0.55534262184869376 0.038992148527219106 -0.84151177720917225 -0.65892067886589134 0.09350572967345383 -0.75974140548982227 -0.73348622951963771 0.16000000000000006 -0.66000000000000003 -0.73929033537991096 0.16000000000000003 -0.65333333333333343 -0.74509444124018398 0.15999999999999995 -0.64666666666666661 -0.75089854710045723 0.15999999999999992 -0.64000000000000001 -0.69704457573332557 0.1057688900668067 -0.71747301419027887 -0.62610940643896651 0.058722289529050987 -0.784682443529929 -0.54088332871984057 0.020000000000000205 -0.83999999999999975 -0.91312558029107904 0.020000000000001475 -0.60255574289799774 -1.0842077396314502 0.020000000000000219 -0.13845321717911582 -0.89586112589689904 0.020000000000000122 0.48987050175400937 -0.77161670040751251 0.019999999999999598 0.67228019438679176 -0.43208591958979786 0.019999999999999761 0.92348081532416537 -0.22689273993162626 0.019999999999999879 0.99522236794159769 -0.019999999706847849 0.019999999999999921 0.99958105220837801 -0.020000000000000094 0.2268927404505382 0.99522236776017103 -0.020000000000000039 0.4320859197995317 0.92348081516899494 -0.019999999999999962 0.77161670040751229 0.67228019438679176 -0.019999999999999934 0.89586112589689848 0.4898705017540092 -0.019999999999999889 1.0842077396314496 -0.13845321717911543 -0.019999999999999928 0.9131255802910806 -0.6025557428979974 -0.020000000000000018 0.54088332871984057 -0.83999999999999986 -0.058722289529050342 0.62610940643896562 -0.78468244352992988 -0.10576889006680479 0.69704457573332546 -0.7174730141902792 -0.1600000000000007 0.75089854710045512 -0.64000000000000223 -0.1600000000000007 0.74509444124018209 -0.64666666666666872 -0.1600000000000007 0.73929033537990885 -0.65333333333333554 -0.1600000000000007 0.73348622951963571 -0.66000000000000225 -0.093505729673452803 0.6589206788658919 -0.75974140548982139 -0.038992148527217552 0.5553426218486911 -0.84151177720917369 5.4703491055519101e-017 0.43335033970265102 -0.90000000000000002 0.038992148527218981 0.55534262184869376 -0.84151177720917225 0.093505729673453677 0.65892067886589134 -0.75974140548982227 0.15999999999999992 0.73348622951963771 -0.66000000000000003 0.15999999999999986 0.73929033537991096 -0.65333333333333343 0.15999999999999981 0.74509444124018398 -0.64666666666666661 0.15999999999999973 0.75089854710045723 -0.64000000000000001 0.10576889006680655 0.69704457573332557 -0.71747301419027887 0.058722289529050842 0.62610940643896651 -0.784682443529929 0.020000000000000087 0.54088332871984057 -0.83999999999999975 0.020000000000001274 0.91312558029107904 -0.60255574289799774 0.019999999999999976 1.0842077396314502 -0.13845321717911582 0.019999999999999921 0.89586112589689904 0.48987050175400937 0.019999999999999424 0.77161670040751251 0.67228019438679176 0.019999999999999664 0.43208591958979786 0.92348081532416537 0.01999999999999983 0.22689273993162626 0.99522236794159769 0.019999999999999914 0.019999999706847855 0.99958105220837801 0.22689274018929245 0.019999999999999948 0.99522236785151075 0.43208591969394083 0.019999999999999848 0.92348081524711612 0.77161670040751318 0.019999999999999688 0.67228019438679076 0.89586112589689826 0.019999999999999515 0.48987050175400948 1.0842077396314502 0.020000000000000816 -0.13845321717911671 0.91312558029108049 0.019999999999998529 -0.60255574289799774 0.54088332871983957 0.019999999999999796 -0.8400000000000003 0.62610940643896706 0.058722289529050876 -0.78468244352992877 0.6970445757333249 0.10576889006680604 -0.71747301419027976 0.75089854710045723 0.15999999999999984 -0.63999999999999979 0.74509444124018387 0.15999999999999989 -0.64666666666666661 0.73929033537991073 0.15999999999999989 -0.65333333333333343 0.7334862295196376 0.15999999999999989 -0.66000000000000048 0.65892067886588956 0.093505729673454274 -0.75974140548982416 0.55534262184869421 0.038992148527220133 -0.84151177720917192 0.4333503397026503 -2.3974443799893462e-016 -0.90000000000000002 0.5553426218486891 -0.038992148527218051 -0.84151177720917447 0.6589206788658919 -0.093505729673453553 -0.75974140548982128 0.73348622951963516 -0.16000000000000084 -0.66000000000000303 ; } if ($createTranslateControl) { $translateControl = `createNode transform -name "OffsetTranslateControl#"`; createNode nurbsCurve -name "OffsetTranslateControlShape#" -parent $translateControl; if ($createRotateControl) { parent -absolute $translateControl $rotateControl; } // The following magic numbers were generated by actually modelling the geometry in Maya. So if you want to // edit the generated shape, re-model the curve in Maya and dump the numbers in here. setAttr -keyable off ".v"; setAttr ".cc" -type "nurbsCurve" 3 94 1 no 3 99 1 1 1 1.4880952380000001 1.4880952380000001 1.4880952380000001 1.9761904759999993 1.9761904759999993 1.9761904759999993 2.9761904759999993 2.9761904759999993 2.9761904759999993 3.9761904759999993 3.9761904759999993 3.9761904759999993 4.9761904759999993 4.9761904759999993 4.9761904759999993 5.9761904759999993 5.9761904759999993 5.9761904759999993 6.9761904759999993 6.9761904759999993 6.9761904759999993 7.9761904759999993 7.9761904759999993 7.9761904759999993 8.464285713999999 8.464285713999999 8.464285713999999 8.9523809519999986 8.9523809519999986 8.9523809519999986 9.9523809519999986 9.9523809519999986 9.9523809519999986 10.952380951999999 10.952380951999999 10.952380951999999 11.952380951999999 11.952380951999999 11.952380951999999 12.952380951999999 12.952380951999999 12.952380951999999 13.952380951999999 13.952380951999999 13.952380951999999 14.952380951999999 14.952380951999999 14.952380951999999 15.440476189999998 15.440476189999998 15.440476189999998 15.928571427999998 15.928571427999998 15.928571427999998 16.928571427999998 16.928571427999998 16.928571427999998 17.928571427999998 17.928571427999998 17.928571427999998 18.928571427999998 18.928571427999998 18.928571427999998 19.928571427999998 19.928571427999998 19.928571427999998 20.928571427999998 20.928571427999998 20.928571427999998 21.928571427999998 21.928571427999998 21.928571427999998 22.416666665999998 22.416666665999998 22.416666665999998 22.904761903999997 22.904761903999997 22.904761903999997 23.904761903999997 23.904761903999997 23.904761903999997 24.904761903999997 24.904761903999997 24.904761903999997 25.904761903999997 25.904761903999997 25.904761903999997 26.904761903999997 26.904761903999997 26.904761903999997 27.904761903999997 27.904761903999997 27.904761903999997 28.904761903999997 28.904761903999997 28.904761903999997 97 0.020000000000000004 0 0.83999999999999997 0.01999999999999999 0 0.56666666671999932 0.01999999999999998 0 0.29333333343999879 0.019999999999999976 0 0.020000000159998654 0.2933333334399994 0 0.020000000000000087 0.56666666671999977 0 0.020000000000000136 0.84000000000000008 0 0.020000000000000184 0.77333333333333543 0 0.066666666666666929 0.70666666666666778 0 0.11333333333333356 0.64000000000000012 0 0.16000000000000023 0.64666666666666828 0 0.16000000000000059 0.65333333333333421 0 0.16000000000000042 0.66000000000000014 0 0.16000000000000025 0.74000000000000155 0 0.1066666666666673 0.82000000000000084 0 0.053333333333333809 0.90000000000000002 0 3.1005471627654208e-016 0.82000000000000084 0 -0.053333333333333253 0.74000000000000155 0 -0.10666666666666684 0.66000000000000236 0 -0.16000000000000034 0.65333333333333421 0 -0.15999999999999992 0.64666666666666828 0 -0.16000000000000017 0.64000000000000234 0 -0.16000000000000036 0.70666666666666778 0 -0.11333333333333308 0.77333333333333543 0 -0.066666666666666388 0.84000000000000008 0 -0.019999999999999712 0.56666666671999943 0 -0.019999999999999865 0.29333333343999884 0 -0.019999999999999914 0.020000000159998661 0 -0.019999999999999969 0.019999999999999976 0 -0.29333333344000118 0.01999999999999998 0 -0.56666666672000088 0.020000000000000004 0 -0.83999999999999997 0.066666666666666666 0 -0.77333333333333532 0.11333333333333334 0 -0.70666666666666766 0.16000000000000003 0 -0.64000000000000001 0.16000000000000036 0 -0.64666666666666828 0.1600000000000002 0 -0.65333333333333421 0.16000000000000003 0 -0.66000000000000003 0.10666666666666708 0 -0.74000000000000143 0.053333333333333538 0 -0.82000000000000073 0 0 -0.89999999999999991 -0.053333333333333538 0 -0.82000000000000073 -0.10666666666666709 0 -0.74000000000000143 -0.16000000000000059 0 -0.66000000000000236 -0.1600000000000002 0 -0.65333333333333421 -0.16000000000000042 0 -0.64666666666666828 -0.16000000000000059 0 -0.64000000000000234 -0.11333333333333334 0 -0.70666666666666766 -0.066666666666666666 0 -0.77333333333333532 -0.020000000000000004 0 -0.83999999999999997 -0.020000000000000025 0 -0.56666666672000121 -0.020000000000000032 0 -0.29333333344000168 -0.020000000000000032 0 -0.020000000160001762 -0.29333333344000118 0 -0.020000000000000035 -0.56666666672000099 0 -0.020000000000000101 -0.84000000000000008 0 -0.020000000000000184 -0.77333333333333543 0 -0.066666666666666818 -0.70666666666666778 0 -0.11333333333333348 -0.64000000000000012 0 -0.16000000000000014 -0.64666666666666828 0 -0.16000000000000048 -0.65333333333333421 0 -0.16000000000000034 -0.66000000000000014 0 -0.16000000000000014 -0.74000000000000155 0 -0.10666666666666721 -0.82000000000000084 0 -0.053333333333333705 -0.90000000000000002 0 -1.9984014443252816e-016 -0.82000000000000084 0 0.053333333333333351 -0.74000000000000155 0 0.10666666666666692 -0.66000000000000236 0 0.16000000000000042 -0.65333333333333421 0 0.16000000000000003 -0.64666666666666828 0 0.16000000000000025 -0.64000000000000234 0 0.16000000000000045 -0.70666666666666778 0 0.11333333333333316 -0.77333333333333543 0 0.066666666666666485 -0.84000000000000008 0 0.019999999999999813 -0.56666666672000132 0 0.019999999999999896 -0.29333333344000168 0 0.019999999999999962 -0.020000000000000028 0 0.020000000159999452 -0.020000000000000025 0 0.2933333334399994 -0.020000000000000014 0 0.56666666671999977 -0.020000000000000004 0 0.83999999999999997 -0.066666666666666763 0 0.77333333333333532 -0.11333333333333342 0 0.70666666666666766 -0.16000000000000011 0 0.64000000000000001 -0.16000000000000048 0 0.64666666666666828 -0.16000000000000028 0 0.65333333333333421 -0.16000000000000011 0 0.66000000000000003 -0.10666666666666716 0 0.74000000000000143 -0.053333333333333635 0 0.82000000000000073 -1.1021457184401396e-016 0 0.89999999999999991 0.053333333333333434 0 0.82000000000000073 0.10666666666666701 0 0.74000000000000143 0.1600000000000005 0 0.66000000000000236 0.16000000000000011 0 0.65333333333333421 0.16000000000000034 0 0.64666666666666828 0.1600000000000005 0 0.64000000000000234 0.11333333333333324 0 0.70666666666666766 0.066666666666666569 0 0.77333333333333532 0.0199999999999999 0 0.83999999999999997 ; } select -clear; string $handleToMove; if ($createRotateControl) { $handleToMove = $rotateControl; } else { $handleToMove = $translateControl; } move -absolute $pos[0] $pos[1] $pos[2] $handleToMove; scale -absolute $scale $scale $scale $handleToMove; makeIdentity -apply true -scale true $handleToMove; $names[0] = $rotateControl; $names[1] = $translateControl; return $names; }