Geuse
04-19-2007, 09:54 AM
Hey. I'm trying to write a short script to mirror an object combine it and, weld points and freeze transformations and then delete history. This to just trying to learn and understand mel so I can make greater scripts in the future perhaps. I already got some help from this forum, but can't make the changes I want.
//(group) - (duplicate) - (scale -1) - (ungroup) - (freeze transformations) - (delete history)
group; xform -os -piv 0 0 0; //group the selected object so it's pivot point automatically lands in origin.
$groupName1 = `ls -sl -fl`; //returns the group name.
duplicate -rr; // duplicate the group.
$groupName2 = `ls -sl -fl`; //return the second group's name which you will scale in -1 in an array
setAttr ($groupName2[1] + ".scaleX") -1; //scale the group one unit in negative x
polyUnite -ch ($groupName1[1]) ($groupName2[1]); //I don't know the right way to write this. But basically I want to combine the two groups.
polyMergeVertex -d 0.01 -ch 1; //then just merge all the vertices
polySoftEdge -a 180 -ch 1; //and make sure the normals are smooth
FreezeTransformations;
DeleteHistory;
select -cl; //clear selection
//(group) - (duplicate) - (scale -1) - (ungroup) - (freeze transformations) - (delete history)
group; xform -os -piv 0 0 0; //group the selected object so it's pivot point automatically lands in origin.
$groupName1 = `ls -sl -fl`; //returns the group name.
duplicate -rr; // duplicate the group.
$groupName2 = `ls -sl -fl`; //return the second group's name which you will scale in -1 in an array
setAttr ($groupName2[1] + ".scaleX") -1; //scale the group one unit in negative x
polyUnite -ch ($groupName1[1]) ($groupName2[1]); //I don't know the right way to write this. But basically I want to combine the two groups.
polyMergeVertex -d 0.01 -ch 1; //then just merge all the vertices
polySoftEdge -a 180 -ch 1; //and make sure the normals are smooth
FreezeTransformations;
DeleteHistory;
select -cl; //clear selection
