Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. proc sc_pRiggerCreate()
  2.  
  3. //proc for the initial creation of the rig, taking the UI and implementing, shape is set at square.
  4.  
  5. {
  6.  
  7. //counter is based upon, the UI field "numOfEmits" where the user decideds how many to rig.
  8. int $counter = (`textFieldGrp -q -tx numOfEmits`);
  9.  
  10. //not sure if this int is needed.
  11. int $cubeSubCounter = $counter + 1;
  12.  
  13.  
  14. //if the input contained in the $counter var. is greater than 0 then create the root,
  15. //rename it, contain it and move it to the 0 0 0 coord's and perform the while loop.
  16. if ($counter>0)
  17.  
  18. {
  19.  
  20. polyCube -n "pRigRoot";
  21. move -r -os -wd 0 0 0 ;
  22. string $pRigRoot[] = `ls -sl`;
  23. int $vertCount = $counter;
  24. spaceLocator -n "locGrouper";
  25. group -n pSet "locGrouper";
  26. string $pSet[] = `ls -sl`;
  27. print $pSet;
  28. select -cl;
  29. select locGrouper;
  30. delete "locGrouper";
  31. int $pRigRootCheck = `objExists "root"`;
  32. //if the root group exists then move the new root to the group.
  33. if($pRigRootCheck == 0)
  34. {
  35. spaceLocator -n "locGrouper";
  36. select -cl;
  37. group -n "root" "locGrouper";
  38. delete "locGrouper";
  39. }
  40.  
  41. // while the counter is greater than 0, create a locator, emitter, and particals,
  42. //linking the partical to the emitter, and containing each in a var.
  43. //lastly subtracting 1 from the counter
  44. while ($counter>0)
  45. {
  46. //locator creation
  47. spaceLocator;
  48. rename pRigLoc;
  49. scale -r 1 1 1;
  50. string $pRigLoc[] = (`ls -sl`);
  51. //emitter creation
  52. emitter -pos 0 0 0 -type omni -r 100 -sro 0 -nuv 0 -cye none -cyi 1 -spd 1 -srn 0 -nsp 1 -tsp 0
  53. -mxd 0 -mnd 0 -dx 1 -dy 0 -dz 0 -sp 0 ;
  54. rename pRigEmit;
  55. move -r -os -wd 0 0 0 ;
  56. string $pRigEmit[] = (`ls -sl`);
  57. //partical creation
  58. particle;
  59. rename pRigPart;
  60. string $pRigPart[] = (`ls -sl`);
  61. //dynamic connection for the emiter and partical
  62. connectDynamic -em $pRigEmit $pRigPart;
  63. //parent constraints for the loc, emit, part and all parented to the root.
  64. select $pRigLoc;
  65. select -add $pRigEmit;
  66. parentConstraint -mo -weight 1;
  67. select -r $pRigEmit;
  68. select $pRigLoc;
  69. select -add $pRigPart;
  70. parentConstraint -mo -weight 1;
  71. select $pRigRoot;
  72. select -add $pRigLoc;
  73. doCreateParentConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
  74. parentConstraint -mo -weight 1;
  75. parent $pRigEmit $pRigLoc;
  76. parent $pRigPart $pRigLoc;
  77. parent $pRigLoc $pSet;
  78. //counter for the while loop
  79. $counter = ($counter-1);
  80. }
  81. //parents the final pieces of the hierachy to the root.
  82. parent $pRigRoot $pSet;
  83. parent $pSet "root";
  84. }
  85. }
  86. sc_pRiggerCreate()