Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

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

    Cinema 4D SDK
    r21 python
    2
    3
    317
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CairynC
      Cairyn
      last edited by Cairyn

      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.

      1 Reply Last reply Reply Quote 1
      • M
        m_adam
        last edited by

        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.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • CairynC
          Cairyn
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post