DataPair Values

The DataPair class is simply a wrapper around two values.

The values can be of any value type.

The class is available in 3ds Max 2008 and higher.

It was previously available in the Avguard Extensions.

Available in 3ds Max 2017.1 Update and higher: DataPair values can be specified in a persistent global variable. Both values in the DataPair must be specifiable as a persistent global variable in order for the DataPair to be fully restored on scene file load.

Constructors

DataPair ()
DataPair <value1> <value2>
DataPair <value1_name>:<value1> <value2_name>:<value2>

Properties

<dataPair>.v1 : Value

Get/set the first value in the DataPair.

<dataPair>.v2 : Value

Get/set the second value in the DataPair.

<dataPair>.<value1_name> : Value

Get/set the first value in the DataPair by name.

<dataPair>.<value2_name> : Value

Get/set the second value in the DataPair by name.

Methods

getPropNames <dataPair>

Returns array of names values where first two values are #v1 and #v2, remaining 2 values are <value1_name> and <value2_name> if that form of the constructor is used.

deepCopy <dataPair>

Creates a deep copy of the dataPair. Available in 3ds Max 2019 and higher. The dataPair is recursively traversed, and new copies are generated of all items it contains. Note that if the dataPair contains multiple references to a single value, the deep copy will contain multiple references to a single, new value.

EXAMPLES:

   --Define a new value consisting of a Point3 value and an Integer
   theVal = DataPair [10,20,30] 40
   --> (DataPair [10,20,30] 40)
   theVal.v1 --get the first value in the pair
   --> [10,20,30]
   theVal.v2 --get the second value in the pair
   --> 40

   --Define a new DataPair value with names values
   theVal2 = DataPair question:"Life,Universe,And Everything" answer:42
   -->(DataPair question:"Life,Universe,And Everything" answer:42)
   theVal2.question
   --> "Life,Universe,And Everything"
   theVal2.answer
   --> 42
   --You can use the properties too:
   theVal2.v1
   --> "Life,Universe,And Everything"
   theVal2.v2
   --> 42