In the previous section you already created some agents. In Atoms there are a coplue couple of layout modules you can use to layout your agents in the scene.
Grid layout (
mayaMaya only)
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. testRobot).
Set the "size" field to (3,01,3). Click again on the "Add" button and add a stateMachine module.
Click on Maya time slider rewind button and 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.
Maya
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 agent group the pointLayout module from the module list and open the click on "Agent Layout Tool" from the pointsLayout module options or button (alternatively you can open the layout tool from the menu Atoms->Tool->Agents Layout Tool). It shows the The tool layout tool widget will appear. Then press R or press the icon, move the mouse over the viewport. A green circlo circle with an arrow indicates where you are going to create an agent and in what 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 . Press by pressing the icon or RMB → Layout → Grid.
After you created creating some agents we can still edit ther their position, direction and changes agentTypechange their agent type. Press the Q button or use the icon, select some agents. The 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 can access to more action for each different mode. For example go back to the selection mode and form the ui UI or from the context menu press delete agents to delete them or use the "change agent type".
Houdini
In houdini when you create an agent group it automatically creates the points layout module and a grid object as input of the "agent group modules" node.
Go inside agentGroup1_geo node and select the grid1 object. Set the row and columns to 4 and 4. Then select the pointsLayout_direction and set the value to (1,0,1). At every point of mesh atoms creates an agent. Setting the atoms_pointsLayout_directions and atoms_pointsLayout_agentTypes changes the direction and agentType of each agents. Try to create Try experimenting a little by creating a scatter node after the grid1 object to randomly creates place the agents on the grid mesh.
Mesh scatter layout (maya only)
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 gridLayout meshScatterLayout module. Type the agent type name you entered previously in the "agentType" field (i.e. testRobot).
Set the "radius" field to 150. Set the mesh to "pPlane1". 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.
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 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 activare 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