MEL Parent Command not working as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.