In Illustrator I’m a beast. I can tweak lines and curves with the best of them (seriously, I really am quite good). But in Maya, I can’t create a control that looks decent to save my life – unless I’m using 2011′s new bezier curve, then I’m a quite a bit better. So that makes it difficult to create nifty looking control objects for my rigs that are intuitive. I got rather tired of that so I decided to find some control objects so I could use them. The problem with that is that I have to import them into my scene. That’s lame and makes it so I have to create a library of controllers and where the source came from to give credit and all that – because giving credit is a MUST if you’re using someone elses stuff. So I decided to write my own curve deconstructor. This saves me time in that I can grab a curve that someones made, pass the script the name, the number of points and the degree and it writes out the necessary data for me. Now I will say it’s not perfect and I should tweak it, but I haven’t had a need to use it lately so instead, I’m throwing it out there for everyone else to play with. So without further ado, here’s the script:
"""
Control Curve Deconstructor
Original file creation date: 2010-09-07
Concept and scripting by John P. Neumann (john@animateshmanimate.com) http://animateshmanimate.com
This work is licensed under the 3-clause BSD ("New BSD License") license.
This is one of the most permissive licenses available, next to the MIT license.
In other words: Use it, Share it, Make it better, Give credit where it's due. Done.
"""
import maya.cmds as cmds
def getCVList(crvName, amount, degree):
# creates a list element
cvList = []
# change the range to the maximum number of cv's you have plus one
for i in range(amount):
name = crvName + '.cv['+str(i)+']'
this = cmds.xform(name, q=True, t=True, ws=True)
cvList.append(this)
print cvList
print 'Approximate number of keys:'
print amount / degree + 1
def getKeys(numKeys):
newList = []
for i in range(numKeys):
aName = str(i) + ', ' + str(i) + ', ' + str(i)
newList.append(aName)
print newList
To use it, simply save the file as ccurve.py in your maya scripts directory and call it like so:
ccurve.getCVList('name_of_ctrl', 202, 3)
The first part is a string which is the name of the control. The second is the number of spans and the third is the degree. If you’re not sure of the latter two, simply select the curve and go to the attribute editor. There you’ll see ‘Nurbs Curve History’. What we want are the spans and the degree. Which should be listed there. The above could will output a bunch of data:
[[734.7964485250742, -512.48407104235093, 93.079598984892897], [734.7964485250742, -512.57585123913555, 93.067528512067881], [734.7964485250742, -513.2179893288926, 92.980559245025418], [734.7964485250742, -513.30967377732361, 92.967781813673554], [732.5614994028291, -515.63618572554822, 93.403895924560487], [716.4957600565026, -532.13461115614416, 93.403884113707107], [714.15533665369935, -534.46112253757042, 92.96776666994279], [714.05782639590507, -534.46574931831947, 92.980544037715561], [713.37488559664644, -534.49724138201282, 93.067512861515951], [713.27727350702276, -534.50161216796289, 93.07958327128199], [713.27727350702276, -535.92799582107898, 92.550935690934878], [713.27727350702276, -545.66834372714322, 88.259752785377998], [713.27727350702276, -547.02111754733016, 87.564021816180315], [713.27727350702276, -548.92543272483738, 86.540453266010616], [715.02492144271628, -550.328678196346, 85.47057012834621], [717.17813475386288, -550.15764049162567, 85.172627697727705], [717.50506460951158, -550.12961568431217, 85.123809343773317], [719.78824592564797, -549.91866722933901, 84.756343611508797], [720.11360396155226, -549.88642563470341, 84.700179743498211], [722.24709324785692, -549.66139769437314, 84.308187979993946], [723.96566026083519, -550.94310715274867, 83.095382337585036], [723.96566026083519, -552.75119667571903, 81.989159884255756], [723.96566026083519, -553.25495531025854, 81.671409959709464], [723.82718793993627, -553.76836548695576, 81.38280196595133], [723.56123767453732, -554.24968464233461, 81.146846331166387], [721.36675276452365, -558.15273267840803, 79.080873055562947], [705.77541590511692, -581.74460101907869, 58.868331956231245], [703.52824260920727, -584.43752626492187, 55.269428615115501], [702.55422382439065, -585.5426943974403, 53.664159843358931], [700.18502780875224, -585.99856577008813, 53.01860190585618], [698.23541851528432, -585.45541398203602, 53.828022502896538], [697.47298935321078, -585.23236063658806, 54.137726948890112], [696.8526561301187, -584.87456098523626, 54.644377368321003], [696.47175739079046, -584.43752626492187, 55.269428615115501], [694.22458409488058, -581.74460101907869, 58.868331956231252], [678.63324723547385, -558.15273267840803, 79.080873055562947], [676.43876232546063, -554.24968464233461, 81.146846331166401], [675.49164251482671, -552.52855116209366, 81.972133282945819], [676.25914094730376, -550.65812581747593, 83.327662042967106], [678.15932347096464, -550.05830553177316, 84.182898554812596], [678.69418634349813, -549.88435142681112, 84.416787249059865], [679.28606052761779, -549.82549792732539, 84.594045547778535], [679.88639603844513, -549.88642563470353, 84.700179743498211], [680.21175407434976, -549.91866722933901, 84.756343611508754], [682.49493539048581, -550.12961568431228, 85.123809343773303], [682.82186524613417, -550.15764049162567, 85.172627697727691], [684.97507855728031, -550.328678196346, 85.470570128346168], [686.72272649297497, -548.92543272483749, 86.540453266010658], [686.72272649297497, -547.02111754733028, 87.564021816180343], [686.72272649297497, -545.66834372714322, 88.259752785378041], [686.72272649297497, -535.92799582107909, 92.550935690934907], [686.72272649297497, -534.50161216796289, 93.079583271282047], [686.62511440335095, -534.49724138201293, 93.067512861515979], [685.94217360409198, -534.46574931831947, 92.980544037715561], [685.84466334629781, -534.46112253757042, 92.967766669942833], [683.50423994349489, -532.13461115614416, 93.403884113707136], [667.43850059716829, -515.63618572554822, 93.403895924560501], [665.20355147492296, -513.30967377732372, 92.967781813673511], [665.20355147492296, -513.21798932889271, 92.980559245025361], [665.20355147492296, -512.57585123913555, 93.067528512067867], [665.20355147492296, -512.48407104235093, 93.079598984892854], [663.76497585839252, -512.41480512509565, 92.550952566319197], [653.94137198130352, -511.85255381119032, 88.259777985630663], [652.57703517253958, -511.76139579303452, 87.564048228026166], [650.65644259483292, -511.62728291108237, 86.540481407027485], [649.11851097996873, -513.03052849258995, 85.470598586261701], [649.11851097996873, -514.89791896895349, 85.172654779052252], [649.11851097996873, -515.18145134812426, 85.123836212573352], [649.11851097996873, -517.16155751664712, 84.756368970158533], [649.11851097996873, -517.44372671732651, 84.700204883241511], [649.11851097996873, -519.29401130807605, 84.308211661242382], [647.59574880572723, -520.57534416734165, 83.095406261296347], [645.73579715979668, -520.30849799366047, 81.989185602436422], [645.21758901239309, -520.2318494371566, 81.671436183335885], [644.70798537522626, -520.03901787526695, 81.382828785662269], [644.24858338102069, -519.7468175941533, 81.14687378784086], [640.53317061370626, -517.37732218099609, 79.08090571620383], [618.12458261751715, -503.45660039003411, 58.868397489323485], [615.51212827950826, -501.9852383430333, 55.26949805416956], [614.43054924887997, -501.3966534721178, 53.664164851638454], [614.00124349509588, -500.10000287606988, 53.018574644252126], [614.53186067666229, -499.0325057287734, 53.828094822976695], [614.74163187503279, -498.60658424593055, 54.137865060790318], [615.08517973437563, -498.24861861377326, 54.644449472326514], [615.51212827950826, -498.01482821088621, 55.269500353165775], [618.12458261751715, -496.54347033164527, 58.868401492249951], [640.53317061370626, -482.62277194808803, 79.080925840215343], [644.24858338102069, -480.2532789274573, 81.14689665588034], [645.89267827793856, -479.20819396562706, 81.972182544843704], [647.91719095746316, -479.57334225803049, 83.327709473547429], [648.75796897812074, -481.10299673913113, 84.18294474013102], [648.99504540517171, -481.53722043862388, 84.416833075751171], [649.11851097996851, -482.03572831698227, 84.594091085018874], [649.11851097996851, -482.55637391927041, 84.700225084150006], [649.11851097996851, -482.83854318499124, 84.756388844296779], [649.11851097996851, -484.81864977906361, 85.123853793619986], [649.11851097996851, -485.10218221476924, 85.172672031749968], [649.11851097996851, -486.96957303616989, 85.47061367639995], [650.65644259483292, -488.37281985667028, 86.54049487211563], [652.57703517253958, -488.23870816007485, 87.564061848425041], [653.94137198130352, -488.14755094761938, 88.259791711595966], [663.76497585839252, -487.58530460317286, 92.550966943405115], [665.20355147492296, -487.51603929812438, 93.079613442192823], [665.20355147492296, -487.42425908736152, 93.067543075655266], [665.20355147492296, -486.78212089688878, 92.980574552250403], [665.20355147492296, -486.69043643366081, 92.967797227075096], [667.43850059716829, -484.36392499048623, 93.403914032213478], [683.50423994349489, -467.86549955988767, 93.403921327606724], [685.84466334629781, -465.53898767341076, 92.967806578093757], [685.94217360409198, -465.53436090745868, 92.980583951224588], [686.62511440335095, -465.50286894448078, 93.067552811494807], [686.72272649297497, -465.49849817250907, 93.079623226322511], [686.72272649297497, -464.07211390718572, 92.550977297820523], [686.72272649297497, -454.33176103165988, 88.259805672221063], [686.72272649297497, -452.97898640577228, 87.564076269623655], [686.72272649297497, -451.07467004290754, 86.540509924775108], [684.97507855728031, -449.67142333240594, 85.470628412160607], [682.82186524613417, -449.8424606920895, 85.172685783469575], [682.49493539048581, -449.87048544286807, 85.123867397060664], [680.21175407434976, -450.08143347229191, 84.756401420504375], [679.88639603844513, -450.11367500188612, 84.700237515156005], [677.75290675214023, -450.33870248826429, 84.308245491055018], [676.0343397391614, -449.05699162538212, 83.095441332949562], [676.0343397391614, -447.24890082133572, 81.989220973505965], [676.0343397391614, -446.74514181882159, 81.671471632345032], [676.17281206006112, -446.23173130789775, 81.382864233149462], [676.43876232546006, -445.75041187926735, 81.146909155763467], [678.63324723547385, -441.84736145066552, 79.080940400144144], [694.22458409488058, -418.25546970257733, 58.868426621739502], [696.47175739079046, -415.56254028897229, 55.269526399208232], [697.44577617560617, -414.45732716751053, 53.664192864684054], [699.81497219124572, -414.00143422991232, 53.018601905856244], [701.76458148471261, -414.54465090261721, 53.828121465770252], [702.52701064678604, -414.76774810232666, 54.137891456453559], [703.1473438698788, -415.1255048448084, 54.644475658528691], [703.52824260920727, -415.56254028897229, 55.269526399208225], [705.77541590511692, -418.25546970257733, 58.868426621739488], [721.36675276452365, -441.84736145066552, 79.080940400144186], [723.56123767453732, -445.7504118792674, 81.146909155763495], [724.50835748517022, -447.47154631524302, 81.972194114358189], [723.74085905269362, -449.34197322964968, 83.327720708304668], [721.84067652903286, -449.94179450577144, 84.182956525518875], [721.30581365649823, -450.11574888159151, 84.416845018315897], [720.71393947237993, -450.17460258635396, 84.594103248878156], [720.11360396155226, -450.11367500188612, 84.700237515156033], [719.78824592564729, -450.08143347229191, 84.756401420504432], [717.50506460951158, -449.87048544286807, 85.123867397060707], [717.17813475386242, -449.8424606920895, 85.172685783469632], [715.02492144271628, -449.67142333240594, 85.470628412160664], [713.27727350702276, -451.07467004290754, 86.540509924775108], [713.27727350702276, -452.97898640577245, 87.564076269623641], [713.27727350702276, -454.33176103165999, 88.259805672221034], [713.27727350702276, -464.07211390718572, 92.550977297820509], [713.27727350702276, -465.49849817250913, 93.079623226322497], [713.37488559664644, -465.50286894448078, 93.067552811494778], [714.05782639590484, -465.53436090745862, 92.980583951224588], [714.15533665369935, -465.53898767341082, 92.967806578093757], [716.4957600565026, -467.86549955988767, 93.40392132760671], [732.5614994028291, -484.36392499048623, 93.403914032213464], [734.7964485250742, -486.69043643366081, 92.967797227075124], [734.7964485250742, -486.78212089688878, 92.980574552250459], [734.7964485250742, -487.42425908736152, 93.067543075655323], [734.7964485250742, -487.5160392981245, 93.07961344219288], [736.23502414160441, -487.58530460317286, 92.550966943405157], [746.05862801869307, -488.14755094761938, 88.259791711596108], [747.42296482745724, -488.23870816007485, 87.564061848425197], [749.34355740516423, -488.37281985667028, 86.540494872115687], [750.88148902002877, -486.96957303616989, 85.470613676399992], [750.88148902002877, -485.10218221476924, 85.172672031750025], [750.88148902002877, -484.81864977906361, 85.123853793620043], [750.88148902002877, -482.83854318499124, 84.756388844296836], [750.88148902002877, -482.55637391927041, 84.700225084150063], [750.88148902002877, -480.70608887456854, 84.308234004900754], [752.40425119426959, -479.42475461079641, 83.095430088822184], [754.2642028402006, -479.69159950340219, 81.989209120937829], [754.7824109876035, -479.76824769193161, 81.671459613073679], [755.2920146247709, -479.96107891959502, 81.382851992088519], [755.75141661897646, -480.2532789274573, 81.146896655880312], [759.46682938629101, -482.62277194808803, 79.080925840215201], [781.87541738248024, -496.54347033164527, 58.868401492249887], [784.48787172048901, -498.01482821088621, 55.269500353165398], [785.56945075111707, -498.60341122272126, 53.664166469016223], [785.99875650490071, -499.900061071133, 53.018574760025018], [785.46813932333521, -500.96755915590563, 53.828093702518409], [785.25836812496436, -501.39348099748236, 54.137863447086517], [784.91482026562153, -501.75144721629681, 54.64444744407497], [784.48787172048901, -501.98523834303319, 55.269498054169205], [781.87541738248024, -503.45660039003405, 58.868397489323421], [759.46682938629101, -517.37732218099598, 79.080905716203674], [755.75141661897646, -519.7468175941533, 81.146873787840818], [754.10732172205849, -520.79190351171746, 81.972158466527475], [752.08280904253343, -520.42675678910223, 83.327685818095873], [751.24203102187607, -518.89710329842069, 84.182922856117898], [751.00495459482545, -518.46287986978609, 84.416811694596902], [750.88148902002877, -517.96437219670418, 84.594070281169138], [750.88148902002877, -517.44372671732651, 84.70020488324154], [750.88148902002877, -517.16155751664712, 84.75636897015859], [750.88148902002877, -515.18145134812426, 85.123836212573394], [750.88148902002877, -514.89791896895349, 85.172654779052294], [750.88148902002877, -513.03052849258995, 85.47059858626173], [749.34355740516423, -511.62728291108232, 86.540481407027542], [747.42296482745724, -511.76139579303452, 87.564048228026294]] Approximate number of keys: 68
Now we run the second part, which will get us the keys, using the number that maya gave to us in that last line in the above output:
ccurve.getKeys(68)
And the output:
['0, 0, 0', '1, 1, 1', '2, 2, 2', '3, 3, 3', '4, 4, 4', '5, 5, 5', '6, 6, 6', '7, 7, 7', '8, 8, 8', '9, 9, 9', '10, 10, 10', '11, 11, 11', '12, 12, 12', '13, 13, 13', '14, 14, 14', '15, 15, 15', '16, 16, 16', '17, 17, 17', '18, 18, 18', '19, 19, 19', '20, 20, 20', '21, 21, 21', '22, 22, 22', '23, 23, 23', '24, 24, 24', '25, 25, 25', '26, 26, 26', '27, 27, 27', '28, 28, 28', '29, 29, 29', '30, 30, 30', '31, 31, 31', '32, 32, 32', '33, 33, 33', '34, 34, 34', '35, 35, 35', '36, 36, 36', '37, 37, 37', '38, 38, 38', '39, 39, 39', '40, 40, 40', '41, 41, 41', '42, 42, 42', '43, 43, 43', '44, 44, 44', '45, 45, 45', '46, 46, 46', '47, 47, 47', '48, 48, 48', '49, 49, 49', '50, 50, 50', '51, 51, 51', '52, 52, 52', '53, 53, 53', '54, 54, 54', '55, 55, 55', '56, 56, 56', '57, 57, 57', '58, 58, 58', '59, 59, 59', '60, 60, 60', '61, 61, 61', '62, 62, 62', '63, 63, 63', '64, 64, 64', '65, 65, 65', '66, 66, 66', '67, 67, 67']
Now after some copy and paste and some string manipulation (cleaning up the actual output), we will have this:
cmds.curve(d=3, p=[(734.7964485250742, -512.48407104235093, 93.079598984892897), (734.7964485250742, -512.57585123913555, 93.067528512067881), (734.7964485250742, -513.2179893288926, 92.980559245025418), (734.7964485250742, -513.30967377732361, 92.967781813673554), (732.5614994028291, -515.63618572554822, 93.403895924560487), (716.4957600565026, -532.13461115614416, 93.403884113707107), (714.15533665369935, -534.46112253757042, 92.96776666994279), (714.05782639590507, -534.46574931831947, 92.980544037715561), (713.37488559664644, -534.49724138201282, 93.067512861515951), (713.27727350702276, -534.50161216796289, 93.07958327128199), (713.27727350702276, -535.92799582107898, 92.550935690934878), (713.27727350702276, -545.66834372714322, 88.259752785377998), (713.27727350702276, -547.02111754733016, 87.564021816180315), (713.27727350702276, -548.92543272483738, 86.540453266010616), (715.02492144271628, -550.328678196346, 85.47057012834621), (717.17813475386288, -550.15764049162567, 85.172627697727705), (717.50506460951158, -550.12961568431217, 85.123809343773317), (719.78824592564797, -549.91866722933901, 84.756343611508797), (720.11360396155226, -549.88642563470341, 84.700179743498211), (722.24709324785692, -549.66139769437314, 84.308187979993946), (723.96566026083519, -550.94310715274867, 83.095382337585036), (723.96566026083519, -552.75119667571903, 81.989159884255756), (723.96566026083519, -553.25495531025854, 81.671409959709464), (723.82718793993627, -553.76836548695576, 81.38280196595133), (723.56123767453732, -554.24968464233461, 81.146846331166387), (721.36675276452365, -558.15273267840803, 79.080873055562947), (705.77541590511692, -581.74460101907869, 58.868331956231245), (703.52824260920727, -584.43752626492187, 55.269428615115501), (702.55422382439065, -585.5426943974403, 53.664159843358931), (700.18502780875224, -585.99856577008813, 53.01860190585618), (698.23541851528432, -585.45541398203602, 53.828022502896538), (697.47298935321078, -585.23236063658806, 54.137726948890112), (696.8526561301187, -584.87456098523626, 54.644377368321003), (696.47175739079046, -584.43752626492187, 55.269428615115501), (694.22458409488058, -581.74460101907869, 58.868331956231252), (678.63324723547385, -558.15273267840803, 79.080873055562947), (676.43876232546063, -554.24968464233461, 81.146846331166401), (675.49164251482671, -552.52855116209366, 81.972133282945819), (676.25914094730376, -550.65812581747593, 83.327662042967106), (678.15932347096464, -550.05830553177316, 84.182898554812596), (678.69418634349813, -549.88435142681112, 84.416787249059865), (679.28606052761779, -549.82549792732539, 84.594045547778535), (679.88639603844513, -549.88642563470353, 84.700179743498211), (680.21175407434976, -549.91866722933901, 84.756343611508754), (682.49493539048581, -550.12961568431228, 85.123809343773303), (682.82186524613417, -550.15764049162567, 85.172627697727691), (684.97507855728031, -550.328678196346, 85.470570128346168), (686.72272649297497, -548.92543272483749, 86.540453266010658), (686.72272649297497, -547.02111754733028, 87.564021816180343), (686.72272649297497, -545.66834372714322, 88.259752785378041), (686.72272649297497, -535.92799582107909, 92.550935690934907), (686.72272649297497, -534.50161216796289, 93.079583271282047), (686.62511440335095, -534.49724138201293, 93.067512861515979), (685.94217360409198, -534.46574931831947, 92.980544037715561), (685.84466334629781, -534.46112253757042, 92.967766669942833), (683.50423994349489, -532.13461115614416, 93.403884113707136), (667.43850059716829, -515.63618572554822, 93.403895924560501), (665.20355147492296, -513.30967377732372, 92.967781813673511), (665.20355147492296, -513.21798932889271, 92.980559245025361), (665.20355147492296, -512.57585123913555, 93.067528512067867), (665.20355147492296, -512.48407104235093, 93.079598984892854), (663.76497585839252, -512.41480512509565, 92.550952566319197), (653.94137198130352, -511.85255381119032, 88.259777985630663), (652.57703517253958, -511.76139579303452, 87.564048228026166), (650.65644259483292, -511.62728291108237, 86.540481407027485), (649.11851097996873, -513.03052849258995, 85.470598586261701), (649.11851097996873, -514.89791896895349, 85.172654779052252), (649.11851097996873, -515.18145134812426, 85.123836212573352), (649.11851097996873, -517.16155751664712, 84.756368970158533), (649.11851097996873, -517.44372671732651, 84.700204883241511), (649.11851097996873, -519.29401130807605, 84.308211661242382), (647.59574880572723, -520.57534416734165, 83.095406261296347), (645.73579715979668, -520.30849799366047, 81.989185602436422), (645.21758901239309, -520.2318494371566, 81.671436183335885), (644.70798537522626, -520.03901787526695, 81.382828785662269), (644.24858338102069, -519.7468175941533, 81.14687378784086), (640.53317061370626, -517.37732218099609, 79.08090571620383), (618.12458261751715, -503.45660039003411, 58.868397489323485), (615.51212827950826, -501.9852383430333, 55.26949805416956), (614.43054924887997, -501.3966534721178, 53.664164851638454), (614.00124349509588, -500.10000287606988, 53.018574644252126), (614.53186067666229, -499.0325057287734, 53.828094822976695), (614.74163187503279, -498.60658424593055, 54.137865060790318), (615.08517973437563, -498.24861861377326, 54.644449472326514), (615.51212827950826, -498.01482821088621, 55.269500353165775), (618.12458261751715, -496.54347033164527, 58.868401492249951), (640.53317061370626, -482.62277194808803, 79.080925840215343), (644.24858338102069, -480.2532789274573, 81.14689665588034), (645.89267827793856, -479.20819396562706, 81.972182544843704), (647.91719095746316, -479.57334225803049, 83.327709473547429), (648.75796897812074, -481.10299673913113, 84.18294474013102), (648.99504540517171, -481.53722043862388, 84.416833075751171), (649.11851097996851, -482.03572831698227, 84.594091085018874), (649.11851097996851, -482.55637391927041, 84.700225084150006), (649.11851097996851, -482.83854318499124, 84.756388844296779), (649.11851097996851, -484.81864977906361, 85.123853793619986), (649.11851097996851, -485.10218221476924, 85.172672031749968), (649.11851097996851, -486.96957303616989, 85.47061367639995), (650.65644259483292, -488.37281985667028, 86.54049487211563), (652.57703517253958, -488.23870816007485, 87.564061848425041), (653.94137198130352, -488.14755094761938, 88.259791711595966), (663.76497585839252, -487.58530460317286, 92.550966943405115), (665.20355147492296, -487.51603929812438, 93.079613442192823), (665.20355147492296, -487.42425908736152, 93.067543075655266), (665.20355147492296, -486.78212089688878, 92.980574552250403), (665.20355147492296, -486.69043643366081, 92.967797227075096), (667.43850059716829, -484.36392499048623, 93.403914032213478), (683.50423994349489, -467.86549955988767, 93.403921327606724), (685.84466334629781, -465.53898767341076, 92.967806578093757), (685.94217360409198, -465.53436090745868, 92.980583951224588), (686.62511440335095, -465.50286894448078, 93.067552811494807), (686.72272649297497, -465.49849817250907, 93.079623226322511), (686.72272649297497, -464.07211390718572, 92.550977297820523), (686.72272649297497, -454.33176103165988, 88.259805672221063), (686.72272649297497, -452.97898640577228, 87.564076269623655), (686.72272649297497, -451.07467004290754, 86.540509924775108), (684.97507855728031, -449.67142333240594, 85.470628412160607), (682.82186524613417, -449.8424606920895, 85.172685783469575), (682.49493539048581, -449.87048544286807, 85.123867397060664), (680.21175407434976, -450.08143347229191, 84.756401420504375), (679.88639603844513, -450.11367500188612, 84.700237515156005), (677.75290675214023, -450.33870248826429, 84.308245491055018), (676.0343397391614, -449.05699162538212, 83.095441332949562), (676.0343397391614, -447.24890082133572, 81.989220973505965), (676.0343397391614, -446.74514181882159, 81.671471632345032), (676.17281206006112, -446.23173130789775, 81.382864233149462), (676.43876232546006, -445.75041187926735, 81.146909155763467), (678.63324723547385, -441.84736145066552, 79.080940400144144), (694.22458409488058, -418.25546970257733, 58.868426621739502), (696.47175739079046, -415.56254028897229, 55.269526399208232), (697.44577617560617, -414.45732716751053, 53.664192864684054), (699.81497219124572, -414.00143422991232, 53.018601905856244), (701.76458148471261, -414.54465090261721, 53.828121465770252), (702.52701064678604, -414.76774810232666, 54.137891456453559), (703.1473438698788, -415.1255048448084, 54.644475658528691), (703.52824260920727, -415.56254028897229, 55.269526399208225), (705.77541590511692, -418.25546970257733, 58.868426621739488), (721.36675276452365, -441.84736145066552, 79.080940400144186), (723.56123767453732, -445.7504118792674, 81.146909155763495), (724.50835748517022, -447.47154631524302, 81.972194114358189), (723.74085905269362, -449.34197322964968, 83.327720708304668), (721.84067652903286, -449.94179450577144, 84.182956525518875), (721.30581365649823, -450.11574888159151, 84.416845018315897), (720.71393947237993, -450.17460258635396, 84.594103248878156), (720.11360396155226, -450.11367500188612, 84.700237515156033), (719.78824592564729, -450.08143347229191, 84.756401420504432), (717.50506460951158, -449.87048544286807, 85.123867397060707), (717.17813475386242, -449.8424606920895, 85.172685783469632), (715.02492144271628, -449.67142333240594, 85.470628412160664), (713.27727350702276, -451.07467004290754, 86.540509924775108), (713.27727350702276, -452.97898640577245, 87.564076269623641), (713.27727350702276, -454.33176103165999, 88.259805672221034), (713.27727350702276, -464.07211390718572, 92.550977297820509), (713.27727350702276, -465.49849817250913, 93.079623226322497), (713.37488559664644, -465.50286894448078, 93.067552811494778), (714.05782639590484, -465.53436090745862, 92.980583951224588), (714.15533665369935, -465.53898767341082, 92.967806578093757), (716.4957600565026, -467.86549955988767, 93.40392132760671), (732.5614994028291, -484.36392499048623, 93.403914032213464), (734.7964485250742, -486.69043643366081, 92.967797227075124), (734.7964485250742, -486.78212089688878, 92.980574552250459), (734.7964485250742, -487.42425908736152, 93.067543075655323), (734.7964485250742, -487.5160392981245, 93.07961344219288), (736.23502414160441, -487.58530460317286, 92.550966943405157), (746.05862801869307, -488.14755094761938, 88.259791711596108), (747.42296482745724, -488.23870816007485, 87.564061848425197), (749.34355740516423, -488.37281985667028, 86.540494872115687), (750.88148902002877, -486.96957303616989, 85.470613676399992), (750.88148902002877, -485.10218221476924, 85.172672031750025), (750.88148902002877, -484.81864977906361, 85.123853793620043), (750.88148902002877, -482.83854318499124, 84.756388844296836), (750.88148902002877, -482.55637391927041, 84.700225084150063), (750.88148902002877, -480.70608887456854, 84.308234004900754), (752.40425119426959, -479.42475461079641, 83.095430088822184), (754.2642028402006, -479.69159950340219, 81.989209120937829), (754.7824109876035, -479.76824769193161, 81.671459613073679), (755.2920146247709, -479.96107891959502, 81.382851992088519), (755.75141661897646, -480.2532789274573, 81.146896655880312), (759.46682938629101, -482.62277194808803, 79.080925840215201), (781.87541738248024, -496.54347033164527, 58.868401492249887), (784.48787172048901, -498.01482821088621, 55.269500353165398), (785.56945075111707, -498.60341122272126, 53.664166469016223), (785.99875650490071, -499.900061071133, 53.018574760025018), (785.46813932333521, -500.96755915590563, 53.828093702518409), (785.25836812496436, -501.39348099748236, 54.137863447086517), (784.91482026562153, -501.75144721629681, 54.64444744407497), (784.48787172048901, -501.98523834303319, 55.269498054169205), (781.87541738248024, -503.45660039003405, 58.868397489323421), (759.46682938629101, -517.37732218099598, 79.080905716203674), (755.75141661897646, -519.7468175941533, 81.146873787840818), (754.10732172205849, -520.79190351171746, 81.972158466527475), (752.08280904253343, -520.42675678910223, 83.327685818095873), (751.24203102187607, -518.89710329842069, 84.182922856117898), (751.00495459482545, -518.46287986978609, 84.416811694596902), (750.88148902002877, -517.96437219670418, 84.594070281169138), (750.88148902002877, -517.44372671732651, 84.70020488324154), (750.88148902002877, -517.16155751664712, 84.75636897015859), (750.88148902002877, -515.18145134812426, 85.123836212573394), (750.88148902002877, -514.89791896895349, 85.172654779052294), (750.88148902002877, -513.03052849258995, 85.47059858626173), (749.34355740516423, -511.62728291108232, 86.540481407027542), (747.42296482745724, -511.76139579303452, 87.564048228026294)], k=[0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67], name='grabber')
I added the name to it, but it can be changed to whatever you want. Now I could simply have Maya write nicer output or write it to a file, but honestly, copying and pasting it and doing a find and replace is easy enough for me. Maybe I’ll do that at a later date though.
Alright, well now we’ve got our curve, but something is missing. It isn’t closed. Why is that? Well, the data we grabbed only gives us the locations for the cv’s, it never tells us that it’s ended. There’s an easy fix though. Simply go to ‘Edit Curves’ -> ‘Close Curve’ and make sure that ‘Preserve’ is the option selected. That’s it. Or you can run this:
cmds.closeCurve('grabber', preserveShape=True, replaceOriginal=True, parameter=0.1)
That’ll close the curve for ya. So there ya go! You could wrap all of this up into one script and do it all for you, but again, I don’t mind the minute it takes me to do the find and replaces, so I’m easy. As a note, the pivot on this is WAY off when it’s created, so you’ll want to center that as well. And, as always, to give credit where credit is due, the curve used in this example can be grabbed from Creative Crash here. They’re awesome handles, but the scene is wonky and so that’s what inspired this actual script.
As always, I hope this helps someone out! I know it’s been a lifesaver for me when making my curves! Thanks for reading!
Just wanted to say that I lol’d because “495459482545″ shows up as a German phone number. (in two places on this page!)
Great site, great resources, very entertaining.
LoL! That’s awesome! When I got the email it actually asked if I wanted to make a new contact from that number.
And thanks for the comment and glad you like what I’ve got here.
This is exactly what I was looking for. Thanks for witring!