Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Unfold Along U Hotkey/MEL command doesn't exist

Unfold Along U Hotkey/MEL command doesn't exist

dovhaliuk.stanislav
Participant Participant
527 Views
3 Replies
Message 1 of 4

Unfold Along U Hotkey/MEL command doesn't exist

dovhaliuk.stanislav
Participant
Participant

Hello. I tried to add the "Unfold Along U" command to the hot button in Hotkeyeditor and It's not in the hotkey editor.
MEL script 

unfold -i 5000 -ss 0.001 -gb 0 -gmb 0.5 -pub 0 -ps 0 -oa 2 -us off

unfolds the entire mesh, but I only need the selected shell.
I tried to write my own scripts - nothing happened. help me please

In the Script Editor and Echo All Command when I press Unfold Along U button [not hotkey] Maya write:

unfold -i 5000 -ss 0.001 -gb 0 -gmb 0.5 -pub 0 -ps 0 -oa 2 -us off lod00_tst:wersdasd.map[8:9] lod00_tst:wersdasd.map[13] lod00_tst:wersdasd.map[15] lod00_tst:wersdasd.map[51:52] lod00_tst:wersdasd.map[55:57] ;

I tried to combine 
unfold -i 5000 -ss 0.001 -gb 0 -gmb 0.5 -pub 0 -ps 0 -oa 2 -us off
and 
$shellUVs = `ls -sl`;
print $shellUVs;

and in some reasone Maya write another values
lod00_tst:wersdasd.f[7]
lod00_tst:wersdasd.f[9:10]
lod00_tst:wersdasd.f[19]
lod00_tst:wersdasd.f[39:40]

💁‍♂️💁‍♂️💁‍♂️💁‍♂️💁‍♂️

0 Likes
Accepted solutions (1)
528 Views
3 Replies
Replies (3)
Message 2 of 4

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

Thats because when you use UV Shell selection, you actually select faces, not UV's. But the unfold command only takes UVs as positional input. When you hit the unfold along U button from the menu, Maya automatically converts your selections to UV's, if you do it via code, you have to add that line yourself. This should work for what you want to do:

string $slUVs[] =`polyListComponentConversion -tuv`;
unfold -i 5000 -ss 0.001 -gb 0 -gmb 0.5 -pub 0 -ps 0 -oa 2 -us off $slUVs;

 

I hope it helps!

 

Message 3 of 4

dovhaliuk.stanislav
Participant
Participant

Works. Thank you !! 🦾🦾
Tell me, what should I read to better understand mEl? Please.

Message 4 of 4

Kahylan
Advisor
Advisor

Hi!

 

The official documentation is always helpful when you want to work with MEL, it lists most of the stable commands that can be used in MEL.

 

https://help.autodesk.com/cloudhelp/2024/ENU/Maya-Tech-Docs/Commands/

 

Sadly there aren't many good written tutorials on MEL since it is quite a niche language.