mel grouping

450 views
Skip to first unread message

mikael persson

unread,
Jun 23, 2022, 4:42:28 AM6/23/22
to maya...@googlegroups.com
Hello all,
I was wondering if anyone here could explain what is going on here.
I am by no means knowledgeable in mel scripting, but I manage to knock together what I need for most of the time. Looking at an old script I had just copied the output:
-------------
select -r L_Finger_Pinky_00_SDK_Grp ;
doGroup 0 1 1 ;
rename "group1" "L_Finger_Pinky_0_DK" ;
-------------

and thought I could make that nicer. so:
-------------
group -n L_Finger_Pinky_0_DK L_Finger_Pinky_00_SDK_Grp ;
-------------
I changed all the group occurrences to follow the above pattern. But the cleaner version does not produce the same results I got the pivot shifted in an undesirable way. I tried adding the -r / -a switches but that didn't work either.

Is this too little information, or can anyone explain to me why that doesn't work?

Thanks,
Mikael

stephenkmann

unread,
Jun 23, 2022, 11:30:29 AM6/23/22
to maya...@googlegroups.com
doGroup is a mel script that does the grouping based on your ui settings. and if "zeroPivot" ( or world pivot ) . is set on the settings, it puts the pivot at world 0 0 0 using a second step using the xform command
 xform -os -piv 0 0 0;

group is the mel command that takes only certain flags.

to help you learn.. run the following to open the particular page that explains the mel command
help -doc group;   

if you run :
whatIs doGroup
it will give you the path of the mel script that you were first running and you can open it in a text editor to see what it is actually doing. 

and you can run 
help group;
to get all the flags for the mel command

Synopsis: group [flags] [String...]
Flags:
   -a -absolute  
  -em -empty      
   -n -name        String
   -p -parent      String
   -r -relative  
 -uag -useAsGroup  String
   -w -world      


With no flags given, group will center the pivot of the objects grouped.
so I'm guessing that's what's happening in your scenario.


so basically, you want to add the xform command, to set your pivot to where you want it.

hope that makes sense and helps
-=s





--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/CAH6DiR5Ae3ZGOzr%3De8KX0znpzFuhgs0YaBGNwJAwbiO3UZ5P3w%40mail.gmail.com.


--

mikael persson

unread,
Jun 27, 2022, 3:31:05 AM6/27/22
to maya...@googlegroups.com
Excellent Stephen, thank you for that!
I read the mel docs carefully when I try to hack my scripts together, but wasn't aware of the whatis! A very helpful command.

Mikael

Reply all
Reply to author
Forward
0 new messages