Determining the actual class of an object
jared19_76551e8932
Posts: 15
Hi,
How can I determine the actual class an object? For example:
var oRoot = Scene.getSelectedNode(1).getSkeleton();var numProps = oRoot.getNumProperties();var oProp;for(var i = 0; i < numProps; ++i){ oProp = oRoot.getProperty(i); // determine the class of current oProp ???}
I've tried "typeof" and "oProp.__proto__" and all returns "Object". How can I determine which subclass of DzProperty oProp actually is?
Thanks
Comments
className() is supported for all items derived from QObject. You can also use .isA( classname ) if you want to check for ientity, or mor safely .inherits( classname ) to allow for later abstraction (for example, the figures in DS 3 are now subdividied and don't exist in their own right, so anything that checked for isA( "DzSkeleton" ) rather than inherits( "DzSkeleton" ) would fail in DS4).
Thanks. Those functions/methods fit the bill perfectly.