Layouting agents

In the previous section you already created some agents. In Atoms there are a couple of layout modules you can use to layout your agents in the scene.



Grid layout

The grid layout creates a grid of agents.

Create an agent group, please make sure the attribute editor is visible and the agent group node is selected.

Click on the "Add" button and add a gridLayout module. Type the agent type name you entered previously in the "agentType" field (i.e. testMan). 
Set the "size" field to (3,1,3). Click again on the "Add" button and add a stateMachine module. 

Your 9 agents will appear in the viewport.
Hit the play button to run the simulation.


Points layout

With the points layout you can choose the exact location where the agents must be created.



Create an agent group, please make sure the attribute editor is visible and the agent group node is selected.

Click on the "Add" button and add a pointsLayout module.
Click again on the "Add" button and add a stateMachine module. 
Rewind.

Select the pointLayout module from the module list and open click on "Agent Layout Tool" button (alternatively you can open the layout tool from the menu Atoms->Tool->Agents Layout Tool). The tool layout widget will appear. Then press R or press the  icon, move the mouse over the viewport. A green circle with an arrow indicates where you are going to create an agent and its direction. Press the LMB to create an agent. To change direction press CTRL+LMB and move the cursor on the left or on the right. You can creates multiple agents at once by pressing the icon or RMB → Layout → Grid.

After creating some agents we can still edit their position, direction and change their agent type. Press the Q button or use the icon, select some agents. Then press the W button or the icon and use the move manipulator to move the agents in the scene. To rotate the use the E button or the icon.

From the tool UI or from the context menu (RMB button) you have access to more action for each different mode. For example, go back to the selection mode and from the UI (or from the context menu) press "delete agents" to delete them. An option for changing the agent type is also available.




Mesh scatter layout

The mesh scatter layout creates randomly agents on a input mesh.

Create a plane, and scale it to 2000,1,2000

Create an agent group, please make sure the attribute editor is visible and the agent group node is selected.

Click on the "Add" button and add a meshScatterLayout module. Type the agent type name you entered previously in the "agentType" field (i.e. testMan). 
Set the "radius" field to 150. Type "pPlane1" into the mesh field or simply click it with the middle mouse then drag+drop it from the outliner on that field. Click again on the "Add" button and add a stateMachine module. 

Click on Maya time slider rewind button and your agents will appear in the viewport.
Hit the play button to run the simulation.


Curve layout

The curve layout creates agents along an input curve.

Create a curve, so that it can fit several agents.

Create an agent group and add a curveLayout module and a stateMachine module.
Type the curve name inside the "curve" attribute of the curveLayout module or simply click it with the middle mouse then drag+drop it from the outliner on that field.

Click on time slider rewind button and your agents will appear in the viewport.
Hit the play button to run the simulation.

If you scale the curve after setting it as the source curve of the module, please make sure to freeze its transform or Atoms will keep using its previous non-scaled shape. This is because of a Maya limitation.


Stadium layout

The stadium layout creates an arena of agents.

Create an agent group, please make sure the attribute editor is visible and the agent group node is selected.

Click on the "Add" button and add a stadiumLayout module. Type the agent type name you entered previously in the "agentType" field (i.e. testMan). 
Set the "size" field to (500,500,100),the shapeType to 1 and the steps to 5. Click again on the "Add" button and add a stateMachine module. 

Click on Maya time slider rewind button.



Offset behaviour module

The offset behaviour module can be used to modify an existing behaviour, so can be used with the grid layout module or any other layout module. It is also supported by the "Agent Layout Tool".

  • Create an agent group
  • Attach a grid layout module and set the size attribute to (5,0,5)
  • Add a state machine module
  • Add an offset behaviour module
  • Select the agent group and activate the "Agent Layout Tool" from the Atoms menu Atoms → Tools → Agents Layout Tool
  • Press the Q button or use the icon, select some agents
  • Press the W button or the icon and use the move manipulator to move the agents in the scene. To rotate the use the E button or the icon.
  • Add an agent filter behaviour module
  • Open again the "Agent Layout Tool"
  • Select some agents
  • From the Agent layout tool ui or from the context menu (click the right mouse button) press the Delete agents button
  • Rewind your scene and press play

Layout Tool:


Layouts can be combined together:

Almost all layouts can also generate agents dynamically, please follow this video to know more:

Copyright © 2017, Toolchefs LTD.