By-pointer argument handling in FPS methods fixed

MAXScript Language Improvements in 3ds Max 5

In releases prior to 3ds Max 5, MAXScript was not handling FPS method by-reference (by-pointer) arguments correctly. FPS methods typically pass back values through these pointers, but MAXScript wasn't doing anything with these values. Support for by-pointer parameter passing for by-reference arguments has been added to MAXScript in 3ds Max 5.

For example, the syntax for the getSlicePlane EPoly method is

getSlicePlane <&point3>planeNormal <&point3>planeCenter <*float>planeSize

planeNormal is In and Out parameter

planeCenter is In and Out parameter

planeSize is In and Out parameter

The planeNormal, planeCenter, and planeSize are values returned by the method. Previously, there wasn't a way to get the planeSize value.

NOW YOU CAN SAY:

 --Define variables to hold the Out parameters:
plane_normal = Point3 0 0 0
plane_center = Point3 0 0 0
plane_size = 1.0
--Call the function and supply the variables by reference as In parameters
$.EditablePoly.getSlicePlane &plane_normal &plane_center &plane_size
--The variables will now contain the actual values of the slice plane:
plane_normal
plane_center
plane_size

When a by-reference argument is an In parameter, its value type has to be preset before passing it. In the example above, the plane_normal variable has been preset to a Point3 value.

If a parameter is an Out parameter only (not an In parameter), the variable does not need to be preset to the correct value type.

FOR EXAMPLE:

AssemblyMgr.FilterAssembly a light &lightnodes

In this example, lightnodes can be passed in as undefined, but will contain an array of nodes coming out.

See Also