/* jooCCRequestedEmitFormFaceCenter.mel 0.1
Authors: Janne 'Joojaa' Ojala
Testing: if it works after a suitably long time without
much problems let me know. Report any problems.
License: Creative Commons, Attribution, Share Alike
Request by: Sagun Manandhar
About:
A simple script that will poke a polygonal mesh and
emit only from the poked vertices. script has no
sanity checks so use with care.
Install Instructions:
place this text in a file named:
jooCCRequestedEmitFormFaceCenter.mel
that resides in your personal Maya script directory.
Usage:
select any number of polygonal objects and run:
jooCCRequestedEmitFormFaceCenter
from a command line.
Changelist:
28.11.2009 - Original file
*****************************************************************/
global proc jooCCRequestedEmitFormFaceCenter(){
for ($each in ls -sl){
$points = size(ls -fl ($each+".vtx[ * ]"));
polyPoke -ws 1 -tx 0 -ty 0 -tz 0 -ch 1 $each;
$e=emitter -type omni -r 100 -sro 0 -nuv 1 -cye none
-cyi 1 -spd 1 -srn 0 -nsp 1 -tsp 0 -mxd 0
-mnd 0 -dx 1 -dy 0 -dz 0 -sp 0 $each;
$p=particle;
connectDynamic -em $e[1] $p[0];
addPP -atr "rate" $e[1];
for($i=0;$i<$points;$i++)
setAttr ($each+".emitter1RatePP["+$i+"]") 0;
}
}