Population Tool Locator

Population Tool Locators provide an easy way to place Maya particles/nParticles in the scene. Each particle will be given a direction and an Entity Type. It also provides parameters to specify the population (Entity radius, Entity Type weights in the population, distance, noise…).
 
 
The Population Tool locator can be mapped with a Terrain Locator. In this case, particles Y position will be defined according to this terrain.

Creation

Configuration

Population Tool Id Unique id of the Population Tool Locator

Population Attributes

This panel contains parameters to precisely manage the particles placement in the locator.

Particles Attributes

Slots Number of wanted particles. Notice that if the zone is too small or contains too many obstacles, it is not always possible to generate the wanted number of slots
Placed slots

Actual number of slots placed in the area. It can be different from the Number of slots if a Terrain Node with a NavMesh has been assigned to this Locator and there's enough space to fill the Population requirements (distance between slots, radius...)

Radius Radius of the relative Entities. It is recommended to use the Entity mesh radius, especially when using Navigation Behavior
Height Height of the relative Entities. The height is mainly used for collision detection between slots of different Population Tools

Distance and Noise Attributes

DistanceX / Z Distance between particles
NoiseX / Z Position noise of Entities
Quincunx placing Use a quincunx shape for particles placing

Without a quincunx placing (1) and with a quincunx placing (2)

Orientation Attributes

Orientation Attributes
Orientation Orientation of Entities
Look At

Modify the orientation of Entities in order to look at a Locator


Look at orientation

Orientation Noise Orientation noise of Entities
In Vector Field Locator

Vector Field attached to this Population Tool. The Vector field will be used to orient the particles. Select the Vector Field with the combo box. Painting in the selected Vector Field will automatically update the particles orientation.

 
Population Tool slots without and with Vector Field.

Grid Attributes

Number of columns Number of columns of the area.
Number of rows Number of rows of the area.
These attributes are editable only with the center point shape, by updating the size of the grid. With others shapes, it's an information about the size of the computed grid.

Density Attributes

Open the Paint Tool to paint the Population density 

Create Particles Attributes

Particle System

Choose "New" to create a new Particle System, or select a Particle System from the scene to replace or merge it with current particles.

Crowd Field

Choose "New" to create a new Crowd Field, or select a Crowd Field from the scene to link with the created / replaced particle system. Is it also possible to choose "None" to emit particles which will not be assigned to a Crowd Field. A Crowd Field can also be created afterwards if required (see Crowd Field documentation).

Create When you get the wanted repartition, press this button to create a new Particle System. The Particle System will be fed with an initialization directions, Entity Types, radius and other requested attributes
Replace/Append

Replace or append the Particle System selected in the previous combo box with the new one. Notice that replacing a Particle System will preserve existing connections and expressions.

Several Population Tool Locators selection

When you get the wanted repartition in several Population Tool Locators, select them and press the Create button to create a new Particle System containing relative particles. Replace or append the Particle System previously selected in the Combo Box with particles from the selection.

 
Create, replace or append particles from selected Population Tools Locators

Notice that, due to a Maya limitation, it is possible to add particles to a particle system but not to remove some. Thus, when replacing (with the Replace button) an existing particle system with less particles that it had before, the particle count of the particle system will stay the same but the extra particle lifespan will be set to 0 (not simulated)

Tips: In order to create several Population Tool Locators from the same shape, it is possible to duplicate a Population Tool Locator. To do so, it is recommended to use the Duplicate Special command (Edit / Duplicate special), with the Duplicate input connections option enabled, in order to conserve the connection with the Terrain Locator and the related Entity Types.

Edit Slot Transforms

 

It is possible to edit Population Tool slots using Maya Translate, Rotate and Scale manipulators. To edit slot, go in Maya UV Mode (F12), select one or more slots in the Population Tool Locator, enable Maya Translate Tool (W), Maya Rotate Tool (E) or Maya Scale Tool (R) and use the gizmo to rotate Entities. To reset the slots position to their original positions / orientations, reset the Slots count to 0 and reset it at the previous value

Lock Slots Lock the selected slots. A locked slot will be decorated with a locker inside the viewport .
A locked slot is no more affected by the placement attributes updates, its position and orientation are locked. However if the number of particles is not sufficient to place this locked slot, it will be removed.
Unlock Slots Unlock the selected slots. The selected slot will be decorated inside the viewport 

EntityTypes Attributes

This panel defines which kind of Entity Types will be affected to the emitted particles. Notice that Entity Types previously selected in the Population Tool Context are present in this layout. 
EntityTypes Attributes
New Entity Types can be mapped by choosing it in the combo box and then by clicking on the add button . To remove an Entity Type just click on the related remove button . Clean all mapped Entity Types with the remove all button.
 
Each selected Entity Type has an attribute defining its weight relative to other mapped Entity Types. The ratio of Entity Types in the Population Tool Locator will be affected by changing weight attributes.
 
Illustration of the use of Entity Types during the placement step with different weights
Notice that Entity Types weight attribute is influenced by the placement seed and the Crowd Manager random seed.

Notice that Entity Types can also be painted on the Population Tool with the Paint Tool.

Group EntityTypes Attributes

This panel defines which Group Entity Types will be affected to the emitted particles.

Using a Group Entity Type will bypass Entity Types mapped in the EntityTypes Attributes panel, the Population Tool Locator will use Entity Types of the selected Group instead.

As the EntityTypes Attributes panel, the ratio of Group Entity Types will be affected by changing weight attributes.

Group Size Attributes


Group Size Attributes
Group Min Size Particles will be grouped by at least this value
Group Max Size Particles will be grouped by a maximum of this value
By using these attributes, you will be able to group several particles inside a Population Tool Locator. The same Group Entity Type will be used by the particles inside a cluster.

Illustration of Group Size Attributes (min:3 and max:5)

Emitter Attributes

The populationTool can be used as an emitter. In that case, it will emit from first (active) frame of simulation, at emitter rate, until max count is reached. The generated particles will be configured as defined by the Population Tool: same slots, EntityTypes weights, etc. If the number of population tool slot has been consumed by the previous emitted particles, the emission starts again at first slot.

Emissions can also be achieved via behaviors, see Emit

Emitter Max Count
This is the maximum count of particles emitted by this Population Tool. When this number is reached, the Population tool stops emitting particles.
Emitter Rate The emission rate (in particles / second) of the particles. 

Terrain Attributes

In Terrain Mesh

Terrain Locator attached to this Population Tool. The Terrain locator will be used to make the locator slots adapted to the terrain. Select the Terrain with the combo box. If you don't want the slots to be adapted to the Terrain, just unlink it.


 
Enable Collision If checked, slots in collision with slots of Population Tools listed in the In Colliders attributes will not be placed
In Colliders

Population Tools to consider slot collisions with. By default, Population Tools sharing the same Terrain Locator will be automatically added as Colliders.

Callback Attributes

This panel allows to define MEL or Python callbacks which will be called each time the button a Particle System will be created, replaced or appended by the Population Tool Locator.

PreEmit Callback

MEL/Python script command called just before a particle system is created / replaced / appended (using special tag #pt# will be replaced with the Population Tool Locator name)

PostEmit Callback

MEL/Python script command called just after a particle system is created / replaced / appended (using special tag #pt# will be replaced with the Population Tool Locator name and  #ps#  with the created/replaced/appended particle system name)

Component Placement

This panel allows to modify a Population Tool created with the populate on selected component tool 


Component Placement

Replace or append population slots into a previously created Population Tool (use CTRL Key to select the Population Tool in the Outliner after performing the selection of components). This action preserves configured attributes.

  
Append components to a Population Tool Locator

Emission Attributes (Per Particles)

This panel defines per-particles emission attributes of the Population Tool Locator.
All per-particles attributes will be exported in the wanted Particle System. If a per-particles attribute does not exist, it is automatically created.
Emit NParticles Emit this Population Tool Locator in a nParticle System
Init DirectionPP Name Name of the vector per-particle attribute in which the orientation of the Entities will be exported.
Entity TypePP Name Name of the float per-particle attribute in which the Entity Type of the Entities will be exported. The Id of an Entity Type can be found in the attribute editor of the EntityType
RadiusPP Name Name of the float per-particle attribute in which the radius of the Entities will be exported.
Export Crowd Entity Type Colors in Particles Export the Entity Type colors in a per-particle attribute, see below to define the name of this attribute
ColorPP Name Name of the color per-particle attribute, in which the color of the Entities will be exported.
Enable Conserve Attribute In Particle System Enable or disable the conserve attribute in the wanted particle system
Particle Render Type Select the particle render type of the wanted particle system

For more explanation about how to use ppAttributes, see ppAttributes Handling.

Paint Attributes

Resolution Resolution of the painted map. This goes from 256x256 to 4096x4096. Changing resolution resamples the map. Bigger map takes longer to save and uses more memory.
Use Paint For Density This attribute is activated automatically as soon as the Paint Tool is used to paint slot density on the Population Tool Locator
Use Surface Normals If Use Surface Normals is enabled, a dot-product is made between the surface normal and the vector between the surface point and the closest spline point. 
Add Spline Add a spline free slot where you can map a spline and specify its rendering attributes
Render

Rendering splines will erase the surface if at least one spline is enabled

Spline Attributes
  • Enable/disable check
  • Mapped spline
  • Radius around the spline that will influence surface
  • Paint intensity/slots density
  • Remove spline button

Locator Display Attributes

This panel defines the population Tool Locator display attributes.
Show Particle Index Display the particle index in the viewport. Very useful when scripting
Locator Height Height of the Population Tool Locator. Particles will still be generated on the terrain

Advanced Attributes

Finally, this panel defines the Population Tool Locator advanced attributes. If you read all this page till this part you just earned all my consideration, congrats!

Advanced Attributes
Placement Seed

Value used to initialize the current Population Tool Locator seed in addition of the Crowd Manager random seed. Changing this value has an influence on the Entities placement, but only in this Population Tool Locator. 

Relationship between emitted Particle Systems and the Population Tool Locator

When a particle system is emitted from a Population Tool Locator, a link is created between the two objects. This link can be used to retrieve which Population Tool Locator has been used to emit one particle system.


Relationship between emitted particle systems and their Population Tool Locator

When a particle system is emitted from a Population Tool Locator, some special Per-Particle Attributes are created and set automatically. If some of those Attributes do not exist, Golaem uses default values. The created Per-Particle Attributes are the following:

Created Per-Particle Attributes

glmEntityId Unique id of each Entity. The value of this PPAttribute is set every time a simulation starts. When emitted from the Population Tool, it is set to -1.
glmEntityType Entity Type Id to which the Entity belongs to. It corresponds to the same id stored in the Entity Type nodes. If not existing, the first Entity Type created will be assigned to the Entity.
glmOrientation Euler angle representing the orientation of the Entity. If not existing, Entities will be initialized X-front
glmPopulationTool Population Tool Id from which the Entity has been emitted. It corresponds to the same id stored in the Population Tool Locators. This attribute is not required at simulation time, it can just be used to retrieve emitter information
groupEntityType Group Entity Type Id to which the Entity belongs to. It corresponds to the same id stored in the Group Entity Type nodes. This attribute is only required when using Group Entity Types
populationGroupId Population Group Id to which the Entity belongs to. This attribute is only required when using Group Entity Type

Overwritten Per-Particle Attributes

position Position of the Entity. It corresponds to the position of the slot
radius Radius of the Entity. It corresponds to the radius of the slot and is used by the Navigation Behavior
rgbPP Display color of the Entity. It corresponds to the color of the slot.
lifespan Lifespan of the Entity. It is set to the maximum value possible to make sure Entities don't get deleted during the simulation

For more explanation about how to use ppAttributes, see ppAttributes Handling.