Jump to content

[SOLVED] Checking if a variable is a Node


photo

Recommended Posts

Posted

Hi,

 

Need to check whether a variable contains a valid Node (as opposed to, say, an Image).

Tried variable.getNode() but this doesn't seem to have a way to signal failure, it just crashes if the said variable doesn't contain a Node.

I tried variable.getExternClassType().getName() but this returns the type of the childmost node of the inheritance hierarchy, so not easy to check if it IS_A node.

What is the recommended method for doing this?

 

-a.

Posted

Variable class also have these functions

int getType() const;
const char *getTypeName() const;

 

and samples about variable is located at: UnigineSDK-source-2011-09-13\source\samples\Api\Variable

Posted

Hi steve3d,

I had tried getType() and getTypeName() but they unfortunately return only 'EXTERN_CLASS' not the exact type. I haven't tried with the latest SDK, will do after we update.

Thanks.

Posted

Added isNode() function to the API, as well as a number of similar functions, such as isInt(), isFloat() etc. They will be available in the next update.

×
×
  • Create New...