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 05-11-2010, 07:28 AM   #16
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,000
Quote:
Originally Posted by StevieMac
Anyone got an idea of how to do this in PFlow Vanilla?


Birth your particles in a brick pattern and use a find target plus script vector.

Event01 Birth + related operators + Script Operator (pCont.particleVector = pCont.particlePosition)

Event 02 Position Object to place your particles someplace else other than their birth location then use a Find Target (set to Script Vector) to set them back in their original positions.
__________________
poof ~>Vimeo<~
 
Old 05-11-2010, 11:40 AM   #17
StevieMac
Frequenter
 
StevieMac's Avatar
portfolio
Stephen Macfarlane
VFX Artist
Freelance
Chessington, United%2BKingdom
 
Join Date: Oct 2007
Posts: 151
Thanks Jonny.
Thats not far off from what I was trying but now
I don't know how to get each brick to work it's way up to create the wall.
I can't work out how to store the rotation/orentation & Scale to an array & how to bring it back.

I've attatched the Max 2010 file.

Thanks
Attached Files
File Type: zip Brick_Test_SMac.zip (29.9 KB, 15 views)
 
Old 05-11-2010, 05:23 PM   #18
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,000
Ahh dude your so close you can taste it, all you ready need to do is store the original orientation so you have something to feed the Go To Rotation Test operator. I attached your scene with a couple small changes.
Attached Files
File Type: zip max2010_Brick_Test_SMac01.zip (40.5 KB, 35 views)
__________________
poof ~>Vimeo<~
 
Old 05-13-2010, 07:54 AM   #19
StevieMac
Frequenter
 
StevieMac's Avatar
portfolio
Stephen Macfarlane
VFX Artist
Freelance
Chessington, United%2BKingdom
 
Join Date: Oct 2007
Posts: 151
Ah man you're right I was pretty close this always happens when I'm doing Max code, I get nearly there then go round in circles trying to find the right solution! Thanks mate.

So you stored the rotation in row 1 of a matrix? Can I do the same for the scale then but in row 2?

Any idea how to get the wall to build up from the bottom? I'm guessing I'd need to use/store a particle id for each brick then recall that back in an order that starts from the bottom. I think there was a tut like this on Bobo's script show DVD but I don't think it explained how to assign an id to a specific object.

Thanks for the help mate/guys.
 
Old 05-13-2010, 07:15 PM   #20
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,000
Yes you can store scale data in row2, you can store any matrix data in any open row if you like.

For something like you are doing the original brick wall would have to be created in order, some of the brick in it are out of order. If you want it to build from the bottom up the easiest way is you brick01 be the last brick on the top of the wall and the first brick should be numbered the last brick created.

So if you build your wall from brick99 (being the first brick in the bottom row) to brick01 (being the last brick on the top row) it should work correctly

You can sort you array using something like this: (someone else may know a better way to do it)
Code:
on Init pCont do ( Global sortedBricks = #() Global Brickwall = $Brick_* as array brickOrderName = for o in Brickwall collect o.name sort brickOrderName sortedBricks = for i in brickOrderName where isValidNode (obj = getNodeByName i) collect obj )


Attached a sample of what I mean
Attached Files
File Type: zip max2010_Brick_Test_SMac02.zip (31.2 KB, 15 views)
__________________
poof ~>Vimeo<~
 
Old 05-14-2010, 07:35 AM   #21
StevieMac
Frequenter
 
StevieMac's Avatar
portfolio
Stephen Macfarlane
VFX Artist
Freelance
Chessington, United%2BKingdom
 
Join Date: Oct 2007
Posts: 151
Hey thanks Jonny. I get what you mean but it'll take me a bit to understand all the code properly. I'll have a go at storing the scale in the matrix row 2, then when I've got that sorted I'll post it back up soon hopefully.

Thanks for the help mate, it means a lot when someone listerns.
 
Old 05-14-2010, 08:55 PM   #22
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,000
No problem, basically the above script does what your did except it organizes the objects. It grabs the objects names (collect o.name), organizes them in ascending order (with the 'sort' function), then re-assigns the actual object back to its name (isValidNode + getNodeByName).

So now your *Bricks_ array instead of being something like 1,7,45,2,3,78 will be 1,2,3,4,5,6,7, with a new name sortedBricksArray. Now since it is in order your particles will be processed in the order that you want which is ascending or descending and not random.

If you want to know more about matrices grab Bobos "The Matrix Explained", since everything in pflow is built on loops, vectors, matrices, and arrays for the most part. Actually the whole script set is awesome TBH.
__________________
poof ~>Vimeo<~

Last edited by JohnnyRandom : 05-14-2010 at 09:07 PM.
 
Old 05-19-2010, 07:32 PM   #23
StevieMac
Frequenter
 
StevieMac's Avatar
portfolio
Stephen Macfarlane
VFX Artist
Freelance
Chessington, United%2BKingdom
 
Join Date: Oct 2007
Posts: 151
Ok I tried storeing the Scale in the matrix row2 but without any luck. I thought it would be as simple as adding
pCont.useScale = true
to the begining &
scale = pCont.getParticleScale i
TM.row2 = scale

Then recal this in the second script
pCont.particlescale = (pCont.particleTM).row2

So now all the bricks go to one point so somehow I don't think I'm recalling the scale correctly but I can't work out where I'm going wrong. I've skipped through the Max Script help & noticed you used a Matrix3 1 is this the right matrix to use now i'm adding more than one row of data?

I also went through the DVD's you sudgested but I still couldn't find a point where Bobo saved the Scale in a Matrix & recalled it but I probably didn't reconise where he used it.

Thanks peeps
 
Old 05-26-2010, 04:02 AM   #24
JohnnyRandom
Configurator
 
JohnnyRandom's Avatar
portfolio
John Rand
still wandering the binary void
salt lake city, USA
 
Join Date: Oct 2003
Posts: 5,000
Ok, i guess it really depends on how you want to treat your scale. So for instance if you were to add a scale operator to the second event and only adjust the variation... random number how about 73% (constrained for the sake of simplicity, which will be a single float value instead of 3 float values) This will generate some nice scale variation between the bricks.

Now in the final Go To Rotation event, just return the particles scale back to normal. You can make them grow back by setting up a simple if/then (albeit it is kind of slow) like this:

Code:
on Proceed pCont do ( count = pCont.numParticles() for i in 1 to count do ( pCont.particleIndex = i if pCont.particleNew do ( pCont.particleOrientation = (pCont.particleTM).row1 ) if pCont.particleScale < 1.0 then ( curScale = pCont.particleScale pCont.particleScale = curScale + 0.01 ) if pCont.particleScale > 1.0 then ( curScale = pCont.particleScale pCont.particleScale = curScale - 0.01 ) ) )


This feeds the Go To Rotation test with the stored orientation value from earlier when the particle arrives in the event. Then it checks to see it the particle scale is larger or smaller than 1.0 it will adjust the particle scale until it reaches 1.0.
Attached Files
File Type: zip max2010_Brick_Test_SMac03.zip (26.7 KB, 27 views)
__________________
poof ~>Vimeo<~
 
Old 05-26-2010, 04:02 AM   #25
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:29 AM.


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