What is the difference between CheckType() and IsInstanceOf()?



  • So, I normally use C4DAtom::IsInstanceOf() to get the C4D type of an object, as this function supports the plugin IDs. But in fact, in Python there is another function CheckType() in the same class... and I cannot see what the difference between both is. CheckType doesn't seem to exist in the C++ API.

    CheckType returns True if you test against a base type like Obase, just like IsInstanceOf. In the Python documentation, the description for both functions is the same to the letter. Is CheckType just an alias, or is there a semantical difference?

    In other posts here, people seem to use IsInstanceOf throughout. Python itself has its own type() and isinstance() functions for the actual class structure, so I am a bit confused now.



  • Hi @Cairyn, if you speak about C4DAtom.CheckType then yes it's only an alias for IsInstanceOf (I will add a note about it in the next documentation).
    Why it's there I have no clue, to be honest.

    Thanks a lot for this question/feedback.

    Cheers,
    Maxime.



  • Yes, C4DAtom.CheckType() in Python. Thanks for the confirmation, it bugged me that it was only in the Python doc but not in the C++ doc.


Log in to reply