ScriptSpot

Forum topic · Scripts Wanted

Change visibility after particle collision

By vic · 2012-07-26

Description

Hi all:

First of all, thanks to everyone for the opportunity to join and participate. I am not a scripter, I just work on a "trial-error" basis, but I hope to learn more as I interact here with you.

The idea of the particle system I am working in is as follows:

1. The scene includes some objects that I want to "turn into" particles.

2. The PF system takes these objects (which are renamed conveniently) and using a birth script, it generates one particle per object, the same position and geometry as the original object. This has been taken from Alan McKay's tutorial here http://vimeo.com/11100227 and slightly modified. It works fine.

This is the code of the birth script



on ChannelsUsed pCont do
(
	 pCont.useAge = true
	 pCont.useTM = true
	 pCont.useShape = true
)

on Init pCont do 
(
	GLOBAL whatever = $whatever* as array
	
)

on Proceed pCont do 
(
	t=pCont.getTimeStart () as float
	if t < 0 do
	(
		for i=1 to whatever.count do
		(
			
			pCont.addParticle()
			pCont.particleIndex =pCont.numparticles()
			pCont.particleAge = 0
			pCont.particleTM = whatever[i].transform
			pCont.particleShape = whatever[i].mesh
			
		)
	)
)

on Release pCont do 
(
		
)

3. A collision event sends particles to another event, where geometry is displayed. The problem is the following: I want to hide the geometry of the original objects, and I don't know how. I have tried visibility parameter both in the birth script and in a separate script operator located in the second event, and the objects turn invisible at frame 0, not after collision event.

Any help or idea on this will be a great help. Thanks in advance to everyone!

Vic

Comments (3)

kimarotta · 2012-07-30

I hope it helps you link ... but I do not really understand what you want to do ... just make objects base invisible ? I did some more testing has not got a good result ... If I have anything post here

vic · 2012-07-30

Thanks a lot kimarotta! Thanks for the link! It will take some time for me to study it but for sure it will help :-)