Nested Object Properties

Several of the properties on 3ds Max objects contain values that are themselves compound, for example <node>.pos yields a Point3, which itself contains x, y and z properties. MAXScript provides a mechanism that lets you modify these nested properties on MAXWrapper objects in place such that assignment to them will affect that nested property on the 3ds Max object. This mechanism depends on the nested property being accessed in one, cascaded property access. For example:

$foo.pos.x += 23 -- move the node 23 units in x

$baz.rotation.angle *= 2 -- double the rotation

If you first get the intermediate value into some variable and then set the property on that value, the change will not be reflected in the original object, the connection is only maintained within a single cascaded property access. For example:

p = $foo.pos -- get foo's position as a 'detached' point3

p.x += 23 -- set the x prop of that point, it doesn't know

-- about foo anymore, foo's pos is not changed

In this case, you would have to explicitly re-assign the free-standing point to $foo's position to affect $foo:

$foo.pos = p -- set foo's new position

In general, any property on a MAXWrapper object that is itself a foundation compound value such as a Point3 or Quat will yield a free-standing value when simply accessed and supports object sub-property assignment in cascaded property assignment.