Notifications
Clear all

[Closed] Mesh Linking via TM and Birth Script

Evening scripters.

So I have a planet explosion needing done (just like old times), and I’m in the process of using Krakatoa to get some more gritty dirt in the scene.

I have the Earth pre-split into chunks, animated by an expanding deflector object that sends the chunks flying out into space. I’ve got a birth script running that’s grabbing the chunks and reading them into PFlow as the particle system.

What I need to do is fix up/create a script that’ll then take a duplicated version of the chunks (the originals are what are read from the birtscript, so I can’t animate/mess with those), and get them to link with their respective particles so that I can then use the mesh objects as matte objects in Krakatoa. I’ve done some scripting on this before, but i’m having no luck this time.

Here’s the Birth script:


 on ChannelsUsed pCont do
 (
 	 pCont.usePosition = true
 	 pCont.useShape = true
 )
 
 on Init pCont do 
 (
 	global shipFrag = $Surface_Low_frag_* as array
 )
 
 on Proceed pCont do 
 (
 	t1 = pCont.getTimeStart() as float
 	t2 = pCont.getTimeEnd() as float
 	if ((t1 <= 0) and (t2 >= 0)) then
 	(
 		pcont.addparticles shipFrag.count
 		for i in 1 to shipFrag.count do
 		(
 			pcont.particleindex = i
 			pcont.particleshape = shipFrag[i].mesh
 			pcont.particleposition = shipFrag[i].position
 		)
 	)
 )
 

I had an old Mesh Linking script that I tried using, but since there’s a birth script operator in use here (at least I blame that), these aren’t doing the tricks.

The broken script operator(s):


 on ChannelsUsed pCont do
 (
 	pCont.usePosition = true	 
 	pCont.useOrientation = true
 	 pCont.useTM = true
 )
 
 on Init pCont do 
 (
 	global AnimFrags = $Anim_Fragments* as array
 )
 
 on Proceed pCont do 
 (
 	for i in 1 to AnimFrags.count do
 	(
 		pCont.particleIndex = i
 		AnimFrags[i].transform = pCont.particleTM
 	)
 )
 

And here’s the PFView.

I would think I’d need to have these script operators in each group that controls the movement of the chunks, but I would also assume they can all be the same script operators, so long as they appropriately TM the meshes with the particles.

So, that’s pretty much it. Any help would be appreciated. Thanks guys.

-Crypt