Event-Driven ParticlesImagine a forest fire, in which a tall tree is burning from the top down. Chunks of flaming wood break free from the top, trailing smoke and flames, bouncing against branches on their way to the ground, sending up a shower of sparks at every collision, and finally detonating in an explosion of ash, splinters, and sparks at ground level. Such a scene could conceivably be created using non-event-driven particle systems, but it would require the coordination of several different particle systems, be fairly time-consuming, and be much more difficult and less flexible than the same effect created with an event-driven particle system like max's Particle Flow.Particle Flow is a very flexible and powerful system for creating particle effects. Particle systems can be assembled with a building-block approach using the Particle View window to create a powerful range of custom behaviors. Particles can move from state to state as needed, so that the traditional linear path of particle birth, movement, and death is replaced with a flowchart you can endlessly customize. The flaming chunk of wood debris described above can be represented by a particle in Particle Flow (PFlow) that generates new spark particle systems on impact, with their own properties of collision, life, and appearance. No longer are particles constrained to maintain most of their properties throughout their life span. With PFlow, particles can change motion, size, appearance, or behavior based on tests you set up. The falling wood pieces, for example, can be reduced in size with each impact, or broken up into smaller chunks, while maintaining speed and material parameters, if so desired.The primary elements of Particle Flow are events, which contain individual operators and tests. Operators are used to pass along particle properties, such as rotation, material, and scale. Tests are used to direct particles into new behaviors. A test might check a particle's speed, for example, and direct it to a new event. Particles that do not test true remain in the current event. This may seem abstract, but it's very simple. Instead of setting a particle's speed in a rollout, you can control particle speed with an operator. This allows you to introduce new speed operators whenever you like, such as after testing particle age. Smoke billowing from our battered piece of falling wood, for example, should move more quickly at the moment of impact and remain more or less in place as the debris free-falls.PFlow systems can be initiated either with the creation of a PF Source emitter object, found in the Create panel > Geometry section under Particle Systems, or within the Particle View window, where either a Standard Flow with general settings or an Empty Flow with minimal settings can be created. Each PFlow system is represented by a PF Source viewport icon, which by default is the particle emitter as well. PF Source ParametersMost of the Modify panel parameters we will examine in this section for the PF Source object can also be accessed from within the Particle View interface, as will be demonstrated in the next section (Figure 17.9). Figure 17.9. The Particle Flow Source rollouts.![]() SetupIf you need a quick and easy way to turn a PFlow system on or off, take note of the Enable Particle Emission check box, which controls the entire system. You can also toggle a PFlow system in Particle View.The Particle View button opens the Particle View interface, though this can also be done with a keyboard shortcut (the default is 6). EmissionUnlike the non-event-driven particle systems, Particle Flow can use any of the emission types. This allows you to generate your particles free of any restrictions of emission area.The Logo Size setting only affects the logo portion of the PF Source icon, and it has absolutely no effect on particle emission. Making the logo large will give the discreet programmers an ego boost, however.Icon Type sets the shape of the emitter. The default shape is Rectangle, but Box, Circle, and Sphere are also available (Figure 17.10). If one of these settings does not suit your needs, keep in mind that you can also use instanced geometry to determine emitter shape. Figure 17.10. The four PF Source emitter types: Rectangle, Box, Circle, and Sphere.[View full size image] ![]()
SelectionThere are several techniques within Particle Flow to split particles into separate behaviors. Suppose you have a swarm of particle dragons, and you want to choose a few specific ones to divert from your "Soar and Menace" event to your "Dive and Flame" event. The controls within the Selection rollout will allow you to do just that.The Selection rollout and the Sub-Object: Particle level give you access to specific particles. Click the Particle button in the Selection rollout to activate Particle Select mode. In Particle Select mode, particles can be selected in a viewport by clicking or dragging a selection marquee. Once selected, they can be affected by either the Delete operator or the Split Selected test within Particle View.This sub-object functionality is unlike the standard operation of mesh sub-objects, where a selection is passed up the Modifier stack. The Particle sub-object level allows you to pass your selection to events within Particle View and allows only a single selection per PFlow source.Event Select mode selects particles based on their current event in the flow. Your selection can be transferred to a Particle level selection with the Get From Event Level button, if needed. Note that you have to be in Particle Select mode for this button to be functional.The Select by Particle ID section allows for a third method of particle selection. Particles can be selected by ID number, and added or removed from the selection. System ManagementSuppose you have set up an elaborate fountain using PFlow droplets that eject from the stone fish's mouth, fall down, and rebound from its scales and fins, spawning additional droplets with each bounce. Such a system would be easy to set up in PFlow, but consider that it is difficult to predict how many particles will wind up being emitted. If each original droplet spawns a series of smaller droplets, which in turn spawn their own child drops, your computer could easily become overloaded, or even lock up. The Particle Amount Upper Limit sets the maximum number of particles the PFlow system can have. This is useful as a fail-safe when troubleshooting flows that spawn an inordinate number of particles, allowing you to continue to tweak your particle flow without being concerned about system crashes.The Integration Step section is fairly significant in that it determines the overall accuracy of movement and collision for the entire flow. The step settings determine how often these calculations take place, so the smaller the value, the more accurate the simulation will be, at the cost of additional time.Viewport can be set from Frame (once per animation frame) to 1/8 Frame (eight times per frame). Render can be set from Frame to 1 Tick. A single tick is an incredibly short period, 1/160 of a frame at NTSC rates, so this level of accuracy will rarely be needed.Note
ScriptBy enabling scripts at this point, you can cause a script to be run either at every integration step or after each frame's final integration step. Once either script usage has been enabled, the Edit button opens the text script editor.While the PF Source parameters allow you to control the setup and overall operation of Particle Flow, the real power of this system is to be found in the Particle View interface, which we will examine in the next section. Particle ViewThe main interface for setting up particle flows is Particle View (Figure 17.11). This is where you will spend the bulk of your time when creating PFlow systems. Think of Particle View as a virtual engine, where the ignition, transmission, and exhaust systems are laid out for you to drag into place and connect to suit your needs. In this section, you will explore the functionality of this interface and how elements are managed to create the desired effect. Figure 17.11. The Particle View interface.[View full size image] ![]()
Menu BarThe menu bar contains several options for adjusting and analyzing particle flow. All of these functions are available within the event display panel and are probably more intuitive to access there. Edit MenuThe Edit menu commands allow you to add, insert, and append operators or tests (Figure 17.12). An action must be selected in the event display panel to make these functions available. Selected actions or all actions can be turned on and off from this menu. Instanced actions (once selected) can be made unique, tests can be wired to events, and particle flow elements can be copied and pasted. Finally, selected items can be deleted and renamed. These functions will be examined in greater detail in the "Event Display Panel" section later in this chapter. Figure 17.12. The Particle View Edit menu.![]() Select MenuThe Select menu offers a variety of selection options for the actions in the event display panel (Figure 17.13). Select Downstreams is useful for examining a highlighted event and all of the subsequent events that are derived from it. Use Save Selected to save the highlighted actions into a new .max file, including all scene objects that are explicitly referenced. This is a handy method for copying portions of your particle flow for a new scene. Figure 17.13. The Particle View Select menu.![]() DisplayThe Display menu contains the same view controls available in the lower right of the interfacePan Tool, Zoom Tool, Region Zoom Tool, Zoom Extents, and No Zoom. You can also toggle the display of the Parameters, Depot, and Description panels (Figure 17.14). Figure 17.14. The Particle View Display menu.![]() OptionsThe Options menu is primarily useful when debugging particle flows (Figure 17.15). The Default Display type determines whether Display operators are automatically added to new events. When this is set to Local, Display operators will be automatically added to newly created events, making it easier to discern in viewports when particles have moved from one event to another. Figure 17.15. The Particle View Options menu.![]()
Parameters PanelIn this area, you can edit the parameters for the operators in your setup, similar to the way the Modify panel allows you to edit the properties of objects selected in the max viewport (Figure 17.16). This panel displays available parameters for any selected operator. It can be turned on and off using the Display menu command. Figure 17.16. The parameters panel.![]()
The DepotThink of this part of the Particle View interface as a spare-parts drawer (Figure 17.17). This panel holds all of the available particle flow actions. Operators, such as Position, Scale, and Shape, as well as tests, such as Collision and Speed, and default particle flow templates (Empty and Standard) can be dragged from this panel into the event display panel. The display of this panel can be toggled using the Display menu command. Figure 17.17. The depot and the description panel.[View full size image] ![]()
Description PanelWhen an action is selected in the depot, a brief text description of its functionality is displayed in the description panel. Event Display PanelThis is where you get to the meat of Particle View, where you put all the parts together to create your particle masterpiece. The event display panel is the main element of the Particle View interface. It contains the visual representation of all particle flows in the current scene, and it diagrams their setup. The Edit menu functions are available within the event display, often by right-clicking an action. EventsThe "spare parts" you drag from the depot to assemble your particle system are grouped into collections known as events. Events are groups of actions (operators and/or tests) that are evaluated in order, top to bottom, for each particle that enters. Particles remain in an event, subject to the parameters of its constituent actions, until deleted or sent out to another event. Even when a single operator is created in the event display panel, it becomes part of an event.There are several methods available to create an event. Right-clicking the event display background brings up a contextual menu.Selecting New > Particle System > Empty Flow or Standard Flow creates a new PF Source global event and a corresponding PF Source icon in the viewport, at World coordinates 0, 0, 0 (Figure 17.18). Figure 17.18. A standard Particle Flow global event and birth event.![]()
Editing EventsOne of the simplest features of the event display panel, and one of the most useful in terms of creating a particle setup that reflects your intentions, is the freedom to move events anywhere within the panel. Once created, events can be moved by clicking their title bar and dragging them to a new area of the event display panel. Events can also be horizontally resized by dragging the right-hand border. You can also move actions by selecting and dragging them. If an action is dragged into an empty area of the event display, a new event is created, just as with using the New contextual-menu items. When an action is dragged into an existing event, a colored line shows how the action will be added. Where a blue line is indicated, the action will be inserted between existing actions. Where a red line shows, the existing action will be deleted and replaced with the action that is being moved.Actions can be added to existing events by right-clicking the event's title bar to bring up the contextual menu (Figures 17.19 and 17.20). Selecting an action under Insert will insert that action at the beginning of the event. Selecting an action under Append will place the action at the end of the event. Neither option will replace any of the existing actions in the event. Moving actions can have a significant impact on the behavior of your particles, as actions are always evaluated within events in a top-down order. Figure 17.19. Selecting an action to append onto a Particle View event using the contextual menu.![]() Figure 17.20. The selected action is appended to the event.![]()
ActionsThe available tests, operators, and particle sources in Particle View are known as actions. It is important to note that actions occur over different time frames. Some, like Force, Keep Apart, and Shape Facing, continuously influence particles within their events (and cease to have any influence once those particles have moved on to other events). Others, like Material Static and Shape, apply their parameters to particles one time and then are not evaluated until a new particle enters the event.Note
TestsThe decision-making part of Particle Flow allows you to redirect particles based on a variety of tests, by evaluating their properties (Age or Speed, for example), by evaluating their relation to other scene objects (Collision, Find Target), or arbitrarily (Split Amount). Actions that test particle or event conditions and/or direct particles to another event are known as tests. If a test is wired to another event, then particles testing True will be sent to that event. If a test is not wired to another event, then particles in effect always test False and remain in the original event.NoteTip
Detailed descriptions of particle flow tests are available in the online 3ds max 7 User Reference (Help > User Reference), under Contents > Space Warps and Particle Systems > Particle Systems > Particle Flow > Actions > Tests. OperatorsOperators are particle flow actions that are used to control particle parameters such as scale, speed, rotation, and shape. Think of operators as individual components of the Modify panel properties you are accustomed to setting for scene objects, except that in the Particle View interface, you can use only the components you need.Some operators perform functions other than controlling transformations; examples are the Birth, Birth Script, and Delete operators, which control particle life span.In addition, there are four utility operators that serve general purposes. They are Cache (for precalculating intense particle flows), Display (determines particle appearance in viewports), Notes (stores comments), and Render (determines particle appearance when rendering).Each operator has a unique icon, and they all share a blue background, with the exception of the two birth operators, which are green. The operators available in Particle Flow are the following:
Detailed descriptions of particle flow operators are available in the online 3ds max 7 User Reference (Help > User Reference), under Contents > Space Warps and Particle Systems > Particle Systems > Particle Flow > Actions > Operators. FlowsThere are two available particle flows that can be used to create a new systemEmpty Flow and Standard Flow.Empty Flow creates an event with a single Render operator (and a Display operator if Options > Default Display is set to Global). This is useful for creating a new particle flow from scratch.Standard Flow creates a more elaborate setup: The global event will be identical to that of Empty Flow, but in addition a birth event is created and wired to it. The birth event will contain a simple particle setupBirth, Position Icon, Speed, Rotation, Shape, and Display operators. This is identical to the particle flow created when a PF Source icon is created in a viewport.If a Camera or Perspective viewport is active when an empty or standard flow is created, the corresponding PF Source icon will be oriented on the XY plane. If an orthogonal viewport is active, the PF Source icon will be oriented parallel to the viewplane, with the icon's Z axis pointing toward the viewport. Editing ActionsThe contextual menu for actions is similar to that for events. The Insert and Append options are available for adding actions, but the placement depends on where the pointer is when opening the menu. If the pointer is placed over an action (the action name will appear as a tool tip), then Insert will replace that action with the new action. If the pointer is placed between actions (no tool tip appears), then Insert will place the new action between the two existing actions. Append will always place the new action at the end of the event, regardless of where the pointer is located.Actions can also be turned on or off from this menu, or by clicking the action's icon. When an action is deactivated, the icon and action title are grayed.Tests can be forced to always test True (all particles are sent to the wired destination, if any) or False (all particles are retained within the current event). For True results, click the left side of the icon (the icon will change to a green lightbulb). For False results, click the right side of the icon (the icon will change to a red lightbulb). To reset the test to normal functioning, click the icon once more.Instanced actions can be made unique from this menu as well.The Wire option in the contextual menu wires events and tests, or global events and birth events, together. This option is only available when eligible items are selected and when you right-click one of them. To wire an event to the outcome of a test, select the test action (not the event containing the test) and the target event (not an action within the target event), right-click on one of them, and choose Wire from the contextual menu. To wire a birth event to a global (PF Source) event, select both events (not actions within them), right-click, and choose Wire (Figures 17.21 and 17.22). Figure 17.21. Eligible events and tests, as well as global events and birth operators, can be wired together using the right-click menu.![]() Figure 17.22. After the Wire command is chosen from the contextual menu, the eligible events are wired.![]() Wiring EventsAs noted in the "Editing Actions" section earlier in the chapter, events, tests, and birth operators can be connected via the contextual menu. A more intuitive approach is to simply drag a wire from one event to another.When a test is added to an event, an output is created in the form of a small blue dot wired to the left side of the test. The pointer will change to a wiring icon with three arrows when you can drag a wire from this output, and to a wiring icon with four arrows when you can drop the wire into an event input. Note that this works in either direction; wires can be dragged from events into tests. In a similar fashion, the output of a global event can be wired to a birth event (an event that begins with a Birth or Birth Script operator). You cannot wire a global event to a non-birth event.Note
|