Interface: nvpx

Interfaces > Core Interfaces > nvpx

 

   

Dynamics - Quick Navigation

   

Core Interfaces - Quick Navigation

The nvpx Core Interface exposes the MassFX Physical Simulation system based on nVidia PhysX technology to MAXScript.

Available in 3ds Max 2012 and higher.

Topic Navigation  

Scene Export

World Settings

Simulation

Bodies And Constraints

Rigid Body Copy and Paste

Rigid Body Mesh Access

Node Physical Properties

Physical Material Loadng and Saving

Physical Material Access

Bounding Geometry Creation

Sleeping Actors

Get/Set Parameters

Contacts Report

Skin Access

Bone Methods

Ragdoll Access

Biped Intergration

Physique Integration

Utility Functions

Indirect Drag Methods

Visualizer Methods

PhysX System

Viewer

Profiler Methods

Multi-threading and Hardware Acceleration

UnitTest Methods

   

 Interface: nvpx

Properties:

nvpx.UseAdaptiveForce : boolean : Read|Write

Get/set the state of the Use Adaptive Force option.

Available in 3ds Max 2013 and higher.

   

nvpx.gravityMode : enum : Read|Write

gravityMode enums: {#none|#directional|#object}

Get/set the gravity mode.

Possible values are:

#none - no gravity

#directional - directional gravity

#object - object-based gravity using the nvpx.gravityObject property (see below)

Available in 3ds Max 2013 and higher.

   

nvpx.gravityObject : node : Read|Write

Get/set the gravity object defining the direction of gravity.

Available in 3ds Max 2013 and higher.

   

Scene Export

Methods:

<integer>nvpx.ExportPhysXScene <string>filename <string>extension

Exports the scene simulation data to an external file using the file format specified by the second argument. Returns 0 on success, -1 on failure.

Possible extension values are:

"xml" - creates a default XML file

"nxb" - creates an NxuStream BINARY file

"dae" - creates a COLLADA XML file.

Any other extension value will cause a warning to be printed to the MAXScript Listener, and the export will use the XML file format.

The actual file extension used in the filename argument does not have to match the file type. For example, it is possible to save a file called "collada.xml" using the "dae" extension argument.

EXAMPLE

nvpx.ExportPhysXScene "c:\\temp\\physxtest.xml" "xml"
--> 0
nvpx.ExportPhysXScene "c:\\temp\\physxtest.nxb" "nxb"
--> 0
nvpx.ExportPhysXScene "c:\\temp\\physxtest.dae" "dae"
--> 0
nvpx.ExportPhysXScene "c:\\temp\\physxtest.abc" "abc"
--> SDK does not support exporting format, abc. It will be exported with default format.
--> 0

   

<integer>nvpx.ExportPhysXProjectFile <string>physxProjectPath <string>physxProjectName

Exports a PhysX Project file in XML format named according to the second argument to the path specified by the first argument. The extension .PxProj will be added automatically.

Available in 3ds Max 2013 and higher.

EXAMPLE

nvpx.ExportPhysXProjectFile @"c:\temp\" "physxproject"

FILE CONTENT

<PhysicsPlugin>
    <GraphicsExport File="physxproject.fbx" />
    <PhysicsExport SDK="2.8.5" PhysXScene="" />
    <ClothingTool CTP="" />
    <SceneParameters>
        <AnimationRange Start="0" End="100" FrameRate="30" FrameSubStepCount="0" />
        <LengthUnit type="0" scale="1" length="39.3701" />
        <GroundPlane enabled="true" direction="0.0 0.0 1.0" height="0" />
        <Gravity enabled="true" value="0 0 -386.221" />
        <Simulation SolverIteration="4" LastFrameMode="Continue Simulation" LoopAnimationMode="Reset Simulation" />
    </SceneParameters>
    <SceneObjects />
</PhysicsPlugin>

   

<integer>nvpx.ExportPhysXProject <string>physxProjectPath <string>physxProjectName <string>fbxFileName

Exports the PhysX project with the name specified by the second argument to the path specified by the first argument. Includes the geometry exported as FBX file name according to the third argument.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.PrepExportPhysXScene <boolean>isexportphysx <string>extension

Prepare for export.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.PrepExportAPEXClothing <boolean>exportAPEXClothing <string>apExtension <boolean>useModelSpace \
<float>scale <boolean>addHulls <boolean>exportCTW <boolean>exportFBX <boolean>exportSelected <boolean>launchViewer \
<boolean>reverseWinding <boolean>omitMeshSubpartName 
 

For future use.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.PrepExportAPEXDestruction <boolean>exportAPEXDestruction <string>apExtension <boolean>exportSelected

For future use.

Available in 3ds Max 2013 and higher.

   

<boolean>nvpx.GetExporterMode <integer>Parameter

Returns the exporter mode of the specified parameter.

Available in 3ds Max 2013 and higher.

<boolean>nvpx.SetExporterMode <integer>Parameter <boolean>onOff

Sets the exporter mode of the specified parameter to the boolean value of the second argument.

Available in 3ds Max 2013 and higher.

   

   

World Settings

Properties:

nvpx.gravityMode : enum : Read|Write

gravityMode enums: {#none|#directional|#object}

Get/set the Gravity mode.

Possible values are:

#none - no Gravity

#directional - Use the direction specified by the nvpx.SetGravity() and returned by the nvpx.GetGravity() methods

#object - Use the -Z axis of the object specified by the nvpx.gravityObject property

Available in 3ds Max 2013 and higher.

   

nvpx.gravityObject : node : Read|Write

Get/set the reference object whose -Z axis defines the Gravity direction when nvpx.GravityMode property is set to #object.

Available in 3ds Max 2013 and higher.

   

Methods:

<point3 by value>nvpx.GetGravity()

Returns the Gravity vector as a Point3 value expressed in Generic Units / second squared. When the System Units are set to 1GU = 1 Inch, the Gravity defaults to [0,0,-386.221] that is equivalent to [0,0,-9.81] meters per second squared - Earth's acceleration.

<integer>nvpx.SetGravity <point3 byvalue>gravity

Sets the Gravity vector to the given Point3 value.

In 3ds Max 2013 and higher, it is used when nvpx.gravityMode option is set to #directional .

   

<float>nvpx.GetGeometryScale()

Returns the Geometry Scale factor. Default is 1.0.

<float>nvpx.SetGeometryScale <float>scaleRate

Sets the Geometry Scale factor to the Float argument.

   

<boolean>nvpx.CreateGround <float>position <&point3>normal

normal is In and Out parameter

Creates a Ground plane at Z height given by the position argument and aligned to the normal vector specified by the second argument.

There can be only one Ground plane in the simulation.

   

<boolean>nvpx.RemoveGround()

Removes the Ground plane from the simulation.

   

<boolean>nvpx.ReadSystemUnit <integer>type <float>scale

   

<float>nvpx.GetMeterToSystemUnit()

Returns the scale factor between meters and the current system units. When the System Units are set to 1GU = 1 inch, the value will be 39.3701, the number of inches in one meter.

<float>nvpx.SetMeterToSystemUnit <float>newValue

Sets the Meter to System Units scale factor to a user value, thus defining a new world scale.

   

<void>nvpx.SetCCDMotionThreshold <float>ccdMotionThreshold

Sets the Continuous Collision Detection motion threshold value to the specified floating point parameter.

   

<integer>nvpx.GetSolverIterations()

Returns the number of solver iterations.

<integer>nvpx.SetSolverIterations <integer>count

Sets the number of Solver Iterations to the integer argument. Returns the new value.

   

<void>nvpx.SetShapePerElement <boolean>shapePerElement

Sets the Shape Per Element mode to the specified boolean value.

Available in 3ds Max 2013 and higher.

   

Simulation

Methods:

<integer>nvpx.Simulate <float>deltat

Starts the simulation using the specified time step.

   

<boolean>nvpx.IsSimulating()

Returns true if the simulation is currently running, false if it is not.

   

<integer>nvpx.SetSimulationSubSteps <integer>numSteps

Sets the simulation sub-steps to the given value.

   

<integer>nvpx.SimulationReset()

Resets the simulation.

   

<void>nvpx.SetSimulationState <integer>state

Sets the simulation state to the specified mode without performing an actual simulation.

In 3ds Max 2012, the argument was a boolean, False meaning the simulation was reset, True the simulation was performed.

In 3ds Max 2013, the argument was changed to an integer:

0 - simulation was reset, no simulation data available

1 -

2 - simulation has been performed, simulation data available

<integer>nvpx.GetSimulationState()

Returns the current simulation state as integer.

See above for valid values.

   

<void>nvpx.PauseSimulation()

Causes the simulation to be paused.

Available in 3ds Max 2013 and higher.

   

Bodies and Constraints

Methods:

<integer>nvpx.AddRigidbody <node>inode

Adds the node passed as argument to the simulation as a rigid body. Returns 1 on success, 0 on failure. If failed, a message will also be printed to the MAXScript Listener.

<integer>nvpx.RemoveRigidbody <node>inode

Removes the Rigid Body data from the given node.

<integer>nvpx.RemoveAll()

Removes the Rigid Body data from all scene nodes.

   

<integer>nvpx.AddConstraint <node>node

Adds a Constraint to the given node.

   

<integer>nvpx.AddDistanceJoint <node>node

Adds a Distance Joint to the given node.

   

<integer>nvpx.SetRigidbodyShapeFlag <node>inode <TSTR by value>flagname <boolean>value

Sets the Rigid Body Shape Flag with the name provided by the second argument in the node specified by the first argument to the boolean value passed as third argument.

   

<boolean>nvpx.RBBroken <node>inode

Returns true if the Rigid Body of the given node is broken, false otherwise.

   

<integer>nvpx.ClearInvalidNodes()

Clears the invalid nodes.

   

<integer>nvpx.PrintNodeParams <node>inode

Prints detailed information about the specified node.

EXAMPLE

nvpx.PrintNodeParams  $Teapot001
 print Node param blocks:
totally 0 Param Blocks
 print modifier param blocks:
totally 1 Param Blocks
 PBlock version 9, local name: ??, flag: 0x226, 60 Params
  Param 0 (type): TYPE_INT, flag: 0x920020, value: 1
  Param 54 (switchType): TYPE_BOOL, flag: 0x820020, value: false
  Param 55 (switchTypeAtFrame): TYPE_INT, flag: 0x920020, value: 0
  Param 35 (EnableGravity): TYPE_BOOL, flag: 0x820020, value: true
  Param 53 (ContinuousCollisionDetection): TYPE_BOOL, flag: 0x820020, value: false
  Param 36 (SleepAtStart): TYPE_BOOL, flag: 0x820020, value: false
  Param 52 (CollideWithRigidBodies): TYPE_BOOL, flag: 0x820020, value: true
  Param 1 (): TYPE_INODE, flag: 0x810000, value: 0x0
  Param 2 (extraShapes): TYPE_STRING, flag: 0x800000, value: "(null)"
  Param 3 (manualSetup): TYPE_BOOL, flag: 0x820020, value: true
  Param 4 (materialId): TYPE_INT, flag: 0x820020, value: 0
  Param 6 (density): TYPE_FLOAT, flag: 0x820020, value: 0
  Param 5 (volume): TYPE_FLOAT, flag: 0x820020, value: 0
  Param 7 (mass): TYPE_FLOAT, flag: 0x820020, value: 0
  Param 8 (staticFriction): TYPE_FLOAT, flag: 0x820020, value: 1073741824
  Param 9 (dynamicFriction): TYPE_FLOAT, flag: 0x820020, value: 1073741824
  Param 10 (bounciness): TYPE_FLOAT, flag: 0x820020, value: 0
  Param 62 (EnableAdvancedSettings): TYPE_INT, flag: 0x820020, value: 0
  Param 56 (SkinWidth): TYPE_BOOL, flag: 0x820020, value: false
  Param 57 (SkinWidthValue): TYPE_FLOAT, flag: 0x20020, value: 0
  Param 58 (SolverIter): TYPE_BOOL, flag: 0x820020, value: false
  Param 59 (SolverIterValue): TYPE_INT, flag: 0x120020, value: 4
  Param 61 (InitialMotionStyle): TYPE_INT, flag: 0x820020, value: 1
  Param 39 (InitialVelocityX): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 40 (InitialVelocityY): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 41 (InitialVelocityZ): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 37 (velocitySpeed): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 42 (InitialSpinX): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 43 (InitialSpinY): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 44 (InitialSpinZ): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 38 (spinSpeed): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 45 (MassCenterX): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 46 (MassCenterY): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 47 (MassCenterZ): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 50 (LinearDamping): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 51 (AngularDamping): TYPE_FLOAT, flag: 0x920020, value: -2147483648
  Param 49 (baked): TYPE_BOOL, flag: 0x820020, value: false
  Param 14 (): TYPE_INT, flag: 0x820020, value: 0
  Param 15 (): TYPE_BOOL, flag: 0x820020, value: false
  Param 16 (): TYPE_BOOL, flag: 0x820020, value: false
  Param 17 (): TYPE_BOOL, flag: 0x820020, value: false
  Param 13 (meshType): TYPE_INT, flag: 0x920020, value: 4
  Param 28 (meshCustomMesh): TYPE_INODE, flag: 0x810000, value: 0x0
  Param 26 (meshVerticesLimit): TYPE_INT, flag: 0x820020, value: 32
  Param 27 (meshInflation): TYPE_FLOAT, flag: 0x820020, value: 0
  Param 60 (meshConvexStyle): TYPE_INT, flag: 0x820020, value: 0
  Param 31 (meshRadius): TYPE_FLOAT, flag: 0x920020, value: -2147483648
  Param 32 (meshLength): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 33 (meshWidth): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 34 (meshHeight): TYPE_FLOAT, flag: 0x920020, value: 0
  Param 29 (): TYPE_BOOL, flag: 0x40800000, value: false
  Param 30 (): TYPE_BOOL, flag: 0x820020, value: false
  Param 18 (meshOverrideMaterial): TYPE_BOOL, flag: 0x820020, value: false
  Param 19 (meshDensity): TYPE_FLOAT, flag: 0x40800000, value: 0
  Param 20 (meshMass): TYPE_FLOAT, flag: 0x40800000, value: 0
  Param 21 (meshStaticFriction): TYPE_FLOAT, flag: 0x40800000, value: 0
  Param 22 (meshDynamicFriction): TYPE_FLOAT, flag: 0x40800000, value: 0
  Param 23 (meshBounciness): TYPE_FLOAT, flag: 0x40800000, value: 0
  Param 24 (): TYPE_BOOL, flag: 0x40800000, value: false
  Param 25 (): TYPE_BOOL, flag: 0x40800000, value: false

Animatable[2] : Transform, classID = (2005, 0)
	Animatable[0]: Position, classID = (118f7e02, ffee238a)
	Animatable[1]: Rotation, classID = (2012, 0)
Animatable[3] : Modified Object, classID = (3, 0)
	Animatable[0]: MassFX Rigid Body, classID = (a750e, 6e6ba)
		Animatable[0]: no name, classID = (2005, 0)
			Animatable[0]: Position, classID = (118f7e02, ffee238a)
			Animatable[1]: Rotation, classID = (2012, 0)
		Animatable[1]: no name, classID = (2005, 0)
			Animatable[0]: Position, classID = (118f7e02, ffee238a)
			Animatable[1]: Rotation, classID = (2012, 0)
		Animatable[2]: no name, classID = (118f7e02, ffee238a)
		Animatable[3]: no name, classID = (2005, 0)
			Animatable[0]: Position, classID = (118f7e02, ffee238a)
			Animatable[1]: Rotation, classID = (2012, 0)
	Animatable[1]: Teapot (Object), classID = (acad13d3, acad26d9)
		Animatable[0]: Parameters, classID = (8, 0)
0

   

<boolean>nvpx.SetAsDynamic <node>inode <boolean>onoff

Sets the node passed as first argument to Dynamic Rigid Body when the second argument is passed as true, or to Static Rigid Body if the second argument is false.

   

<integer>nvpx.PrintTM <node>inode

Prints detailed information about the various transformation matrices of the specified node.

EXAMPLE

nvpx.PrintTM $Teapot001
PivotTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [0.000000, 0.000000, 0.000000])
nodeTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [1.576996, -11.519989, 0.000000])
parentTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [0.000000, 0.000000, 0.000000])
objectTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [1.576996, -11.519989, 0.000000])
--pivot = [0.000000, 0.000000, 0.000000]
--nodeObjectTM <==> PhysicsNodeTM == PhysicsNodeScaleTM * PhysicsNodePivotTM * PhysicsNodePoseTM
PhysicsNodeScaleTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [0.000000, 0.000000, 0.000000])
PhysicsNodePivotTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [0.000000, 0.000000, 0.000000])
PhysicsPoseTM = (matrix3 [1.000000, 0.000000, 0.000000] [0.000000, 1.000000, 0.000000] [0.000000, 0.000000, 1.000000] [1.576996, -11.519989, 0.000000])
--Node Pos in Physics = [1.576996, -11.519989, 0.000000]

--Node is convex = 0
0
<class>nvpx.GetObjectClass <node>node

Returns the class of the specified node.

   

<void>nvpx.UpdateCCDCtrlState <node>node

Updates the Continuous Collision Detection control state of the specified node.

Available in 3ds Max 2013 and higher.

   

Rigid Body Copy And Paste

Methods:

<boolean>nvpx.CopyRigidbody <node>fromNode <node>toNode

Copies the Rigid Body Modifier from the node specified as first argument to the node specified as second argument. Returns true on success, false on failure.

   

<boolean>nvpx.ClipboardCopyRBMesh <node>inode <integer>meshIndex

Copies the Rigid Body Mesh with index specified by the second argument from the node specified by the first argument to the Clipboard. Returns true on success, false on failure.

<boolean>nvpx.ClipboardPasteRBMesh <node>inode

Pastes the Rigid Body Mesh from the Clipboard to the specified node. Returns true on success, false on failure.

   

Rigid Body Mesh Access

The following methods interact with the node's MassFX_RBody Modifier's settings. They can be used to iterate through nodes and modify their Rigid Body settings instead of operating on the modifier itself.

Methods:

<integer>nvpx.AddRBMesh <node>inode

Adds a Rigid Body Mesh to the specified node. Returns the index of the new mesh.

   

<boolean>nvpx.DeleteRBMesh <node>inode <integer>meshIndex

Deletes the Rigid Body Mesh specified by the second argument index from the node specified by the first argument. Returns true on success, false on failure.

   

<integer>nvpx.GetRBMeshCount <node>inode

Returns the number of Rigid Body Meshes in the specified node.

   

<string>nvpx.GetRBMeshName <node>inode <integer>meshIndex

Returns the name of the indexed Rigid Body Mesh in the specified node.

   

<integer>nvpx.SetRBMeshName <node>inode <integer>meshIndex <string>meshName

Renames the given node's Rigid Body Mesh specified by the second index argument to the name specified by the third argument.

   

<integer>nvpx.GetRBMeshType <node>inode <integer>meshIndex

Returns the type of the given node's Rigid Body Mesh specified by the second index argument. For the meaning of the return value, see the next method's description:

<boolean>nvpx.SetRBMeshType <node>inode <integer>meshIndex <integer>meshType

Sets the type of the given node's Rigid Body Mesh specified by the second index argument to the type as follows:

1 - Sphere

2 - Box

3 - Capsule

4 - Convex

5 - Composite

6 - Original

7 - Custom

Returns true on success, false on failure.

   

<&matrix3>nvpx.GetRBMeshTM <node>inode <integer>meshIndex

Returns the Transformation Matrix of the given node's Rigid Body Mesh with index specified by the second argument.

<boolean>nvpx.SetRBMeshTM <node>inode <integer>meshIndex <&matrix3>pose

pose is In and Out parameter

Sets the Transformation Matrix of the given node's Rigid Body Mesh with index specified by the second argument to the matrix3 value passed as third argument. Returns true on success, false on failure.

   

<float>nvpx.GetRBMeshRadius <node>inode <integer>meshIndex

Returns the radius of the node's indexed Rigid Body Mesh, if applicable (for example, Rigid Body Mesh Type is Sphere, Box or Capsule). Returns 0 otherwise.

<boolean>nvpx.SetRBMeshRadius <node>inode <integer>meshIndex <float>radius

Sets the radius of the node's indexed Rigid Body Mesh to the floating point value given by the third argument. Returns true if the Rigid Body Mesh Type supports a Radius value, false if it does not.

   

<float>nvpx.GetRBMeshLength <node>inode <integer>meshIndex

Returns the length of the node's indexed Rigid Body Mesh, if applicable (for example, Rigid Body Mesh Type is Box). Returns 0 otherwise.

<boolean>nvpx.SetRBMeshLength <node>inode <integer>meshIndex <float>Length

Sets the length of the node's indexed Rigid Body Mesh to the floating point value given by the third argument. Returns true if the Rigid Body Mesh Type is Box, false otherwise.

   

<float>nvpx.GetRBMeshWidth <node>inode <integer>meshIndex

Returns the width of the node's indexed Rigid Body Mesh, if applicable (for example, Rigid Body Mesh Type is Box). Returns 0 otherwise.

<boolean>nvpx.SetRBMeshWidth <node>inode <integer>meshIndex <float>Width

Sets the width of the node's indexed Rigid Body Mesh to the floating point value given by the third argument. Returns true if the Rigid Body Mesh Type is Box, false otherwise.

   

<float>nvpx.GetRBMeshHeight <node>inode <integer>meshIndex

Returns the height of the node's indexed Rigid Body Mesh, if applicable (for example, Rigid Body Mesh Type is Box). Returns 0 otherwise.

<boolean>nvpx.SetRBMeshHeight <node>inode <integer>meshIndex <float>Height

Sets the height of the node's indexed Rigid Body Mesh to the floating point value given by the third argument. Returns true if the Rigid Body Mesh Type is Box, false otherwise.

   

<node>nvpx.GetRBMeshCustomNode <node>inode <integer>meshIndex

Returns the Custom node of the given node's indexed Rigid Body Mesh, if applicable (for example, Rigid Body Mesh Type is set to Custom). Otherwise returns undefined .

<integer>nvpx.SetRBMeshCustomNode <node>inode <integer>meshIndex <node>CustomNode

Sets the custom mesh of the node's indexed Rigid Body Mesh to the node given by the third argument. Returns true if the Rigid Body Mesh Type is Custom, false otherwise.

   

<integer>nvpx.GetRBMeshVertexLimit <node>inode <integer>meshIndex

Returns the Vertex Limit value of the node's indexed Rigid Body Mesh.

<boolean>nvpx.SetRBMeshVertexLimit <node>inode <integer>meshIndex <integer>VerticeLimit

Sets the Vertex Limit of the node's indexed Rigid Body Mesh to the integer value specified by the third argument. Returns true if the Rigid Body Mesh Type supports Vertex Limts (for example, Convex), false otherwise.

   

<float>nvpx.GetRBMeshInflation <node>inode <integer>meshIndex

Returns the Inflation value of the node's indexed Rigid Body Mesh if its type is Convex, undefined otherwise.

<boolean>nvpx.SetRBMeshInflation <node>inode <integer>meshIndex <float>Inflation

Sets the Inflation value of the node's indexed Rigid Body Mesh to the float value specified by the third argument. Returns true if the Rigid Body Mesh Type supports Inflation (for example, Convex), false otherwise.

   

<mesh>nvpx.GetRBMeshShape <node>inode <integer>meshIndex

Returns the TriMesh value of the node's indexed Rigid Body Mesh if its type is Convex or Custom, undefined otherwise.

<boolean>nvpx.SetRBMeshShape <node>inode <integer>meshIndex <mesh>newMesh

Sets the shape of the node's indexed Rigid Body Mesh to the TriMesh value specified by the third argument. Returns true if the Rigid Body Mesh Type has a mesh (for example, Convex, Custom), false otherwise.

   

<boolean>nvpx.GetRBMeshOverrideMasterMat <node>inode <integer>meshIndex

Returns the state of the "Override Physical Material" option in the given node's Rigid Body Mesh.

<boolean>nvpx.SetRBMeshOverrideMasterMat <node>inode <integer>meshIndex <boolean>overrideIt

Sets the state of the "Override Physical Material" option in the given node's Rigid Body Mesh to the value provided by the third argument. Returns true on success, false on failure (for example, if the node does not have a Rigid Body Modifier or the meshIndex is invalid).

   

   

Node Physical Properties

Methods:

<&point3>nvpx.GetGlobalPosition <node>inode

Returns the Global Position value of the given node, or [0,0,0] if the value cannot be reported.

<integer>nvpx.SetGlobalPosition <node>inode <&point3>position

position is In and Out parameter

Sets the Global Position of the given node to the Point3 value passed by-reference as second argument. Returns 0 on success, -1 on failure.

   

<&point3>nvpx.GetLinearVelocity <node>inode

Returns the Linear Velocity value of the given node, or [0,0,0] if the value cannot be acquired.

<integer>nvpx.SetLinearVelocity <node>inode <&point3>linearvelocity

linearvelocity is In and Out parameter

Sets the Linear Velocity of the given node to the Point3 value passed by-reference as second argument. Returns 0 on success, -1 on failure.

   

 <&point3>nvpx.GetAngularVelocity <node>inode

Returns the Angular Velocity value of the given node, or [0,0,0] if the value cannot be acquired.

<integer>nvpx.SetAngularVelocity <node>inode <&point3>angularvelocity

angularvelocity is In and Out parameter

Sets the Linear Velocity of the given node to the Point3 value passed by-reference as second argument. Returns 0 on success, -1 on failure.

   

<&matrix3>nvpx.GetGlobalPose <node>inode

Returns the Global Pose value of the specified node, or the identity matrix if the value cannot be reported.

 <integer>nvpx.SetGlobalPose <node>inode <&matrix3>pose

pose is In and Out parameter

Sets the Global Pose of the given node to the matrix3 value passed by-reference as second argument. Returns 0 on success, -1 on failure.

   

<float>nvpx.GetMass<node>inode

Returns the Mass value of the given node, or 0.0 if the value cannot be acquired.

<float>nvpx.SetMass <node>inode <float>value

Sets the Mass of the given node to the Float value passed as second argument. Returns the new mass, or 0.0 if the setting failed.

   

<float>nvpx.GetDynamicFriction <node>inode

Returns the Dynamic Friction value of the given node, or 0.0 if the value cannot be acquired.

<integer>nvpx.SetDynamicFriction <node>inode <float>value

Sets the Dynamic Friction of the given node to the Float value passed as second argument. Returns 0 on success, -1 on failure.

   

<float>nvpx.GetStaticFriction <node>inode

Returns the Static Friction value of the given node, or 0.0 if the value cannot be acquired.

<integer>nvpx.SetStaticFriction <node>inode <float>value

Sets the Static Friction of the given node to the Float value passed as second argument. Returns 0 on success, -1 on failure.

   

<float>nvpx.GetRestitution <node>inode

Returns the Restitution value of the given node, or 0.0 if the value cannot be acquired.

<integer>nvpx.SetRestitution <node>inode <float>value

Sets the Restitution of the given node to the Float value passed as second argument. Returns 0 on success, -1 on failure.

   

<matrix3 by value>nvpx.GetInitialPose <node>inode

Returns the Initial Pose Transformation Matrix of the specified node.

Available in 3ds Max 2013 and higher.

<void>nvpx.SetInitialPose <node>inode <&matrix3>initialPose 

initialPose is In and Out parameter

Sets the Initial Pose Transformation Matrix of the specified node to the by-reference matrix3 value.

Available in 3ds Max 2013 and higher.

   

<boolean>nvpx.CaptureInitTransforms <&node array>nodes 

nodes is In and Out parameter

Captures the Initial Transforms of the nodes specified by the by-reference array argument. Returns True on success, False on failure.

Available in 3ds Max 2013 and higher.

   

<boolean>nvpx.GetBakedFlag <node>inode

Returns the Baked Flag of the specified node - True if the node is baked, False if it is not.

Available in 3ds Max 2013 and higher.

<boolean>nvpx.SetBakedFlag <node>inode <boolean>isBaked

Sets the Baked Flag of the specified node to the second boolean argument. Returns True on success, False if the flag could not be set.

Available in 3ds Max 2013 and higher.

   

Physical Material Loading and Saving

Methods:

<boolean>nvpx.SaveMaterial <string>filename <float>staticFriction <float>dynamicFriction <float>bounciness <integer>density

Saves a Physical Material XML file to the file name specified by the first argument. The second, third, fourth, and fifth arguments specify the Static Friction, the Dynamic Friction, the Bounciness and the Density values of the Physical Material. Returns true on success, false on failure.

   

<float>nvpx.LoadMaterialStaticFric <string>filename

Loads the Static Friction value from the specified Physical Material XML file and returns it as a Float.

   

<float>nvpx.LoadMaterialDynFric <string>filename

Loads the Dynamic Friction value from the specified Physical Material XML file and returns it as a Float.

   

<float>nvpx.LoadMaterialBounciness <string>filename

Loads the Bounciness value from the specified Physical Material XML file and returns it as a Float.

   

<integer>nvpx.LoadMaterialDensity <string>filename

Loads the Bounciness value from the specified Physical Material XML file and returns it as a Float.

   

Physical Material Access

Methods:

<integer>nvpx.MaterialGetCount()

Returns the number of Physical Materials in the scene.

   

<integer>nvpx.MaterialGetId <integer>matIndex

Given the zero-based material index (material 1 has index 0, material 2 has index 1, and so on), returns the integer ID of the material, or 0 if the index is out of range.

   

<integer>nvpx.MaterialGetType <integer>matId

Given the material ID returned by the nvpx.MaterialGetId() method, returns the type of the material.

   

<boolean>nvpx.MaterialIsLocked <integer>matId

   

<integer>nvpx.MaterialFind <string>ParamName

   

<integer>nvpx.MaterialCreate <integer>type

Creates a new unnamed Physical Material Preset of the given type. Returns the material ID as an Integer.

   

<boolean>nvpx.MaterialRemove <integer>matId

Removes the Physical Material Preset with the given ID. Returns true on success, false on failure.

   

<string>nvpx.MaterialGetParam <integer>matId <string>ParamName

Returns the parameter of the Physical Material with the specified ID as a string.

The second argument is the Parameter Name which can be one of the following:

<boolean>nvpx.MaterialSetParam <integer>matId <string>ParamName <string>ParamValue

Sets the parameter of the Physical Material specified by the first argument with the name specified by the second argument to the string value provided by the third argument.

Returns true on success, false on failure, for example, if the parameter name is not supported.

   

<integer>nvpx.GetPMVisibleForRigidBodies()

Returns 1 if the Physical Material is visible for Rigid Bodies, 0 if it is not.

<void>nvpx.SetPMVisibleForRigidBodies <integer>visible

Sets the Physical Material Visibility for Rigid Bodies to the integer argument - 1 for visible, 0 for invisible.

   

<boolean>nvpx.SetRBDisplayMaterial <material>dynamicMat <material>kinematicMat <material>staticMat

Sets three 3ds Max materials to use for display of Dynamic, Kinematic and Static Rigid Body objects. Returns true on success, false on failure.

   

Bounding Geometry Creation

The following methods operate on any scene node and do not require the node to be a Rigid Body mesh or even a Geometry object.

Methods:

<node>nvpx.CreateBoundingBox <node>inode

Creates an nv_Box geometry primitive matching the object-aligned bounding box of the specified node.

   

<node>nvpx.CreateBoundingSphere <node>inode

Creates an nv_Sphere geometry primitive aligned to the specified node and representing the bounding sphere of the node's bounding box.

   

<node>nvpx.CreateBoundingCapsule <node>inode

Creates an nv_Capsule geometry primitive enclosing the node's bounding box.

   

<node>nvpx.CreateBoundingCapsuleFromPoints <matrix3>poseTransform <&float array>points

points is In and Out parameter

Creates an nv_Capsule geometry primitive based on a pose transformation matrix and an array of points to be included inside the capsule.

   

<node>nvpx.CreateBoundingShapeConvex <node>inode <integer>vertLimit <float>inflation <int>style

Creates an Editable Mesh node enclosing the specified node. The second argument limits the number of vertices in the resulting mesh. The third argument defines the inflation that applies an offset from the bounding surface. The fourth argument specifies the algorithm used to generate the convex hull:

   

<mesh>nvpx.CreateBoundingConvex <node>inode <integer>vertLimit <float>inflation

Returns a TriMesh value representing the convex bounding shape of the specified node. The second argument limits the number of vertices in the resulting mesh. The third argument defines the inflation that applies an offset from the bounding surface. This method is similar to nvpx.CreateBoundingShapeConvex() , but produces the mesh in memory instead of creating a scene node.

   

<mesh>nvpx.CreateBoundingConvexFromNodes <&node array>inodes <integer>vertLimit <float>inflation

inodes is In and Out parameter

Returns a TriMesh value representing the convex bounding shape of all specified nodes. The second argument limits the number of vertices in the resulting mesh. The third argument defines the inflation that applies an offset from the bounding surface. This method is similar to nvpx.CreateBoundingConvex() , but operates on multiple nodes at once.

   

<mesh>nvpx.CreateConvexHull <mesh>mesh <integer>vertlimit <float>inflation

Returns a TriMesh value representing the convex bounding shape of the specified TriMesh value. The second argument limits the number of vertices in the resulting mesh. The third argument defines the inflation that applies an offset from the bounding surface. This method is similar to nvpx.CreateBoundingConvex() , but operates on a TriMesh value in memory instead of a scene node.

   

<mesh>nvpx.CreateConvexFromPoints <&float array>points <integer>vertlimit <float>inflation

points is In and Out parameter

Returns a TriMesh value representing the convex bounding shape enclosing the points specified in the array of floats. The array's number of elements must be 3 times the number of spatial point3 values with three consecutive floats used as the X, Y, and Z components of a single Point3 value.

The second argument limits the number of vertices in the resulting mesh. The third argument defines the inflation that applies an offset from the bounding surface.

This method is similar to nvpx.CreateBoundingConvex() , but operates on user-defined points instead of geometry vertices.

   

Sleeping Actors

Methods:

<boolean>nvpx.SetSleepState <node>inode <boolean>onoff

Set the sleep state of the specified node to the boolean value provided by the second argument.

   

<integer>nvpx.FindSleepingActors()

Returns the number of sleeping actors in the scene.

   

<node>nvpx.GetSleepingActor <integer>index

Returns the sleeping node corresponding to the 0-based index argument that should range between 0 and (nvpx.FindSleepingActors())-1 .

Returns undefined if the index is out of range.

   

Get/Set Parameters

Methods:

<string>nvpx.GetRBParam <node>inode <string>paramName

Returns the string value of the given Rigid Body's parameter with the specified name.

<boolean>nvpx.SetRBParam <node>inode <string>paramName <string>paramValue

Sets the value of the given Rigid Body's parameter with the specified name to the string value supplied as third argument.

   

<boolean>nvpx.GetRBShapeParam <node>inodeRB <node>inodeShape <string>paramName

Returns the boolean value of the named parameter in the given Rigid Body and Shape nodes.

<boolean>nvpx.SetRBShapeParam <node>inodeRB <node>inodeShape <string>paramName <string>paramValue

Sets the string value of the named parameter in the given Rigid Body and Shape nodes to the string value passed as fourth argument.

   

<boolean>nvpx.GetConstraintParam <node>inode <string>paramName

Returns the value of the specified node's Constraint property. The second argument is the property name.

<boolean>nvpx.SetConstraintParam <node>inode <string>paramName <string>paramValue

Sets the value of the named property of the specified node's Constraint. The third argument is the property name. Returns true on success, false on failure.

   

<float>nvpx.GetSDKParameter <TSTR byvalue>paramName

Returns the value of the SDK parameter with the given name.

For a list of supported SDK parameter names, export a scene to an XML file and browse the content of the file for <NxParameterDesc param="ABC"> tags, where "ABC" is the parameter name.

If the parameter name is unsupported, the return value will be -3.40282e+038 (which is the smallest floating point number).

<integer>nvpx.SetSDKParameter <TSTR byvalue>paramName <float>value

Sets the SDK parameter with the given name to the value specified by the second argument. See previous method for details.

<integer>nvpx.SetSDKDefaultParameter <TSTRby value>paramName

Sets the SDK parameter with the given name to its default value.

   

Contacts Report

A Contact Report provides information about collisions recorded during the physical simulation including force, location, and participating nodes. The contacts can be filtered using a force magnitude threshold to exclude lighter collisions.

Methods:

<boolean>nvpx.SetUseContactReport <boolean>OnOff

Sets the enabled state of Contact reporting to true or false.

   

<integer>nvpx.GetContactsCount()

Returns the number of recorded contacts.

   

<boolean>nvpx.SelectFirstContact()

Selects the first contact.

Returns True on success, False on failure.

Available in 3ds Max 2013 and higher.

   

<boolean>nvpx.GetNextContact()

Sets the internal pointer at the next contact, affecting the following methods for getting the contact Force, Point, and Nodes.

   

<point3 byvalue>nvpx.GetContactForce index:<index>

index default value: 0

Returns the Contact Force of the indexed Contact Record as a Point3 value.

When the index is 0 or not specified, the current Contact Record is used.

New index: optional keyword added in 3ds Max 2013. In 3ds Max 2012, the method returned the current contact only.

   

<point3 byvalue>nvpx.GetContactPoint index:<index>

index default value: 0

Returns the Contact Point of the indexed Contact Record as a Point3 value.

When the index is 0 or not specified, the current Contact Record is used.

New index: optional keyword added in 3ds Max 2013. In 3ds Max 2012, the method returned the current contact only.

   

<node>nvpx.GetContactNode0 index:<index>

index default value: 0

Returns the first node of the indexed Contact Record.

When the index is 0 or not specified, the current Contact Record is used.

New index: optional keyword added in 3ds Max 2013. In 3ds Max 2012, the method returned the current contact only.

   

<node>nvpx.GetContactNode1 index:<index>

index default value: 0

Returns the second node of the indexed Contact Record.

When the index is 0 or not specified, the current Contact Record is used.

New index: optional keyword added in 3ds Max 2013. In 3ds Max 2012, the method returned the current contact only.

   

<float>nvpx.GetContactFilter()

Returns the current Contract Filter value.

Contacts with a Force of vector length (magnitude) less than this value will not be recorded.

<float>nvpx.SetContactFilter <float>force

Sets the contact filter to a floating point threshold value.

Contacts with a Force with vector length less than this value will not be recorded.

   

Skin Access

The following methods provide access to 3ds Max Skin data.

Methods:

<boolean>nvpx.ParseSkinInfo <node>inode <float>weightThreshold

Collects Skin Info from the specified node using the second argument as weight threshold. No data will be collected about vertices with weight below the threshold value. Returns true on success, false on failure (for example, the node is not a Skinned object).

   

<integer>nvpx.GetVerticesCountFromSkinnedBone <node>inode

Returns the number of vertices affected by the specified bone as collected by the nvpx.ParseSkinInfo() method.

   

<float by value array>nvpx.GetVerticesFromSkinnedBone <node>inode

Returns an array of floats representing the X, Y, and Z components of the vertices affected by the specified bone. The coordinates are in the Bone's local space - to produce world space positions, the Point3 value created from three Float values from the array must be multiplied by the Bone's transformation matrix.

   

<boolean>nvpx.ReleaseSkinInfo()

Clears the Skin Info data collected by the nvpx.ParseSkinInfo() .

   

Bone Methods

Methods:

<boolean>nvpx.HaveBoneFloatLimitControl <node>inode <string>block

Returns true if the Bone has a Float Limit Control.

   

<string>nvpx.GetBoneFloatLimitValue <node>inode <string>block <string>param

Returns the Bone Float Limit value.

   

<boolean>nvpx.IsBone <node>inode

Returns true if the specified node is a bone, false if it is not.

   

<matrix3 by value>nvpx.GetBonePose <node>inode

Returns the pose transformation matrix of the specified bone.

   

Ragdoll Access

Methods:

<node>nvpx.RagdollGetRootBone <node>inode

Returns the Root Bone of the specified Ragdoll.

   

<boolean>nvpx.IsRagdollNode <node>inode

Returns true if the specified node is a Ragdoll Node.

   

<boolean>nvpx.LoadRagdollHelperMesh <meshby value>mesh

Loads a Ragdoll Helper Mesh value. Returns true on success, false on failure.

   

<node>nvpx.CreateRagdollHelper()

Creates a Ragdoll Helper.

   

<void>nvpx.RagdollRegenerate <node>ragdoll <&node array>bones 

bones is In and Out parameter

Regenerates the specified Ragodoll node using the array of bone nodes provided by the second argument.

   

<void>nvpx.RagdollAddBone <node>ragdoll <node>boneNode

Adds the bone node given by the second argument to the Ragdoll node specified by the first argument.

   

<void>nvpx.RagdollRemoveBone <node>ragdoll <node>boneNode

Removes the bone node specified by the second argument from the Ragodll specified by the first argument.

   

<boolean>nvpx.RagdollGroupBones <node>ragdoll <&node array>bones 

bones is In and Out parameter

Specifies the Ragdoll bones of the Ragdoll given by the first argument using the by-reference array passed as second argument. Returns true on success, false on failure.

   

<boolean>nvpx.RagdollSave <node>ragdoll <string>filename

Saves the Ragdoll specified by the first argument to the file name given by the second argument. Returns true on success, false on failure.

   

<boolean>nvpx.RagdollLoad <node>ragdoll <string>filename

Loads the Ragdoll specified by the first argument from the file name given by the second argument. Returns true on success, false on failure.

   

Biped Intergration

Methods:

<boolean>nvpx.IsBiped <node>inode

Returns true if the specified node is a Biped node, false otherwise.

   

<boolean>nvpx.IsBipedRoot <node>inode

Returns true if the specified node is a Biped Root node, false otherwise.

   

<boolean>nvpx.IsBipedFootsteps <node>inode

Returns true if the specified node is a Biped Footsteps node, false otherwise.

   

<void>nvpx.BipedSetKeys <boolean>setKeys

Sets keys for the selected Biped if the argument is true.

   

Physique Integration

Methods:

<boolean>nvpx.PhysiqueLoad <node>inode

Loads the Physique data of the specified node.

   

<integer>nvpx.PhysiqueGetNumBones <node>inode

Returns the number of bones associated with the Physique modifier of the specified node.

   

<node>nvpx.PhysiqueGetBone <node>inode <integer>boneIndex

Returns the indexed bone node from the specified node.

   

<integer>nvpx.PhysiqueGetNumBoneVertices <node>inode <node>boneNode

Returns the number of vertices in the node specified by the first argument influenced by the bone provided by the second argument.

   

<point3 by value>nvpx.PhysiqueGetBoneVertex <node>inode <node>boneNode <integer>verticeIndex

Returns the position of the indexed vertex in the node specified by the first argument influenced by the bone given by second argument.

   

Utility Functions

Methods:

<boolean>nvpx.IsConvex <node>inode

Returns true if the specified node is convex, false if it is concave, or not a geometry object.

   

<float>nvpx.CalcVolume <node>inode

Returns the Volume of the specified node in generic cubic units.

   

Indirect Drag Methods

Methods:

<boolean>nvpx.StartIndirectDrag <node>attach

Starts Indirect Drag by attaching the specified node to the mouse while simulation is running. Returns true on success, false if simulation is not running.

   

<boolean>nvpx.OnIndirectDrag <&point3>mousepos

mousepos is In and Out parameter

If Indirect Drag is enabled, returns true and stores the mouse position in the by-reference argument. Otherwise returns false .

   

<boolean>nvpx.EndIndirectDrag()

Ends the Indirect Drag. Returns true on success, false otherwise.

   

Visualizer Methods

Methods:

<boolean>nvpx.VisualizerGetEnabled()

Returns the Enabled state of the Visualizer.

<void>nvpx.VisualizerSetEnabled <boolean>flag

Sets the Enabled state of the Visualizer.

   

<float>nvpx.VisualizerGetScale()

Returns the Scale value of the Visualizer. Default is 1.0.

<float>nvpx.VisualizerSetScale <float>newScale

Sets the Scale of the Visualizer to the given floating point value.

   

<integer>nvpx.VisualizerGetPhysXParamCount()

Returns the number of PhysX Parameters supported by the Visualizer.

   

<string>nvpx.VisualizerGetPhysXParamName <integer>index

Returns the name of the i-th parameter. The index is 1-based.

   

<integer>nvpx.VisualizerGetPhysXParam <string>paramName

Returns the value of the specified Visualizer parameter. Boolean values are represented as integers where 0 is false and 1 is true.

<boolean>nvpx.VisualizerSetPhysXParam <string>paramName <boolean>flag

Sets the Visualizer Parameter with the name given by the first argument to the boolean value supplied by the second argument. Returns true on success, false if the parameter name was not recognized. For a list of valid parameter names, see the example below:

EXAMPLE:

for i = 1 to nvpx.VisualizerGetPhysXParamCount() do
(
  local theName= (nvpx.VisualizerGetPhysXParamName i)
  format "%: \"%\" = %\n" i theName (nvpx.VisualizerGetPhysXParam theName)
)

OUTPUT:

1: "Body Axis" = 0
2: "Body Mass Axes" = 0
3: "Body Linear Velocity" = 0
4: "Body Angular Velocity" = 0
5: "Joint Local Axes" = 0
6: "Joint World Axes" = 0
7: "Joint Limits" = 0
8: "Contact Point" = 0
9: "Contact Normal" = 0
10: "Contact Error" = 0
11: "Contact Force" = 1
12: "Actor Axes" = 0
13: "Collision AABBS" = 0
14: "Collision Shapes" = 0
15: "Collision Axes" = 0
16: "Collision Compounds" = 0
17: "Collision VNormals" = 0
18: "Collision FNormals" = 0
19: "Collision Edges" = 0
20: "Collision Spheres" = 0
21: "Collision Static" = 0
22: "Collision Free" = 0
23: "Collision CCD" = 0
24: "Collision Skeletons" = 0
OK

   

PhysX System

Methods:

<integer>nvpx.GetPhysXSDKVersion()

Returns the PhysX SDK Version as Integer.

   

<string>nvpx.GetPhysXSDKVersionString()

Returns the PhysX SDK Version as String.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXSDKVersionMajor()

Returns the PhysX SDK Major Version as Integer.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXSDKVersionMinor()

Returns the PhysX SDK Minor Version as Integer.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXSDKVersionBugFix()

Returns the PhysX SDK Bug Fix Version as Integer.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.GetApexSDKVersion()

Returns the Apex SDK Version as Integer.

   

<integer>nvpx.GetPhysXPluginCount()

Returns the number of installed PhysX Plugins.

   

<integer>nvpx.GetPhysXPluginVersion <integer>Index

Returns the version number of the indexed PhysX Plugin.

If the index is less than 1 or higher than the value returned by nvpx.GetPhysXPluginCount() , the return value will be 0.

   

<string>nvpx.GetPhysXPluginVersionString <integer>Index

Returns the Version of the indexed PhysX Plugin as String.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXPluginVersionMajor <integer>Index

Returns the Major Version of the indexed PhysX Plugin as Integer.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXPluginVersionMinor <integer>Index

Returns the Minor Version of the indexed PhysX Plugin as Integer.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetPhysXPluginVersionBugFix <integer>Index

Returns the Bug Fix Version of the indexed PhysX Plugin as Integer.

Available in 3ds Max 2013 and higher.

   

<bool>nvpx.IsAutodeskVersion()

Returns True if the PhysX plugin is the Autodesk MassFX version, False if it is an NVidia or 3rd party build.

Available in 3ds Max 2013 and higher.

   

<string>nvpx.GetPluginCompanyName()

Returns the company-specific plugin name.

In the case of the Autodesk build, returns "MassFX".

Available in 3ds Max 2013 and higher.

   

<string>nvpx.GetScriptPath()

Returns the path to the MassFX related scripts.

Available in 3ds Max 2013 and higher.

EXAMPLE:

nvpx.GetScriptPath()

OUTPUT:

"stdplugs\stdscripts\(MassFX)\"

   

<integer>nvpx.InitializePhysX <value>stream

Initializes the PhysX system.

   

<void>nvpx.BeforeAddPhysXActors()

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.CreateToolbar()

Creates the MassFX Simulation Toolbar.

   

<void>nvpx.ShowToolbar <boolean>show

When the boolean argument is passed as true , shows the MassFX Simulation Toolbar.

When the boolean argument is passed as false , hides the MassFX Simulation Toolbar.

   

<void>nvpx.ShowMaterialEditor <boolean>show

This method was available in 3ds Max 2012, but has been removed from 3ds Max 2013.

   

<boolean>nvpx.ShowValidateScene <boolean>automated

Shows the Validate Scene dialog.

When the boolean argument is true , the tests will also be performed automatically.

When the boolean argument is false , the tests will not be performed and will require the manual pressing of the "Validate" button.

   

<boolean>nvpx.HwAvailable()

Returns true if PhysX acceleration hardware is available, false otherwise.

   

<integer>nvpx.GetScreenHeight()

Returns the screen height in pixels.

   

<float>nvpx.GetSimulationFPS()

Returns the simulation frame rate as a floating number of frames per second.

   

<boolean>nvpx.PrintSimulationFPS <boolean>onoff

When the boolean argument is passed as true , turns on the automatic simulation frame rate printing to the MAXScript Listener.

When the argument is false , the frame rate printing will be turned off.

   

<boolean>nvpx.UsePhysXPlugin <integer>Index

Switches to the indexed PhysX plugin.

Returns true on success, false on failure (for example, plugin index out of range).

Additionally, prints a message to the MAXScript Listener "Switch PhysX SDK to XXX", where XXX is the SDK version returned by nvpx.GetPhysXPluginCount() .

   

<void>nvpx.DetachPhysX()

Detaches the PhysX plugin.

   

<void>nvpx.AttachPhysX()

Attaches the PhysX plugin.

   

<void>nvpx.DestroyPhysX()

Destroys the PhysX plugin.

   

<void>nvpx.OpenHelpFile()

Opens the MassFX Help File, if available.

   

<boolean>nvpx.IsApexAvailable()

Returns true if the APEX Cloth Simulation is available in the current plugin, false otherwise.

   

<integer>nvpx.DebugPrint()

Prints a debug text to the MAXScript Listener, containing information about the current state of the PhysX Engine and the simulation objects in the scene.

EXAMPLE

nvpx.DebugPrint()
-->
PhysX SDK version: 34079744, HW version: 0
   Number of PPUs: 0
   Number of Triangle meshes: 0
   Number of HeightFields: 0
   Number of Cloth meshes: 0
   Number of SoftBody meshes: 0
   Number of CCD skeletons: 0
   Number of Scenes: 1
   Scene object: 1013386992
      Number of NxActors: 0
Our Scene object: 1013386992
Cooking interface object: 970914512, initialized: true
---------------------------------------------------
0

   

<void>nvpx.DescribeMe()

Prints a list of all methods implemented by the nvpx Interface. Similar to calling showInterface nvpx .

   

<void>nvpx.PhysXPanelTooltip()

   

<boolean>nvpx.ConnectPVD <string>hostName

   

<void>nvpx.SetButtonCheck <integer>id <boolean>value

   

<boolean>nvpx.SetNullCM()

Enters the PhysX Drag Mode.

   

<boolean>nvpx.RemoveNullCM()

Exits the PhysX Drag Mode.

   

<void>nvpx.SetAnimationState <boolean>state

Sets the animation state to the specified Boolean value.

Available in 3ds Max 2013 and higher.

<boolean>nvpx.GetAnimationState()

Returns the animation state as Boolean value.

Available in 3ds Max 2013 and higher.

   

<string>nvpx.GetPluginBuild()

Returns the plugin build string.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.ShowAboutDialog()

Opens the MassFX About Dialog.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.GetBehaviorReason()

Returns an integer representing the Behavior Reason mode.

Available in 3ds Max 2013 and higher.

<boolean>nvpx.SetBehaviorReason <integer>mode

Sets the Behavior Reason to the specified integer mode. Returns True on success, False on failure.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.GetVirtualScreenX()

Returns the Virtual Screen's X size.

Available in 3ds Max 2013 and higher.

<integer>nvpx.GetVirtualScreenY()

Returns the Virtual Screen's Y size.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.DumpContentCore <string>file <integer>Type

Creates an XML file with the specified file name containing all core settings.

The second argument controls the content type - 0 outputs only the objects definitions, 1 or any non-zero argument also includes all type definitions.

Available in 3ds Max 2013 and higher.

EXAMPLE

nvpx.DumpContentCore @"c:\temp\DumpContentCore.txt" 0

FILE CONTENT

<?xml version="1.0" encoding="utf-16"?><?xml-stylesheet type="text/xsl" href="cc.xslt"?>
<contentcore>
	<objects>
		<object name="0x29953550" type="ICCPhysX" links="0" address="0x29953550" >
			<field name="ContactShellDepth">
				0.0393701
			</field>
			<field name="ContactShellOffset">
				0.0393701
			</field>
			<field name="ContactShellInvert">
				0
			</field>
			<field name="BounceMinimumVelocity">
				0
			</field>
			<field name="EnableCCD">
				0
			</field>
			<field name="CcdEpsilon">
				0
			</field>
			<field name="ContinuousCD">
				3241.57
			</field>
			<field name="UseGravity">
				1
			</field>
			<field name="Gravity">
				{0,0,-386.221}
			</field>
			<field name="UseAdaptiveForce">
				1
			</field>
			<field name="EnableContactReport">
				0
			</field>
			<field name="IsApexDLLPresent">
				1
			</field>
			<field name="IsApexLoaded">
				0
			</field>
			<field name="PhysXSDKVersion">
				285
			</field>
			<field name="PhysXSDKVersionMajor">
				2
			</field>
			<field name="PhysXSDKVersionMinor">
				8
			</field>
			<field name="PhysXSDKVersionBugFix">
				5
			</field>
			<field name="ApexSDKVersion">
				102
			</field>
			<field name="DensityFactor">
				0.016387
			</field>
			<field name="SolverIterations">
				30
			</field>
			<field name="FPS">
				0
			</field>
			<field name="IsHwAvailable">
				1
			</field>
			<field name="SupportMultiThread">
				1
			</field>
			<field name="UseMultiThread">
				0
			</field>
			<field name="CCDMotionThreshold">
				5
			</field>
			<field name="SupportHardwareScene">
				1
			</field>
			<field name="UseHardwareScene">
				0
			</field>
			<field name="UseGroundPlane">
				74
			</field>
			<field name="FOV">
				0.785398
			</field>
			<field name="FocalDistance">
				250
			</field>
			<field name="ViewDirection">
				{-0.612372,-0.612372,0.5}
			</field>
			<field name="ViewPoint">
				{-153.093,-153.093,125}
			</field>
			<field name="ViewUpDirection">
				{0.353553,0.353553,0.866025}
			</field>
			<field name="ViewportWidth">
				842
			</field>
			<field name="ViewportHeight">
				484
			</field>
			<field name="OrthoWidth">
				1
			</field>
			<field name="OrthoHeight">
				1
			</field>
			<field name="MinZ">
				0.1
			</field>
			<field name="MaxZ">
				4000
			</field>
			<field name="IsPerspective">
				1
			</field>
			<field name="GenerateShapePerElement">
				1
			</field>
			<field name="SleepEnergyMassInvariant">
				1.9685
			</field>
		</object>
		<object name="0x49d18c30" type="ICCScene" links="0" address="0x49d18c30" >
			<field name="AnimationFPS">
				60
			</field>
			<field name="AnimationStartFrame">
				0
			</field>
			<field name="AnimationEndFrame">
				0
			</field>
			<field name="RootNode">
				0x00000000297B81A0
			</field>
			<field name="WorldBounds">
				<class type="ccBounds3"></class>
			</field>
			<field name="SubSteps">
				3
			</field>
			<field name="SubSubSteps">
				0
			</field>
			<field name="DistanceUnit">
				5
			</field>
		</object>
		<object name="0x49d18d00" type="ICCContactManager" links="0" address="0x49d18d00" >
			<field name="IsEnabled">
				1
			</field>
			<field name="Layers">
				{{[0x0000000048904020]=0x0000000048904020}{[0x00000000489042E0]=0x00000000489042E0}{[0x0000000048904440]=0x0000000048904440}{[0x00000000489045A0]=0x00000000489045A0}{[0x0000000048904700]=0x0000000048904700}}
			</field>
		</object>
		<object name="0x48904020" type="ICCContactLayer" links="0" address="0x48904020" >
			<field name="ContactSelf">
				1
			</field>
			<field name="LayersInteractWith">
				{empty}
			</field>
			<field name="AgentsJoinedFull">
				{empty}
			</field>
			<field name="AgentsJoinedPartial">
				{empty}
			</field>
		</object>
		<object name="0x489042e0" type="ICCContactLayer" links="0" address="0x489042e0" >
			<field name="ContactSelf">
				0
			</field>
			<field name="LayersInteractWith">
				{empty}
			</field>
			<field name="AgentsJoinedFull">
				{empty}
			</field>
			<field name="AgentsJoinedPartial">
				{empty}
			</field>
		</object>
		<object name="0x489045a0" type="ICCContactLayer" links="0" address="0x489045a0" >
			<field name="ContactSelf">
				1
			</field>
			<field name="LayersInteractWith">
				{{[0x0000000048904020]=0x0000000048904020}}
			</field>
			<field name="AgentsJoinedFull">
				{empty}
			</field>
			<field name="AgentsJoinedPartial">
				{empty}
			</field>
		</object>
		<object name="0x48904440" type="ICCContactLayer" links="0" address="0x48904440" >
			<field name="ContactSelf">
				0
			</field>
			<field name="LayersInteractWith">
				{empty}
			</field>
			<field name="AgentsJoinedFull">
				{empty}
			</field>
			<field name="AgentsJoinedPartial">
				{empty}
			</field>
		</object>
		<object name="0x48904700" type="ICCContactLayer" links="0" address="0x48904700" >
			<field name="ContactSelf">
				1
			</field>
			<field name="LayersInteractWith">
				{empty}
			</field>
			<field name="AgentsJoinedFull">
				{empty}
			</field>
			<field name="AgentsJoinedPartial">
				{empty}
			</field>
		</object>
		<object name="0x297b81a0" type="ICCNode" links="0" address="0x297b81a0" >
			<field name="WorldMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="OffsetMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="PivotMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="PivotInverseMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="Scene">
				0x0000000049D18C30
			</field>
			<field name="ChildActor">
				0x0000000000000000
			</field>
			<field name="ChildGeometry">
				0x0000000000000000
			</field>
			<field name="ChildConvexes">
				{empty}
			</field>
			<field name="IsBone">
				0
			</field>
			<field name="Children">
				{empty}
			</field>
			<field name="Parent">
				0x0000000000000000
			</field>
			<field name="NodeName">
				{Scene Root}
			</field>
			<field name="NodeType">
				0
			</field>
			<field name="PartIndex">
				917
			</field>
			<field name="DCCHandle">
				924
			</field>
		</object>
		<object name="0x49d193f0" type="ICCScene" links="0" address="0x49d193f0" >
			<field name="AnimationFPS">
				30
			</field>
			<field name="AnimationStartFrame">
				0
			</field>
			<field name="AnimationEndFrame">
				100
			</field>
			<field name="RootNode">
				0x00000000297B8640
			</field>
			<field name="WorldBounds">
				<class type="ccBounds3"></class>
			</field>
			<field name="SubSteps">
				3
			</field>
			<field name="SubSubSteps">
				0
			</field>
			<field name="DistanceUnit">
				5
			</field>
		</object>
		<object name="0x49d194c0" type="ICCContactManager" links="0" address="0x49d194c0" >
			<field name="IsEnabled">
				0
			</field>
			<field name="Layers">
				{empty}
			</field>
		</object>
		<object name="0x297b8640" type="ICCNode" links="0" address="0x297b8640" >
			<field name="WorldMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="OffsetMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="PivotMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="PivotInverseMatrix">
				{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
			</field>
			<field name="Scene">
				0x0000000049D193F0
			</field>
			<field name="ChildActor">
				0x0000000000000000
			</field>
			<field name="ChildGeometry">
				0x0000000000000000
			</field>
			<field name="ChildConvexes">
				{empty}
			</field>
			<field name="IsBone">
				0
			</field>
			<field name="Children">
				{empty}
			</field>
			<field name="Parent">
				0x0000000000000000
			</field>
			<field name="NodeName">
				{Scene Root}
			</field>
			<field name="NodeType">
				0
			</field>
			<field name="PartIndex">
				0
			</field>
			<field name="DCCHandle">
				0
			</field>
		</object>
	</objects>
</contentcore>

   

<void>nvpx.SwitchSDKOnPanelData()

For internal use.

Available in 3ds Max 2013 and higher.

   

Viewer

<void>nvpx.CreateViewer()

Creates a Viewer.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.PreCreateViewer()

Call before creating the Viewer.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.PostCreateViewer()

Call after creating the Viewer.

Available in 3ds Max 2013 and higher.

   

<boolean>nvpx.ShouldViewerSync()

Returns the Viewer sync state. Default is False.

Available in 3ds Max 2013 and higher.

   

<integer>nvpx.GetViewerCommand()

Returns the Viewer command.

Available in 3ds Max 2013 and higher.

<integer>nvpx.SetViewerCommand <integer>command

Sets the Viewer's command.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.CheckViewerState()

Updates the Viewer state.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.UpdateViewerPlayback()

Updates the Viewer's playback.

Available in 3ds Max 2013 and higher.

   

Profiler Methods

Methods:

<void>nvpx.ProfilerBegin <string>name

Begins profiling.

   

<void>nvpx.ProfilerEnd <string>name

Ends profiling.

   

<void>nvpx.ProfilerDump()

Dumps the profiling information collected between the Begin and End calls. The information will contain a line for each defined profiler and the Average, Minimum, Maximum, and Total times, as well as the number of times a simulation has been run.

EXAMPLE

nvpx.ProfilerBegin "Test" --start profiling.
--> OK

--Perform MassFX Simulation, e.g. Bake All.

nvpx.ProfilerEnd "Test" --end profiling.
--> OK
nvpx.ProfilerDump() --Dump the collected info:
--> Test avg:37728ms min:37728 max:37728 count:1 total:37728ms
--> OK

   

Multi-threading and Hardware Acceleration

Methods:

<boolean>nvpx.SupportMultiThread()

Returns true if the PhysX engine supports multi-threading, false if it does not.

   

<boolean>nvpx.IsMultiThreadOn()

Returns true if Multi-Threading is enabled, false if it is disabled. Default is false.

   

<boolean>nvpx.UseMultiThread <boolean>onOff

If the argument is true, enables Multi-Threading. If the argument is false, disables it.

   

<boolean>nvpx.SupportHardwareScene()

Returns true if hardware acceleration is currently supported, false if it is not.

   

<boolean>nvpx.IsHardwareSceneOn()

Returns true if hardware acceleration is enabled, false if it is disabled.

   

<boolean>nvpx.UseHardwareScene <boolean>onOff

If the argument is true and hardware acceleration is supported, enables hardware acceleration. If false, disables hardware acceleration. Returns true on success, false if hardware acceleration is not supported.

   

UnitTest Methods

The following methods are used to perform internal unit tests and must not be called by users.

Methods:

<void>nvpx.UnitTest_MaterialCreate <integer>type <string>name
<boolean>nvpx.UnitTest_MaterialFind <string>name
<void>nvpx.UnitTest_MaterialDelete <string>type
<void>nvpx.UnitTest_MaterialAssign <node>node <string>name
<string>nvpx.UnitTest_MaterialPick <node>node
<void>nvpx.UnitTest_MaterialSetSelection <string>type
<string>nvpx.UnitTest_MaterialGetSelection()

   

Destruction And Damage

<node>nvpx.CreateDestruction <&node array>nodes 

nodes is In and Out parameter

Creates a Destruction setup using the nodes in the by-reference array argument.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.UpdateDamageForces <float>Damage <float>Momentum <float>Radius

Updates the Damage Forces using the specified damage, momentum, and radius.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.ToggleBomb()

Toggle Bomb on and off.

Available in 3ds Max 2013 and higher.

   

<void>nvpx.ToggleHammer()

Toggle Hammer on and off.

Available in 3ds Max 2013 and higher.

   

   

See Also