Guest User

Untitled

a guest
Nov 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. // Script to combine the selected curves.
  2. // select the required curves , load and run the script.
  3. //MEL by Aishwarya k vishwanath
  4.  
  5.  
  6. //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.
  7.  
  8. //Freezing transforms and Centering Pivot
  9. FreezeTransformations;
  10. makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
  11.  
  12. string $objects[] = `ls -sl`;
  13. //filters only the curves from the selection
  14. string $selectedCurves[] = `filterExpand -selectionMask 9 $objects`;
  15. if(size($selectedCurves)>1)
  16. {
  17. combCurve($selectedCurves);
  18. }
  19. else
  20. {
  21. warning "Please select atleast 2 curves";
  22. }
  23.  
  24.  
  25. CenterPivot;
  26. //combining command
  27. proc combCurve(string $curvesTwo[])
  28. {
  29. delete -ch $curvesTwo;
  30. makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1 $curvesTwo;
  31. string $SelShape[] =`listRelatives -s $curvesTwo `;
  32. select -r $SelShape;
  33. select -tgl $curvesTwo[0];
  34. //command to parent the transform node to the shape nodes
  35. parent -r -s;
  36. //Deletes the empty transform nodes
  37. for($c=1;$c<size($curvesTwo);$c++)
  38. {
  39. delete $curvesTwo[$c];
  40. }
  41. select $curvesTwo[0];
  42. rename "myCurve";
  43. delete -ch ;
  44. xform -cp;
  45. makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
  46. }
  47. //the end
Add Comment
Please, Sign In to add comment