比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

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.前のセクションで、既にいくつかのエージェントを作成しました。 Atomsには、シーン内でエージェントをレイアウトするために、使用できるLayoutモジュールがいくつかあります。


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. testRobot). 
Set the "size" field to (3,1,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.

Image Removed

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 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 Image Removed 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 Image Removed 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 Image Removed icon, select some agents. Then press the W button or the Image Removed icon and use the move manipulator to move the agents in the scene. To rotate the use the E button or the Image Removed 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 or from the context menu press delete agents to delete them or use the "change agent type".

Image Removed

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. Try experimenting a little by creating a scatter node after the grid1 object to randomly place the agents on the grid mesh.

Image Removed

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. 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.

Image Removed

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 Image Removed icon, select some agents
  • Press the W button or the Image Removed icon and use the move manipulator to move the agents in the scene. To rotate the use the E button or the Image Removed 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

    Grid Layoutはエージェントのグリッドを作成します。

    エージェントグループを作成します。GridLayoutモジュールを追加してください。

    Grid Layoutモジュールの「Parameters」タブで、以前に「AgentType」フィールドに入力したエージェントタイプの名前を入力します(つまりtestRobot)。

    そして「Size」フィールドを(3,1,3)に設定します。次に、StateMachineモジュールを追加します。「Draw Attribute」タブで、DrawモードをSkeletonからSkinに変更します。

    タイムスライダのRewindボタンまたはUpdateSimシェルフボタンをクリックすると、9つのエージェントがビューポートに表示されます。

    Playボタンを押してシミュレーションを実行します。

    Image Added


    Points layout

    Points Layoutでは、エージェントを作成する必要がある正確な場所を選択することも、入力ポイントをgeoノードとして使用することもできます。



    Agents Layout tool

    エージェントグループを作成します。

    PointsLayoutモジュールを追加してください。そして、StateMachineモジュールを追加します。「Draw Attribute」タブで、DrawモードをSkeletonからSkinに変更します。

    巻き戻します。


    プロパティエディタの「Modules Attribute」タブと「PointsLayout」タブをクリックし、「Agent Layout Tool」ボタンをクリックするか、またはAgent Groupノードを選択した状態でReturnキーを押します(AtomsメニューからLayout Toolを開くこともできます:Atoms > Tool > Agents Layout Tool)。


    Pを押して、Agent Layout Toolウィジェットを開きます。 Sを押すか、Image Addedアイコンをクリックして、マウスをビューポート上に移動します。

    緑色の矢印は、エージェントを作成する場所とその方向を示しています。

    エージェントを作成するには、LMBを押します。方向を変更する場合は、Ctrl + LMBを押しながらカーソルを左右にドラッグします。 Image Addedアイコンを押すと、一度に複数のエージェントを作成できます。


    いくつかのエージェントを作成した後も、それらの位置、方向、およびエージェントタイプを変更することができます。 Qボタンを押すか、Image Addedアイコンを使用して、エージェントを選択します。次に、AボタンまたはImage Addedアイコンを押して、moveマニピュレータを使用してシーン内のエージェントを移動します。回転させるには、ZボタンまたはImage Addedアイコンを使用します。


    ツールのUIから、ユーザーはそれぞれの異なるモード毎に、より多くのアクションにアクセスすることができます。例えば、Selectモードに戻り、UIから「Delete Agents」を押して、それらを削除します。エージェントタイプを変更するためのオプションもあります。

        


    Image AddedImage Added

    Image Added




    入力ポイントの使用

    geoノードをAgent Groupノードに接続すると、Points Layoutモジュールは入力メッシュの入力ポイントを使用して、エージェントを生成します。

    atoms_pointsLayout_directionおよびatoms_pointsLayout_agentType pointアトリビュートを追加して、エージェントの方向とエージェントの種類を制御できます。 atoms_pointsLayout_ids pointアトリビュートを使用してエージェントグループIDを渡すこともできます。


    エージェントグループを作成します。Points LayoutモジュールとState Machineモジュールを追加します。 agentGroup1ノードの入力としてグリッドを追加し、Grid Sizeを1000に設定します。次に、グリッドとagentGroup1ノードの間に「Attribute Create」ノードを追加します。Attribute Createノード内で、名前をatoms_pointsLayout_directionsに設定し、タイプをVectorに設定します。

    直ちに、Valueを1,0,1に設定します。エージェントをグリッドメッシュにランダムに配置するために、grid1オブジェクトの後にScatterノードを作成して、試行します。

    Image Added



    Mesh scatter layout

    Mesh Scatter Layoutは、入力メッシュ上にランダムにエージェントを作成します。
    グリッドを作成し、150、1、150にスケールします
    エージェントグループを作成し、MeshScatterLayoutモジュールとStateMachineモジュールを追加します。
    「Radius」フィールドを50に設定し、Iterationsを500に設定します。メッシュをgridに設定します。そして左の画像のように行列を設定します。 objグリッドではなくsopグリッドをスケールした場合は、matrixを1のままにします。


    タイムスライダのRewindボタンをクリックすると、エージェントがビューポートに表示されます。
    Playボタンを押してシミュレーションを実行します。

    Image Added


    Curve layout

    Curve layoutは、入力カーブに沿ってエージェントを作成します。
    カーブを作成し、それを150、1、150にスケールします。
    エージェントグループを作成し、CurveLayoutモジュールとStateMachineモジュールを追加します。
    作成したカーブをCurveLayoutモジュールの「Curve」アトリビュート内に設定します。


    タイムスライダのRewindボタンをクリックすると、エージェントがビューポートに表示されます。
    Playボタンを押してシミュレーションを実行します。

    Image Added


    Stadium layout

    Stadium Layoutは、エージェントの舞台を作ります。
    エージェントグループを作成します。アトリビュートエディタが表示され、Agent Groupノードが選択されていることを確認してください。
    「Add」ボタンをクリックして、StadiumLayoutモジュールを追加してください。


    以前に、「AgentType」フィールドに入力したエージェントタイプ名を入力します(つまりtestRobot)。
    「Size」フィールドを(500,500,100)に、ShapeTypeを1に、Stepsを5に設定します。

    「Add」ボタンを再度クリックして、StateMachineモジュールを追加します。




    Offset behaviourモジュール

    Offset Behaviourモジュールは、既存のbehaviourを変更するために使用することができるため、grid layoutモジュールまたは他のlayoutモジュールと共に使用できます。 「Agent Layout Tool」でもサポートされています。

    • エージェントグループを作成します。
    • Grid Layoutモジュールを添付し、Sizeアトリビュートを(5,0,5)に設定します。
    • State Machineモジュールを追加します。
    • Offset  Behaviourモジュールを追加します。
    • エージェントグループを選択し、AtomsメニューのAtoms > Tools > Agents Layout Toolから「Agent Layout Tool」を有効にします。
    • Qボタンを押すか、Image Addedアイコンを使用して、エージェントを選択してください。
    • AボタンまたはImage Addedアイコンを押し、moveマニピュレータを使用して、シーン内のエージェントを移動します。回転させる場合は、ZボタンかImage Addedアイコンを使用します。
    • Agent Filter Behaviourモジュールを追加します。
    • 「Agent Layout Tool」を再度展開します。
    • いくつかのエージェントを選択します。
    • Agent Layout ToolのUIから「Delete Agent」ボタンをクリックします。
    • シーンを巻き戻して、Playを押します。