CGTalk > Software > Autodesk Maya > Maya Dynamics
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 09-14-2003, 07:10 PM   #1
Scott212
Slightly Mental
 
Scott212's Avatar
Scott
SPI
Los Angeles, USA
 
Join Date: Dec 2002
Posts: 325
Send a message via AIM to Scott212 Send a message via MSN to Scott212
suface flow w/o effect

I'm missing something here I'm sure and I hope somebody can hip me to what it is.

I've built a curve flow many many times using the curve as a goal and putting a ramp in the particles goalU. Whenever I try this with a surface the particles always lock themselves to the verts. Why is that?
__________________

 
Old 09-14-2003, 11:43 PM   #2
Jozvex
v2.0
 
Jozvex's Avatar
portfolio
Jared Martin
Maya Mercenary
Canberra, Australia
 
Join Date: Mar 2002
Posts: 3,219
Have you ticked the 'Need Parent UV' box under "Basic Emitter Attributes" on the emitter?

Because it won't store the parentU and parentV without it!

__________________
~ Jared Martin

Maya, 3Delight, mentalray, Maxwell Render, ZBrush
Photoshop, Fusion, Vegas Pro, Syntheyes
 
Old 09-16-2003, 04:40 AM   #3
Scott212
Slightly Mental
 
Scott212's Avatar
Scott
SPI
Los Angeles, USA
 
Join Date: Dec 2002
Posts: 325
Send a message via AIM to Scott212 Send a message via MSN to Scott212
Thanks for the tip but I'm still not quite getting it. The particles aren't sliding across the surface but rather appearing at each vertex. If you could be so kind could you out line the steps to get a particle to slide down a nurbs surface? Thank you so much.
__________________

 
Old 09-16-2003, 09:25 AM   #4
Jozvex
v2.0
 
Jozvex's Avatar
portfolio
Jared Martin
Maya Mercenary
Canberra, Australia
 
Join Date: Mar 2002
Posts: 3,219
How could I refuse after you asked so nicely!! Here's an example:

(Before we start, make sure your Playback Speed is set to 'Play Every Frame' in your preferences)

1. Create NURBS Cylinder

2. Select the cylinder and add particles by going to Particles > Emit from Object

3. Select the emitter and in the Channel Box, change the Emitter Type to 'Surface'.

4. Then change the Rate to something like 15 or 20.

This is just so that we can cleary see what's happening without thousands of particles making it too confusing. You can leave it on 100 if you like.

5. Still in the Channel Box, set Need Parent UV to 'on' instead of 'off'.

That tells Maya to record the position on the cylinder where each particle was created. It stores those values as the attributes 'ParentU' and 'ParentV'.

6. Now select the particles instead. Change the Particle Type to 'Spheres' to make them much easier to see.

7. With the particles still selected, shift-select the cylinder and go to Particles > Goal.

If you press play now you should see the particles spring around and stick to the cylinder, but they stick to the CVs, so we're not quite there yet!

8. In the Channel Box, change the Goal Weight for the particles to 1 instead of 0.5.

Just to remove the springiness!

9. Making sure the particles are still selected, open the Attribute Editor and open out the "Per Particle (Array) Attributes" section.

We need to add some custom particle attributes in order to control the way the particles use the cylinder's UV information.

10. Under "Add Dynamic Attributes", click the General button, to add some general attributes.

11. In the window that pops up, change over to the Particle tab at the top.

This shows us a list of particle attributes that are not shown by default, but are already understood by Maya when used.

12. Select the attributes 'goalU', 'goalV', 'parentU' and 'parentV' (holding down Ctrl to select more than one) then press Add.

The attributes are added to the list in the Attribute Editor. You may need to close and reopen the Attribute Editor for them to display though.

13. Close the window that popped up if you haven't already.

14. Right click on the new goalV attribute and choose 'Creation Expression'.

This will let us write an expression to control what this value does when the particles are first born/created.

15. In the Expression Editor, type the following:

goalV = parentV;
goalU = parentU;

This is telling Maya that we want the goal for each particle to be the position on the cylinder at which it was born. Even though we right-clicked on the 'goalV' attribute we can still add expressions that tell other attributes what to do. All the Creation Expressions for one object end up in the same place anyway. So it doesn't really matter what attribute we right-click on to get here.

16. Press 'Create' to finish the expression. Next time you look at the expression, Maya will have added the name of the particles to each attribute (eg MyParticles.goalV = MyParticles.parentV).

Now if you rewind and play back your scene, the particles should start appearing at random places on the surface of the cylinder! Not on the CV's like before!

Next we'll make the particles slide down the cylinder. For that, we just need one simple line of expression.

17. Right click on the 'goalU' attribute and this time choose Runtime Expression.

A runtime expression tells Maya what to do each time a frame goes by when we play our animation.

18. Type this into the Expression Editor and press Create to create this new Runtime Expression.

goalU -= 0.01;

(That's "goalU minus equals 0.01")

"Minus equals 0.01" means "subtract 0.01 from the current goalU value". So on each frame, 0.01 will be subtracted from 'goalU'. I used a tiny number like 0.01 so that the particles don't slide down super fast. I chose 'goalU' instead of 'goalV' because of the U and V directions of the cylinder. Using 'goalV' would make the particles swirl around the cylinder rather than slide down.

Now if you play back your scene, the particles should appear at random locations on the cylinder and then slide down and collect at the bottom!

Because the particles collect at the bottom though, the calculation can quickly become intense and slow everything down. So let's now make it that once the particles arrive at the bottom of the cylinder, they die.

We can do that with one more simple line of expression!

19. Firstly, set your particle's Lifespan Mode to 'lifespanPP only'.

Which means that the lifespan of each particle can be controlled through expressions.

20. Back at the list of custom attributes in the Attribute Editor, right-click on 'lifespanPP' and choose Runtime Expression.

21. Type this into the Expression Editor:

if (goalU <= 0.02) lifespanPP = 0;

"If a particle's goal in the U direction is less than or equal to 0.02 (a position very close to the bottom), kill the particle"

22. Click Edit to save the changes.

Now if you play back your animation, the particles should slide down and then vanish once they reach the bottom of the cylinder!

And that's it! I hope I've written all of this correctly, I'm fairly tired and so forgive me if there are any mistakes!

I've attached my finished scene file (Maya 5) in case you don't understand something. And be sure to ask questions if you have any!

__________________
~ Jared Martin

Maya, 3Delight, mentalray, Maxwell Render, ZBrush
Photoshop, Fusion, Vegas Pro, Syntheyes
 
Old 09-16-2003, 11:28 AM   #5
Kaiser_Sose
Space For Rent
 
Kaiser_Sose's Avatar
 
Join Date: Jun 2002
Posts: 1,224
That gets one particle at one point on the surface to flow along the surface but what if you want to get many particles on top of each other as in a avalanche
 
Old 09-16-2003, 04:31 PM   #6
Scott212
Slightly Mental
 
Scott212's Avatar
Scott
SPI
Los Angeles, USA
 
Join Date: Dec 2002
Posts: 325
Send a message via AIM to Scott212 Send a message via MSN to Scott212
>>> Jozvex - Thank you~!

People like yourself are what keep this kick ass forum alive. I can't wait to try this when this huge fluid render finishes

Thanks again!
__________________

 
Old 09-16-2003, 10:19 PM   #7
zachgrachan
Know-it-All
looking for work...
 
Join Date: Mar 2003
Posts: 434
josvex - that one's good enough to make into a full tutorial! Thanks again for teaching me something new.
 
Old 09-17-2003, 02:57 AM   #8
Jozvex
v2.0
 
Jozvex's Avatar
portfolio
Jared Martin
Maya Mercenary
Canberra, Australia
 
Join Date: Mar 2002
Posts: 3,219
No problem guys! I can't believe how long it turned out to be...

And Kaiser_Sose, the instructions I gave should create lots of particles flowing on the surface, not just one. If you turn up the Rate on the Emitter you should be able to get a more avalanche-like effect.

You could also turn the goal weight down to something like 0.75 and then add a Turbulence field to get the particles to bounce around more etc
__________________
~ Jared Martin

Maya, 3Delight, mentalray, Maxwell Render, ZBrush
Photoshop, Fusion, Vegas Pro, Syntheyes
 
Old 09-17-2003, 06:50 AM   #9
Kaiser_Sose
Space For Rent
 
Kaiser_Sose's Avatar
 
Join Date: Jun 2002
Posts: 1,224
Thanks ...

All particles stick to the surface, in an avalanche you would want some to follow the motion of the surface but build layers and layers on top of each other as they are falling down
 
Old 01-16-2006, 04:00 AM   #10
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
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 01:43 PM.


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