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

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

   

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

Get/set the Turn Optimization mode.

Default is #hybrid .

Available in 3ds Max 2015 and higher.

   

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

Get/set the percentage of female seats.

Available in 3ds Max 2015 and higher.

   

pop.SeatMaxTalkDist : float : Read|Write

Get/set the maximum talking distance when seated.

Available in 3ds Max 2015 and higher.

   

pop.SeatMaxTalkAngle : float : Read|Write

Get/set the maximum talking angle when seated.

Available in 3ds Max 2015 and higher.

   

Methods:

<integer>pop.NumStandingIdlers()

Returns the number of standing (not seated) idle characters in the simulation.

Available in 3ds Max 2015 and higher.

   

<integer>pop.NumSeatedIdlers()

Returns the number of seated idle characters in the simulation.

Available in 3ds Max 2015 and higher.

   

<integer>pop.NumPedestrians()

Returns the number of pedestrian (non-idle) characters in the simulation.

Available in 3ds Max 2015 and higher.

   

<node>pop.GetStandingIdler <integer>index

Returns the node of the indexed standing idle character.

Available in 3ds Max 2015 and higher.

   

<node>pop.GetSeatedIdler <integer>index

Returns the node of the indexed seated idle character.

Available in 3ds Max 2015 and higher.

   

<node>pop.GetPedestrian <integer>index

Returns the node of the indexed pedestrian character.

Available in 3ds Max 2015 and higher.

   

<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

Adds the specified Seat object to the flow simulation.

Available in 3ds Max 2015 and higher.

   

<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() 

Resimulate the selected characters.

Available in 3ds Max 2015 and higher.

   

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

An argument specifying the time to regenerate at has been added to the existing method.

Available in 3ds Max 2015 and higher.

   

<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

When the argument is True, displays the marks.

When the argument is False, hides the marks.

Available in 3ds Max 2015 and higher.

   

<void>pop.SetSelectedSeatsGender()

Sets the Gender of the selected seats according to the pop.SeatFemalePct seat gender percentage value.

Available in 3ds Max 2015 and higher.

   

<void>pop.ShowAppearanceUI()

Opens the "Crowd Style Customization" dialog.

Available in 3ds Max 2015 and higher.

   

<void>pop.SwapSelPeopleAppearance()

Swaps the appearance of the selected characters.

Available in 3ds Max 2015 and higher.

   

<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

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.

Available in 3ds Max 2015 and higher.

   

<bool>pop.SwitchSelPeopleResolution()

Switches the mesh and texture detail of the selected characters when Textured Skin is active.

Available in 3ds Max 2015 and higher.

   

<void>pop.SwitchSelPeoplePos <time>time

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.

Available in 3ds Max 2015 and higher.

   

<void>pop.BakeSelPeople()

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.

Available in 3ds Max 2015 and higher.

   

<void>pop.SaveTextureMaps <boolean>save

When the argument is True, saves the texture maps.

Available in 3ds Max 2015 and higher.

   

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