PDA

View Full Version : Spawn particles from other particle shapes?


vertigo
06-25-2007, 02:33 PM
Hello everyone!

I have a question. Is it possible to spawn particles from edges/polys/vertices of already existing particle shapes. Normally, when you spawn particles, they're being spawned from the pivot of every particle... Is there any possibility except any PFlow Upgrades. maybe Script Tests?

Thank you very much!!!

Greets
vertigo

SoLiTuDe
06-25-2007, 03:12 PM
The easiest way it to use a mesher, then use position object on that mesher in another flow -- with animated shape turned on.

vertigo
06-25-2007, 03:41 PM
hm, that's an idea, SoLiTuDe.
I hope the method will work with the birth script I use. I'll try!
Thanks!!! :thumbsup:


Greets
vertigo

P.S.: OK, it works, although max is pretty unstable with performance (and I just did a test schene with 7-8 particles) :scream:. But, hey, thanks man!

supremepizza
06-25-2007, 08:25 PM
It can be a bit buggy though. I'd do a particle transfer to scene objects. Via Bobo's site then bake the animation of that and emmit from the baked geometry.

Edit: And this method is much less processor/ram intensive since you'll be working with keyframes. Feel free to tear into my rifter script. It's heavily commented and should get you headed in the right direction. If I haven't uploaded the version that bakes keyframes email me and bug me about it and send you the most recent one.

SoLiTuDe
06-26-2007, 12:00 AM
Much better idea there. :thumbsup: Not as easy to set up, but much better in the long run.

vertigo
06-26-2007, 09:40 AM
Hi supremepizza,

That sounds good.
Where can I find this script? I couldn't locate it on scriptspot.com...

Thanks!

Greets
vertigo

supremepizza
06-26-2007, 10:06 PM
I attached it somewhere here in a post. Here I'll post my latest version here. It isn't exactly what you need. It's more of a poor man's Afterburn but if you're familliar with MAXScript you should be able to cut out what you'll need. This basically just cuts up the model and explodes it using atmospheric gizmos. But instead of gizmos you'll be wanting to drive your geometry. It's fairly easy to bake the keyframes which is in the last rollout so just look at that towards the bottom of the script.

Hope it helps. I've used it for everything from blowin stuff up to proceedural asteroid fields where I drive SDeflectors and winds instead of gizmos.

Enjoy,
Bill

supremepizza
06-26-2007, 10:16 PM
Here, I cut/pasted my code from the asteroid scene I did for McKay's class. First one is particle transfer to scene objects for your script operator and the second is for baking the keyframes. Not as complicated as some people want to make it. You will need to do a hold and fetch but I'm sure you're familliar with that. If not let me know.
on ChannelsUsed pCont do
(
pCont.useTM = true
pCont.useAge = true
)
on Init pCont do
(
global My_SDeflector_01 = $SDeflector*
global My_SWind_01 = $SWind*
My_SDeflector_01.pos = [0,0,-100000]
My_SWind_01.pos = [0,0,-100000]
)

on Proceed pCont do
(
partcount = pCont.NumParticles()
count = amin #(partcount,My_SWind_01.count)
for i in 1 to count do
(
pCont.particleIndex = i
My_SDeflector_01[i].transform = pCont.ParticleTM
My_SWind_01[i].transform = pCont.ParticleTM
)
)

on Release pCont do
(
)

animate on

for t = 0 to animationrange.end do

(

slidertime = t

$SDeflector01.transform = $SDeflector01.transform

$SWind01.transform = $SWind01.transform

)--end t loop

animate off

supremepizza
06-26-2007, 10:29 PM
On a related note here's my "Scripted Chunks By Mass" birth script. Great for blowin stuff up but you'll have to keyframe your wind values to get it right. To see the results of it I'll upload the composite to my portfolio for ya. Basically just tryin to turn you on to the possibilities of "scripted chunks" and "particle transfer to scene objects" techniques. Both have uses in what you're trying to do and are great for pre-baking and setting up particles for use with reactor. on ChannelsUsed pCont do
(
pCont.useAge = true
pCont.useTM = true
pCont.useShape = true
pCont.useScale = true
pCont.useFloat = true
)--end channels used


on Init pCont do
(
global ChunksArray = $bfrag* as array
--Global theCount = pCont.NumParticles()
--Global NumChunks = ChunksArray.count
)--end init

on Proceed pCont do
(
t = pCont.getTimeStart() as float
if t < 0 do
(
NumChunks = ChunksArray.count
for i = 1 to NumChunks do
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleAge = 0
pCont.particleTM = ChunksArray[i].transform
pCont.particleShape = ChunksArray[i].mesh
)--end i
)--end if
theCount = pCont.NumParticles()
for i in 1 to thecount do
(
pCont.particleIndex = i
theMax = ChunksArray[i].max
theMin = ChunksArray[i].min
theScale = distance theMax theMin
--pcont.particlescale = theScale
pCont.particleFloat = 1.0/(theScale)
)--end i
)--end proceed

on Release pCont do
(
)

CGTalk Moderation
06-26-2007, 10:29 PM
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.