Interface: pop

Interfaces > Core Interfaces > pop

 

   

Core Interfaces - Quick Navigation

 

   

The pop Core Interface exposes the properties and methods related to the set up and simulation of Populate systems.

Available in 3ds Max 2014 and higher.

   

The Populate system distinguishes between Pedestrians - characters entering, walking along Flows and exiting the scene, and Idlers - characters standing or sitting around.

Other than the Idlers, the Pedestrians can be reused - "spawned" in different places at different times. Each animation of a Pedestrian character, from the time it enters a portal to the time it exits a portal, is known as a “Spawn”.

The Spawning implementation has changed in 3ds Max 2015. In 3ds Max 2014, all Pedestrians existed and were animated throughout the entire length of the animation. Although they might have had multiple Spawns, there was no time between Spawns - they only disappeared for a few frames to facilitate motion blur. All Pedestrians were always in the scene, and the same number of Pedestrians existed throughout the animation.

In 3ds Max 2015, because the density of Flows can be animated and Portals can be opened and closed, the number of Pedestrians in the scene can vary drastically throughout the length of the animation. A simulation could start with zero density for all portals, and no Pedestrians in the scene, then the density could increase to add a lot of characters to the scene, and then decrease so that when they leave their flow they can’t spawn anywhere else.

There are five operations that can be performed on selected Pedestrians: Regenerate, Swap Appearance, Switch Resolution, Delete, and Bake. When performed on a Pedestrian with multiple Spawns, some of these operations will affect only the current Spawn – the one which is active at the current frame, and others will affect all Spawns of the selected Pedestrian. The decision how to make the operations work was based on expected users needs, experimentation, and technical reasons. The following table shows how each operation works:

Operation Effect
Regenerate Affects only the current Spawn
Swap Appearance Affects all Spawns
Switch Resolution Affects all Spawns
Delete Affects only the current Spawn
Bake Affects all Spawns

The scripted methods exposing operations which affect only the current Spawn take <time> as an argument, in order to specify which Spawn should be affected.

   

Properties:

pop.DisplayType : enum : Read|Write
       DisplayType enums: {#StickFigure|#CrowdCustom|#CrowdSkin}

Get/set the Display Type of the characters.

Default is #CrowdSkin .

The #HighSkin mode available in 3ds Max 2014 has been removed from 3ds Max 2015.

   

pop.TurnOpt : enum : Read|Write
       TurnOpt enums: {#hybrid|#maxspeed|#maxdistribution|#mindistance|#none}

NEW in 3ds Max 2015: Get/set the Turn Optimization mode.

Default is #hybrid .

   

pop.NumFrames : integer : Read|Write

Get/set the number of frames to simulate.

Default is 300.

   

pop.RealWorldScale : float : Read|Write

Get/set the World scale relatively to the current System Units settings.

Default is 1.0.

   

pop.SeatFemalePct : float : Read|Write

NEW in 3ds Max 2015: Get/set the percentage of female seats.

   

pop.SeatMaxTalkDist : float : Read|Write

NEW in 3ds Max 2015: Get/set the maximum talking distance when seated.

   

pop.SeatMaxTalkAngle : float : Read|Write

NEW in 3ds Max 2015: Get/set the maximum talking angle when seated.

   

Methods:

<integer>pop.NumStandingIdlers()

NEW in 3ds Max 2015: Returns the number of standing (not seated) idle characters in the simulation.

   

<integer>pop.NumSeatedIdlers()

NEW in 3ds Max 2015: Returns the number of seated idle characters in the simulation.

   

<integer>pop.NumPedestrians()

NEW in 3ds Max 2015: Returns the number of pedestrian (non-idle) characters in the simulation.

   

<node>pop.GetStandingIdler <integer>index

NEW in 3ds Max 2015: Returns the node of the indexed standing idle character.

   

<node>pop.GetSeatedIdler <integer>index

NEW in 3ds Max 2015: Returns the node of the indexed seated idle character.

   

<node>pop.GetPedestrian <integer>index

NEW in 3ds Max 2015: Returns the node of the indexed pedestrian character.

   

<bool>pop.AddIdleArea <node>IdleArea

Adds the specified IdleAreaObj object to the flow simulation.

   

<bool>pop.AddFlow <node>Flow

Adds the specified Flow object to the flow simulation.

   

<bool>pop.AddSeat <node>Seat

NEW in 3ds Max 2015: Adds the specified Seat object to the flow simulation.

   

<void>pop.Simulate()

Simulates the flow using the current settings.

Equivalent to pressing the Simulate icon in the Populate > Simulation panel of the UI.

   

<void>pop.ResimulateSelected() 

NEW in 3ds Max 2015: Resimulate the selected characters.

   

<void>pop.RegenerateSelected <time>time

Regenerates the selected characters at the specified time.

Equivalent to pressing the Regenerate Selected icon in the Populate > Simulation panel of the UI.

NEW in 3ds Max 2015: An argument specifying the time to regenerate at has been added to the existing method.

   

<void>pop.DisplayEnv <boolean>show

When the argument is True, the Environment objects (Flows, IdleAreas) will be displayed.

When the argument is False, the Environment objects will be hidden.

Corresponds to the Show Environment toggle icon in the Populate > Display panel of the UI.

   

<void>pop.DisplayPeople <boolean>show

When the argument is True, the characters will be displayed.

When the argument is False, the characters objects will be hidden.

Corresponds to the Show People toggle icon in the Populate > Display panel of the UI.

   

<void>pop.DisplayMarks <boolean>show

NEW in 3ds Max 2015: When the argument is True, displays the marks.

When the argument is False, hides the marks.

   

<void>pop.SetSelectedSeatsGender()

NEW in 3ds Max 2015: Sets the Gender of the selected seats according to the pop.SeatFemalePct seat gender percentage value.

   

<void>pop.ShowAppearanceUI()

NEW in 3ds Max 2015: Opens the "Crowd Style Customization" dialog.

   

<void>pop.SwapSelPeopleAppearance()

NEW in 3ds Max 2015: Swaps the appearance of the selected characters.

   

<void>pop.DeletePeople()

Deletes the characters from the simulation.

Equivalent to clicking the Delete People icon in the Populate > Display panel of the UI.

   

<void>pop.DeleteSelPeople <time>time

NEW in 3ds Max 2015: Deletes the selected characters from the simulation at the given time.

Affects the current Spawn only. See the beginning of this page for more info about Spawning.

   

<bool>pop.SwitchSelPeopleResolution()

NEW in 3ds Max 2015: Switches the mesh and texture detail of the selected characters when Textured Skin is active.

   

<void>pop.SwitchSelPeoplePos <time>time

NEW in 3ds Max 2015: Switches the positions of the selected characters at the given time.

Affects the current Spawn only. See the beginning of this page for more info about Spawning.

   

<void>pop.BakeSelPeople()

NEW in 3ds Max 2015: Bakes the selected characters to 3ds Max Skin and Bones.

The animation can be edited and any modifiers can be applied to the mesh. Characters can also be exported via FBX after they are baked.

This functionality is only available through MAXScript.

   

<void>pop.SaveTextureMaps <boolean>save

NEW in 3ds Max 2015: When the argument is True, saves the texture maps.

   

EXAMPLE:
theFlow = Flow() --Create a Flow object
--> $Flow:Flow001 @ [0.000000,0.000000,0.000000]
theFlow.AddPoint [0,0,0] --Add some points
--> true
theFlow.AddPoint [1000,0,0] 
--> true
theFlow.AddPoint [15000,500,0] 
--> true
theFlow.AddPoint [1000,1000,0] 
--> true

pop.AddFlow theFlow --Add the Flow to the Populate system
--> true
pop.Simulate() --Perform the simulation
--> OK
pop.DisplayEnv false --Hide the Flow environment, leaving only the people
--> OK
pop.DisplayType = #StickFigure --Switch the character display to stick figures
--> #StickFigure

See Also