PDA

View Full Version : combine 2 particle systems into 1 new system


DAZZAN
08-13-2008, 10:24 AM
can you make 2 two particle sysems of STATIC particles back into one system.

also the same question but particles (moveing) into one particle system.

So in the outliner you would have now

particle 01
particle 02

(combine to make)

particle 03

Im thinking about where you lay down individual particles with Paint tool to make a custom shape,then adding more particles,or takeing away particles,id like to finish off with no mulitple systems but 1 final system,through some way of combineing.

regards

daz

ctp
08-13-2008, 11:52 AM
To cover your first question, I had a script at hand from a while back. Not sure how familiar you are with scripting and the use of procedures, but maybe you can modify this yourself to cover your second question.

//this procedure adds particles from one particle object to another.
//first select the object to add from, then add-select the object to add to.


global proc addParticles(){

string $particleObjs[] = `ls -sl`;
float $addPositions[] = `getAttr ($particleObjs[0]+".position")`;
int $countToAdd = size($addPositions)/3;;

string $emitCmd = ("emit -object " + $particleObjs[1] + "\n");
for ($i = 0; $i < $countToAdd; $i++){
int $xComp = $i*3;
int $yComp = ($i*3)+1;
int $zComp = ($i*3)+2;
vector $addPos = <<($addPositions[$xComp]),($addPositions[$yComp]),($addPositions[$zComp])>>;
$emitCmd += " -pos "+$addPos+"\n";
}

eval($emitCmd);
}


So, open a text editor and paste the code in there and save the file as "addParticles.mel".
Place the file in your maya scripts directory.
On Windows the default place would be:
C:\Documents and Settings\<your login name>\My Documents\maya\scripts\

Then start or restart maya. In the outliner select the particle object you want to add from, and then add-select the particle object you want to add to. Then type addParticles in your MEL command line and hit enter. Done.

The particles from the first object are added at the same positions they had in their own object. And the original object is not deleted, but you can do that or hide it to verify that the first object now includes all particles.

Cheers, C

CGTalk Moderation
08-13-2008, 11:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.