PhysXPanel : ReferenceTarget

 PhysXPanel - superclass:ReferenceTarget; super-superclass:MAXWrapper - 35:0 - classID:#(721879680, 1682575996)

This class implements the UI of the "MassFX Tools" floating dialog.

Note:

The properties of this class can get the current value for settings in the "MassFX Tools" dialog, but do not set them. These properties are set with various gPx* and px_sdk* globals, which are noted in each of the properties below.

Available in 3ds Max 2012 and higher.

Constructor:

PhysXPanel ...

While it is possible to create an instance of this class, it makes no sense to do so since the MassFX system creates its own instance for the actual MassFX Tools dialog.

Instead, use the PhysXPanelInterface interface to access the existing instance of the MassFX Tools dialog:

PhysXPanelInterface.instance

Properties:

Scene Settings rollout

Ground Plane controls

<PhysXPanel>.useGroundPlane BooleanClass default: true -- boolean

Get the state of the "Use Ground Plane" option.

To set this option, use the gPxUseGround global.

When set to true, the XY ground plane will be used as a virtual collision object.

When set to false, no ground plane will be simulated.

<PhysXPanel>.groundHeight     Float    default: 0.0   --  float

Get the height of the Ground Plane in world Z units. Available in 3ds Max 2013 and higher.

To set this option, use gPxGroundHeight.

Gravity group of controls

<PhysXPanel>.gravityMode     Integer    default: 2   --  integer

Get the state of the Gravity Mode radio buttons. Available in 3ds Max 2013 and higher.

To set this option, use nvpx.gravityMode.

Possible values are:

1 - No Gravity

2 - Directional Gravity (default)

3 - Gravity By Force Object

<PhysXPanel>.enableGravity BooleanClass default: true -- boolean

Get the state of the "Gravity Enabled" checkbox.

To set this option, use the px_sdk_enable_gravity global.

When set to true, the gravity force defined by the .gravityDirection and .gravity properties will be applied to the simulation.

When set to false, no gravity will be simulated.

<PhysXPanel>.gravityDirection Integer default: 3 -- integer

Get the state of the "Direction" radio button.

To set this option, use the px_sdk_gravityDirection global.

Possible values are:

1 - X

2 - Y

3 - Z (default)

<PhysXPanel>.gravity Float default: -386.221 -- float

Get the Acceleration value in units/second². When 1 Generic Unit = 1 inch, the default value is -386.221 inches/second² which is equivalent to 9.81 m/s².

To set this option, first set the gravity direction, then set one of the px_sdk_gravityx, px_sdk_gravityy, or px_sdk_gravityz globals, depending on the direction.

<PhysXPanel>.gravityObject     UndefinedClass    default: undefined   --  node

Get the Gravity Force object used when .gravityMode is set to 3 - Gravity By Force Object. Available in 3ds Max 2013 and higher.

To set this node, use the nvpx.gravityObject property].

Rigid Bodies group of controls

<PhysXPanel>.subStepsInteger default: 3 -- integer

Get the number of sub-steps per frame.

To set this option, use the px_sdk_sub_sim_steps global.

The number of simulation steps performed between each graphical update is determined by the formula: (Substeps + 1) * Frame Rate. A frame rate of 30fps with 0 substeps results in 30 simulation steps per second, 1 substep results in 60 steps per second, 2 substeps results in 180 simulation steps per second, and so on. The maximum value of Substeps is 159, which results in 4,800 simulation steps per second of animation at 30fps. Using a higher Substeps value produces greater precision in collision and constraint results, at a cost to performance.

<PhysXPanel>.solverIteration Integer default: 30 -- integer

Get the number of solver iterations per step.

This is a global setting for the number of iterations the constraint solver performs when enforcing collisions and constraints. Higher values might be necessary when the simulation uses many constraints, or the tolerance for joint errors is very low. Values higher than 30 are generally unnecessary.

<PhysXPanel>.enableCCD BooleanClass default: false -- boolean

Get the state of the "Enable High Velocity Collisions" checkbox. "CCD" stands for "Continuous Collision Detection", a method which uses a simplified geometry hull covering the trajectory of a fast moving rigid body object between two sample steps to ensure it collides correctly with other rigid bodies in its way.

To set this option, use the px_sdk_continuous_cd global.

<PhysXPanel>.shapePerElement     BooleanClass    default: true   --  boolean

Get the state of the "Generate Shape Per Element" checkbox. Available in 3ds Max 2013 and higher.

To set this option, use the gPxGenerateShapePerElement global.

Advanced Settings rollout

Sleep Settings group of controls

<PhysXPanel>.sleepThresholdsAutomatic Integer default: 1 -- integer

Get the state of the Sleep Mode radio buttons.

To set this option, use the gPxSleepThresholdsAutomatic global.

Possible values are:

1 - Automatic - MassFX automatically calculates reasonable sleep threshold values for both linear and angular velocities above which sleep will be applied. To do so it uses a heuristic, or experience-based, method.

2 - Manual - use the .sleepSpeed and .sleepSpin properties to define the linear and agular speed thresholds for an object to go into "sleep" mode.

<PhysXPanel>.sleepEnergy     Float    default: 1.9685   --  float

Get the value of the "Speed Energy" property. It is used when the .sleepThresholdsAutomatic property is set to 1 to determine the energy threshold below which the Rigid Body will go to "sleep" mode and will not be calculated anymore. Available in 3ds Max 2013 and higher.

To set this option, use the px_sdk_sleep_energy global.

Other than the .sleepSpeed and .sleepSpin values used in 3ds Max 2012, the sleepEnergy threshold also takes into account the mass of the object in additions to its linear and angular speed to determine whether it should be calculated.

<PhysXPanel>.sleepSpeed Float default: 1.9685 -- worldUnits

Get the value of the "Min. Speed" property exposed to the UI in 3ds Max 2012. It is used when the .sleepThresholdsAutomatic property is set to 1 to determine the linear speed threshold below which the Rigid Body will go to "sleep" mode and will not be calculated anymore. The value is in units/second.

<PhysXPanel>.sleepSpin Float default: 5.0 -- float

Get the value of the "Min. Spin" property exposed to the UI in 3ds Max 2012. It is used when the .sleepThresholdsAutomatic property is set to 1 to determine the angular speed threshold below which the Rigid Body will go to "sleep" mode and will not be calculated anymore. The value is in degrees/second.

High Velocity Collisions group of controls

<PhysXPanel>.ccdMinSpeedAutomatic Integer default: 1 -- integer

Get the state of the "High Velocity Collisions" automatic/manual modes radio buttons.

To set this option, use the gPxCCDMinSpeedAutomatic global.

Possible values are:

1 - Automatic

2 - Manual

<PhysXPanel>.ccdMinSpeedThreshold Float default: 5.0 -- float

Get the "Min Speed" threshold value.

This property is used when .ccdMinSpeedAutomatic is set to 2 and .enableCCD is set to true.

Bounce Settings group of controls

<PhysXPanel>.bounceMinSpeedAutomatic Integer default: 1 -- integer

Get the state of the Bounce Min. Speed Method which determines when rigid bodies bounce off each other.

To set this option, use the gPxBounceMinSpeedAutomatic global.

Possible values are:

1 - Automatic - MassFX uses a heuristic algorithm to calculate a reasonable minimum speed threshold above which to apply bounce.

2 - Manual - To override the heuristic value for speed, choose Manual and set the desired Min Speed value:

<PhysXPanel>.bounceMinSpeedThreshold Float default: 5.0 -- float

Get the Bounce Min Speed threshold.

To set this option, use the px_sdk_bouncethresh global.

Rigid bodies in the simulation moving faster than this speed (specified in units/second) will bounce off one another as part of a collision. Setting this value too high will cause fast-moving objects not to bounce upon colliding with another object. Setting this value too low will cause more slow-moving objects to bounce around the scene, reducing simulation performance and possibly causing jittering. Setting this value to 0.0 enables bouncing for all moving objects.

Engine rollout

Options group of controls

<PhysXPanel>.useMultiThread BooleanClass default: false -- boolean

Get the state of the "Use Multithreading" option.

To set this option, use the gPxUseMultiThread global.

When set to true, the simulation will be multi-threaded to increase performance.

<PhysXPanel>.useHardwareScene BooleanClass default: false -- boolean

Get the state of the "Hardware Acceleration" option which is available when supported hardware has been detected.

To set this option, use the gPxUseHardwareScene global.

When set to true, the simulation will use hardware acceleration to increase performance.

Simulation Settings rollout

Playback group of controls

<PhysXPanel>.onLastFrame Integer default: 1 -- integer

Get the state of the "Playback>On Last Frame" radio buttons.

To set this option, use the gPxOnLastFrame global.

Possible values are:

1 - Continue Simulation - The simulation continues to run even after the time slider reaches the last frame.

2 - Stop Simulation - The simulation stops when the time slider reaches the last frame.

3 - Loop Animation and... - Repeats the animation when the time slider reaches the last frame and then acts according to the .loopAnimation property (see below).

<PhysXPanel>.loopAnimation Integer default: 1 -- integer

Get the state of the "Loop Animation and..." radio buttons.

To set this option, use the gPxLoopAnimation global.

Possible values are:

1 - Reset Simulation - The simulation resets and the animation loops back to the first frame when the time slider reaches the last frame. This is useful for watching the same simulation multiple times in a row to analyze the results.

2 - Continue Simulation - The simulation continues running while the animation loops back to the first frame when the time slider reaches the last frame. This is useful for short looping animations (such as a character's walk cycle) when you want the simulation to continue across the boundary of the looping

Rigid Bodies rollout

Physical Meshes group of controls

<PhysXPanel>.physicalMeshes Integer default: 1 -- integer

Get the state of the "Physical Meshes" drop-down list.

Possible values are:

1 - Show Only For Selected - physical meshes will be displayed only for selected rigid body objects.

2 - Show All Physical Meshes - all physical meshes will be shown regardless of selection.

3 - Hide All Physical Meshes - no physical meshes will be shown.

MassFX Visualizer rollout

Options group of controls

<PhysXPanel>.visualizerEnable     BooleanClass    default: false   --  boolean

Get the state of the "Enable Visualizer" checkbox.

<PhysXPanel>.visualizerScale     Float    default: 1.0   --  worldUnits

Get the value of the "Scale" spinner. This controls the relative size of the viewport-based indicators, such as axes.

Object Properties group of controls

<PhysXPanel>.bodyAxis     BooleanClass    default: true   --  boolean

Get the state of the "Local Axis" checkbox. When set to true (default), the local axes of the Rigid Body objects will be visualized in the viewports during simulation.

<PhysXPanel>.bodyLinearVel     BooleanClass    default: false   --  boolean

Get the state of the "Object Linear Velocity" checkbox. When set to true, the linear velocity of the Rigid Body objects will be visualized in the viewports during simulation.

<PhysXPanel>.bodyAngularVel     BooleanClass    default: false   --  boolean

Get the state of the "Object Angular Velocity" checkbox. When set to true, the angular velocity of the Rigid Body objects will be visualized in the viewports during simulation.

Joint Properties group of controls

<PhysXPanel>.jointLocalAxis     BooleanClass    default: false   --  boolean

Get the state of the "Local Axis" checkbox. When set to true, the local axes of the Joints will be visualized in the viewports during simulation.

<PhysXPanel>.jointWorldAxis     BooleanClass    default: false   --  boolean

Get the state of the "World Axis" checkbox. When set to true, the world axes of the Joints will be visualized in the viewports during simulation.

<PhysXPanel>.jointLimits     BooleanClass    default: false   --  boolean

Get the state of the "Joint Limits" checkbox. When set to true, the limits of the Joints will be visualized in the viewports during simulation.

Contact Markers group of controls

<PhysXPanel>.contactPoints     BooleanClass    default: false   --  boolean

Get the state of the "Contact Points" checkbox. When set to true, the positions of Rigid Body collisions will be visualized in the viewports during simulation.

<PhysXPanel>.contactNormal     BooleanClass    default: false   --  boolean

Get the state of the "Contact Normals" checkbox. When set to true, the normals of Rigid Body collisions will be visualized in the viewports during simulation.

<PhysXPanel>.contactForce     BooleanClass    default: false   --  boolean

Get the state of the "Contact Force" checkbox. When set to true, the magnitude of Rigid Body collision forces will be visualized in the viewports during simulation.

Collision Markers group of controls

<PhysXPanel>.collisionShapes     BooleanClass    default: true   --  boolean

Get the state of the "Collision Meshes" checkbox. When checked (default), the Rigid Body Meshes of all simulated objects will be displayed in the viewports.

<PhysXPanel>.collisionCompounds     BooleanClass    default: false   --  boolean

Get the state of the "Collision Groups" checkbox.

<PhysXPanel>.collisionSpheres     BooleanClass    default: false   --  boolean

Get the state of the "Collision Spheres" checkbox. When checked, the bounding spheres of the Rigid Body objects will be displayed. The bounding spheres can be used to determine whether two Rigid Bodies should be checked for collision at Rigid Body Mesh level. If the two spheres don't intersect, no precise and time consuming collision detection needs to be performed.

Other properties

The following properties are not exposed to the UI:

<PhysXPanel>.skinWidth Float default: 0.0393701 -- worldUnits
<PhysXPanel>.useFirst BooleanClass default: true -- boolean
<PhysXPanel>.exporterMode     Integer    default: 0   --  integer

Get the Exporter mode. Available in 3ds Max 2013 and higher.

<PhysXPanel>.pluginBuild     String    default:"2.80.1129.0299"   

Get the PhysX Plugin version string. Available in 3ds Max 2013 and higher.

<PhysXPanel>.useAdaptiveForce BooleanClass default: true -- boolean

Get the Use Adaptive Force mode. Available in 3ds Max 2013 and higher.

<PhysXPanel>.destructionRadius Float default: 1.0 -- float

Get the Destruction Radius value. Available in 3ds Max 2013 and higher.

<PhysXPanel>.destructionDamage Float default: 1.0 -- float

Get the Destruction Damage value. Available in 3ds Max 2013 and higher.

<PhysXPanel>.destructionMomentum Float default: 1.0 -- float

Get the Destruction Momentum value. Available in 3ds Max 2013 and higher.