CGTalk > Software > Autodesk 3ds max > Particle Flow
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 02-27-2008, 01:06 PM   #16
odinuk
New Member
odin
gettin it done!
wearenation.co.uk
United Kingdom
 
Join Date: Mar 2003
Posts: 25
Hi Boris, i ma trying this but the operator just sends the particles to a single vector.
is there something obvious i am doing wrong?
i can't reduce the number of particles fyling into the end position either, what would be a good way of only have say 50 of 100 particles form a grid at the end of the animation?

arrrrrrrrgh.


Code:
-- This is a script that can be used to generate particles on ChannelsUsed pCont do ( pCont.useTime = true pCont.useAge = true pCont.usePosition = true pCont.useVector = true ) on Init pCont do () on Proceed pCont do ( local xspace = 16 local yspace =-16 local theSpacing = 16 --the distance between particles along X and Y --local t1 = pCont.getTimeEnd() as float --the end evaluation time --if (t1 == 0) do ( --if on frame 0, create particles! for y = 1 to 4 do ( for x = 1 to 10 do ( local xspacer = (xspace*x) local yspacer = (yspace*y) --pCont.AddParticle() --add a new particles pCont.particleIndex = pCont.NumParticles() --make the last one current pCont.particleTime = 0 --set the time to 0 pCont.particleAge = 0 --set the age to 0 --pCont.particlePosition = [xspacer-200,yspacer+60,0] --set the position to X,Y * spacing pCont.particleVector = [xspacer-200,yspacer+60,0] )--end x loop )--end y loop -- )--end if )--end proceed on Release pCont do ()


thanks again all

O

Last edited by odinuk : 02-27-2008 at 01:11 PM.
 
Old 02-27-2008, 04:27 PM   #17
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,327
Works for me - I actually removed your remarks and used the code in a Birth Script to use it to both place the particles on a grid AND define where they should go.
Then I added a Find Target, switched Point drop-down list to "By Script Vector" and the particles flew to the points I defined (which I made slightly different than the starting grid):

Code:
-- This is a script that can be used to generate particles on ChannelsUsed pCont do ( pCont.useTime = true pCont.useAge = true pCont.usePosition = true pCont.useVector = true ) on Init pCont do () on Proceed pCont do ( local xspace = 16 local yspace =-16 local theSpacing = 16 --the distance between particles along X and Y local t1 = pCont.getTimeEnd() as float --the end evaluation time if (t1 == 0) do ( --if on frame 0, create particles! for y = 1 to 4 do ( for x = 1 to 10 do ( local xspacer = (xspace*x) local yspacer = (yspace*y) pCont.AddParticle() --add a new particles pCont.particleIndex = pCont.NumParticles() --make the last one current pCont.particleTime = 0 --set the time to 0 pCont.particleAge = 0 --set the age to 0 pCont.particlePosition = [xspacer-200,yspacer+60,0] --set the position to X,Y * spacing pCont.particleVector = [xspacer+100,yspacer+200,1000] -- set the target positions )--end x loop )--end y loop )--end if )--end proceed on Release pCont do ()


With default settings, it took them 110 frames to reach the destination.
I wired the Find Target to an event containing a Speed operator with 0.0 value and they stopped once there.


If you want only some particles to go to the new grid, just set the particleVector value of a portion of the particles to the same value as particlePosition so they will assume they have already arrived. Or split the particles using Split Amount first, then use the Find Target in the following event, so only a portion would perform the search. Not sure what your problem is...
__________________
Bobo

Last edited by Bobo : 02-27-2008 at 04:30 PM.
 
Old 02-27-2008, 05:46 PM   #18
odinuk
New Member
odin
gettin it done!
wearenation.co.uk
United Kingdom
 
Join Date: Mar 2003
Posts: 25
It is sinking in slowly, no problem apart from me being a moron!!!

its working for me too


Thanks so much

O
 
Old 02-27-2008, 06:04 PM   #19
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,007
Quote:
Originally Posted by Bobo
Indeed I have the code ready to go for my next CG Academy DVD on "Scripting PFlow"


Excellent news! Looking forward to it Bobo
__________________
poof ~>Vimeo<~
 
Old 02-27-2008, 06:17 PM   #20
entrancea
!!Under Construction!!
 
entrancea's Avatar
portfolio
Subhrojyoti Banerjee
Lead FX Artist
BlowfishFX
India
 
Join Date: Jul 2007
Posts: 386
Send a message via MSN to entrancea Send a message via Yahoo to entrancea
Quote:
Originally Posted by Bobo
Indeed I have the code ready to go for my next CG Academy DVD on "Scripting PFlow"


Cant wait for it t release....Any info on its release date Bobo?
__________________
Hardwork is an excellent paymaster......
 
Old 03-07-2008, 11:32 PM   #21
thethule
whataguy!
portfolio
Marc Khachfe
3d animator
Zebra Crossing
North London, United Kingdom
 
Join Date: Jul 2003
Posts: 1,920
Sorry for not posting any more replies to my original post. Thank you all for the answers, i just got too busy to look into it for now, but i will do soon.


Cheers,

Marc
__________________
www.weliketomakethings.com
 
Old 03-11-2008, 06:44 PM   #22
thethule
whataguy!
portfolio
Marc Khachfe
3d animator
Zebra Crossing
North London, United Kingdom
 
Join Date: Jul 2003
Posts: 1,920
Just a quick question and apoplogies if im being stupid. But...


-Where can i get position+ by orbaz? I cant seem to find it anywhere on their site. Either in their box tools or freebies...

Cheers,

Marc
__________________
www.weliketomakethings.com

Last edited by thethule : 03-11-2008 at 06:46 PM.
 
Old 03-11-2008, 09:15 PM   #23
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,327
Quote:
Originally Posted by thethule
Just a quick question and apoplogies if im being stupid. But...


-Where can i get position+ by orbaz? I cant seem to find it anywhere on their site. Either in their box tools or freebies...

Cheers,

Marc


I can see it, but only up to Max 8. (This includes maxplugins.de and orbaz.com).
There seems to be no build for Max 9 and 2008, but I might be blind, too...
__________________
Bobo
 
Old 03-11-2008, 09:58 PM   #24
thethule
whataguy!
portfolio
Marc Khachfe
3d animator
Zebra Crossing
North London, United Kingdom
 
Join Date: Jul 2003
Posts: 1,920
Yeah, thought of that, but i cant even see it in my max8....i DO remember it in though..weird

Thanks
__________________
www.weliketomakethings.com

Last edited by thethule : 03-11-2008 at 10:09 PM.
 
Old 03-11-2008, 10:50 PM   #25
scrimski
antieverything
portfolio
J. Schreyer
head->wall
ARRI Berlin
Berlin, Germany
 
Join Date: Aug 2003
Posts: 7,983
posted in wrong forum, please delete.
 
Old 03-11-2008, 10:50 PM   #26
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 08:22 PM.


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