Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Inspectors: How to see the properties and attributes of the parent class?

Inspectors: How to see the properties and attributes of the parent class?

Anonymous
Not applicable
216 Views
1 Reply
Message 1 of 2

Inspectors: How to see the properties and attributes of the parent class?

Anonymous
Not applicable
Several inspector functions are provided with Maxscript and are very useful to get the name of the properties and attributes of an object. They seem stuck to the class of the object itself though.

Does someone know how to list the properties of the parent class (also called the superclass)?

Eg:
s = sphere()
$Sphere:Sphere01 @
getpropnames s
#(#smooth, #radius, #segs, #mapcoords, #slice, #hemisphere, #sliceFrom, #sliceTo, #chop, #recenter, #realWorldMapSize)

The sphere also has a property "name" inherited from a parent class (MAXWrapper?).
I would like to list this property as well as all the other properties from the sphere parent classes.

This would also help me to get the properties of rootnode.

Thank you
0 Likes
217 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I eventually wrote something that do what I needed:
The following code lists all the properties of a given class or object, at the class level. I find it useful to quickly inspect various classes of objects.


currentClass = sphere -- or classof $
parentClass = undefined

while parentClass != currentClass do
(
format "% properties: \n" currentClass as string
for prop in getPropNames currentClass do format " %\n" (prop as string)

currentClass = classof currentClass
parentClass = classof currentClass
)
0 Likes