Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Script to combine the selected curves.
- // select the required curves , load and run the script.
- //MEL by Aishwarya k vishwanath
- //The script works only for the curves in selection and ignores other objects in the selection.Selects the curves and picks all the shape nodes and 1 transform node and combines it.
- //Freezing transforms and Centering Pivot
- FreezeTransformations;
- makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
- string $objects[] = `ls -sl`;
- //filters only the curves from the selection
- string $selectedCurves[] = `filterExpand -selectionMask 9 $objects`;
- if(size($selectedCurves)>1)
- {
- combCurve($selectedCurves);
- }
- else
- {
- warning "Please select atleast 2 curves";
- }
- CenterPivot;
- //combining command
- proc combCurve(string $curvesTwo[])
- {
- delete -ch $curvesTwo;
- makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1 $curvesTwo;
- string $SelShape[] =`listRelatives -s $curvesTwo `;
- select -r $SelShape;
- select -tgl $curvesTwo[0];
- //command to parent the transform node to the shape nodes
- parent -r -s;
- //Deletes the empty transform nodes
- for($c=1;$c<size($curvesTwo);$c++)
- {
- delete $curvesTwo[$c];
- }
- select $curvesTwo[0];
- rename "myCurve";
- delete -ch ;
- xform -cp;
- makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
- }
- //the end
Add Comment
Please, Sign In to add comment