(SDK) check if the object can be used as an Object for INode


i’m creating a node by:

MAXScript_interface7->CreateObjectNode(obj, name);

my question is - can I check that the Object (obj) is valid to make a INode?
i don’t want to use try/catch as some sdk examples do


how are you creating the object that makes you think it’s not valid ?


i can pass a reference target or class. if it’s a class i create an instance of this class (and of course check if the class is creatable).
but it might be a controller or material class for example… which cannot be used to make a node


that’s easy then

Object* obj = dynamic_cast<Object*>(input);
if(obj != NULL).....

with RTTI set in the compile



inline BOOL isObject(ReferenceTarget* ref) { return ref->GetInterface(I_OBJECT) ? TRUE : FALSE; }


thanks! it works. enough and safe