MEL Parent Command not working as expected

MEL Parent Command not working as expected

stebeltz173892
Observer Observer
102 Views
2 Replies
Message 1 of 3

MEL Parent Command not working as expected

stebeltz173892
Observer
Observer

I am learning how to script to make Controls for a rig and I am having issues with the Parent Command. 

For now, I want to be able to parent a Nurbs Curve to a Null Group and it works fine in the Maya Editor but when I run the script the compiler gives me the error "Wrong number of arguments on call to parent."

But I ran the exact same commands in the Maya Editor and it worked there, this includes using the Technical Documentation of the Parent Command's examples.  

Interestingly, once I receive this script error, trying to use parent commands in the editor ceases to work as before.  

I originally began in Maya 2024 but upgraded to 2026 hoping that would resolve the issue.  

 

    // Y Normal
    curve -d 2
          -p -1 0 -1 -p 1 0 -1 -p 1 0 1 -p -1 0 1
          -p -1 0 -1 -p 1 0 -1
          -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6
          -name YCurve
    ;
    // X Normal
    curve -d 2
          -p 0 -1 -1 -p 0 1 -1 -p 0 1 1 -p 0 -1 1
          -p 0 -1 -1 -p 0 1 -1
          -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6
          -name XCurve
    ;
    // Z Normal
    curve -d 2
          -p -1 -1 0 -p 1 -1 0 -p 1 1 0 -p -1 1 0
          -p -1 -1 0 -p 1 -1 0
          -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6
          -name ZCurve
    ;

    group -em -name Grp;
    parent YCurve XCurve ZCurve Grp;

 

 

This is the code, creates 3 curves that are circle-esque shaped with different Normal Directions,  no issues there besides being visually ugly but I cant group them to the empty group I make. 

Any help would be appreciated, been working on this error all week.  I originally was using 3 circles to create a sphere looking control but now I think I need to use one monster curve to achieve what I want but thats even uglier ha. 

Please help me understand how to use the Parent command properly, my ultimate goal is to parent all the Nurbs shapes under one transform node and I feel like I can get there if I can get past this. 

0 Likes
103 Views
2 Replies
Replies (2)
Message 2 of 3

stebeltz173892
Observer
Observer

UPDATE 07/30/2025
Still having the issue as described above but using python to parent the objects causes 0 issues and behaves as expected.


I enjoy using MEL but Ill take this as my sign to just use Python from now on  

0 Likes
Message 3 of 3

mcw0
Advisor
Advisor

This is working.

global proc test()
{
    parent locator1 locator2 locator3 null1;
}

group -empty;
for($i=0;$i<3;$i++)
    spaceLocator;
test;
0 Likes