How to list methods on an object.



Is is possible to print or find out what all the methods for an object is. Say something like “splineshape” for example.

There is the MaxScript command showProperties which lists all the properties on an object, but I can’t find something like showMethods.



Not always.
When MAXScript was first added to Max, the methods had to be coded explicitly to support certain object classes, but the methods were NOT exposed by these objects, so it is not possible to ask for a list of methods in these cases.
Where properties and methods are exposed via a Function Publishing Interface though, the showInterface() method will list both properties, methods and actions defined by the Interface.

For example, to see the properties and methods exposed by the inode interface, select any scene object and type in

showInterface $.inode

But how do you know what interfaces an object exposes?
To see all Interfaces exposed by a node, for example, type in

showInterfaces node

(note this is plural and expects an object or class as argument, while showInterface() expects an Interface)

SplineShape was exposed explicitly in Max 2 and has not been changed since then, so it does not expose methods via interfaces. The only way to find out what methods it supports (or to be precise - what methods support SplineShape as argument) is to read the MAXScript Reference.

showMethods() along with showEvents() exists for ActiveX controls and (in Max 9) for DotNet classes, objects and controls. It does not apply to other objects.


Thanks, that makes sense.

I also realized that the older MaxScript commands are statement driven, and not always method driven.

For example: addNewSpline <spline>

If that was added as a new feature today it would have been spline.addNewSpline()

So listing the methods for some of the MaxScript objects won’t list every operation you can perform on the object.

I hope they (Autodesk) rethink their approach to MaxScript and clean up the library of functions so they are more organized.


I hope not, I have scripts written in 1997 that still work today because Autodesk does not break features for the sake of organization :wink:
I would rather see them expose what is left unexposed from those days, while leaving anything that is already there untouched, or else!:twisted:


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.