sript test

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2009   #1
sript test

I want make a particles on the wave crest. But generation of particles mast begin when wave will reach some Z position. If it possible make this with script test?
Attached Images
File Type: jpg wave.jpg (80.0 KB, 53 views)
__________________
website
Showreel 2014
 
Old 01 January 2009   #2
Particles higher than 100 units will be passed on to the next event.

on ChannelsUsed pCont do
(
	pCont.useTime = true
	pCont.usePosition = true
)

on Init pCont do 
(
 
)

on Proceed pCont do 
(
	count = pCont.NumParticles()
	for i in 1 to count do
	(
		pCont.particleIndex = i
		
		if pCont.particlePosition.z > 100 then -- all particles above 100 units will pass on
		(
			pCont.particleTestStatus = true
			pCont.particleTestTime = pCont.particleTime
		)
	)
)

on Release pCont do 
(
 
)
__________________
poof ~>Vimeo<~
 
Old 01 January 2009   #3
better yet randomize the value a little bit

on Proceed pCont do 
(
	
	count = pCont.NumParticles()
	for i in 1 to count do
	(	
		theValue = random 50 100 -- the random z value
		pCont.particleIndex = i
		if pCont.particlePosition.z > theValue then -- all particles higher than theValue will pass on
		(
			pCont.particleTestStatus = true
			pCont.particleTestTime = pCont.particleTime
		)
	)
)
__________________
poof ~>Vimeo<~
 
Old 01 January 2009   #4
Thanks, I wright the same script but I didnt use parameter pCont.useTime = true

now its working
__________________
website
Showreel 2014
 
Old 01 January 2009   #5
Quote: theValue = random


Not good. You have to use a random generator from pCont (it has functions for that), otherwise you'll get some unneeeded surprises along the way.

Thanks,
Oleg B.
__________________
More about Particle Flow at Orbaz Forum
 
Old 01 January 2009   #6
Quote: Thanks, I wright the same script but I didnt use parameter pCont.useTime = true

now its working

It should work regardless if that channel is initiated or not, AFAIK. You are only seeing the channel and not altering it.

Originally Posted by OlegB: Not good. You have to use a random generator from pCont (it has functions for that), otherwise you'll get some unneeeded surprises along the way.

Thanks,
Oleg B.


is it the fact that the Init needs a seed value? or something else?

Forgive my niaveness, I saw the pcont.randXX functions but was unable to figure out how to set a lower limit. None of the functions seem to be able to set a range other than 0 - ....

IE theValue = pcont.rand01() ? i was hoping it would be simple like [50, 100] or 50 100 but it just generates some random #

and

theValue = pcont.rand0X 100 --you can set the upper but how can you set the lower limit?
__________________
poof ~>Vimeo<~

Last edited by JohnnyRandom : 01 January 2009 at 06:46 PM.
 
Old 01 January 2009   #7
The proper expression is:

val = desiredHeight + desiredRandomnessMagnitude*pCont.rand55

Thanks,
Oleg B.
__________________
More about Particle Flow at Orbaz Forum
 
Old 01 January 2009   #8
Ah I see, thanks and mental note to self "remember to use expressions" not just functions

theValue = 100 + 100*pcont.rand55()
__________________
poof ~>Vimeo<~

Last edited by JohnnyRandom : 01 January 2009 at 07:01 PM.
 
Old 01 January 2009   #9
Is there some reason you need to do this with a script test? Wouldn't it be easier to just use a volume select and set the position object to selected faces / verts ?
 
Old 01 January 2009   #10
A volume select is not the fastest thing in the world, mildly put
 
Old 01 January 2009   #11
Another way would be a deflector + collision-test.
 
Old 01 January 2009   #12
Originally Posted by Glacierise: A volume select is not the fastest thing in the world, mildly put
Neither is a script test. It depends on the geometry really. If you have a lowish poly geometry emitter I think the volume select would be faster and easier to control in this case. Feel free to speed test and prove me wrong though
 
Old 01 January 2009   #13
Well this sparked my curiosity...simple scene, 200 frames, 10000 particles born and locked on a noise animated plane, whenever a z-axis of 10 is reached the particles pass to new event, some speed is introduced,spawn once, 5 five later age test to delete.


Script Test - 29.11

Group Selection and Split Group test - 13.609

Box#3 Z-pos Data Test - 13.25 (lol, almost always fastest, something I already had a good idea would be)

Box#3 Data Icon Distance test - 15.187

Collision Test w/ std Deflector - 29.235

I should mention all of the times are actually a bit faster, the script I wrote to test with has to actually move the timeslider, so there is some disparity there.
__________________
poof ~>Vimeo<~

Last edited by JohnnyRandom : 01 January 2009 at 07:02 AM.
 
Old 01 January 2009   #14
Cool test dude Box #3 always comes on top, I don't know why people bother scripting any more heheh. You might send me the scene so I can evlaluate how fast TP is in that operation.
 
Old 01 January 2009   #15
With this animation collision test and volume select is not usable ))
http://b-design.com.ua/animation/wave.mp4

With this script for script test particles from event01 go to event02, but I need that particles on event01 always stay and generate new particles on event02.
I found parameter pCont.AddParticle() that add particles.

on ChannelsUsed pCont do
(
pCont.usePosition = true
pCont.useTime = true

)

on Init pCont do
(

)

on Proceed pCont do
(
count = pCont.NumParticles()
for i in 1 to count do
(
pCont.particleIndex = i
if pCont.particlePosition.z > 20 then -- all particles inside a sphere with radius 20 satisfy the test
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles() -- last particle that was added
pCont.particleTestStatus = true
pCont.particleTestTime = pCont.particleTime
)
)
)

on Release pCont do
(

)

with this script particles generate on the PF icon. Is it possible generate that particles from position of particles on event01?

I want after script test particles generate all time on wave crest. Maybe I go to wrong way?
__________________
website
Showreel 2014
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:13 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.