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

    CheckType get wrong

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 316 Views
    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.
    • H Offline
      Helper
      last edited by

      On 28/02/2017 at 14:49, xxxxxxxx wrote:

      Don't know if it's a bug or not (that take me a while to figured this but)
      Here is a log from the console..

        
      Arnoldcylinderlight.CheckType(5102)
      True
      Arnoldcylinderlight
      <c4d.BaseObject object called 'Arnold cylinder_light/Arnold Light' with ID 1030424 at 0x000001179A329C10>
      

      Why CheckType return True?
      Using GetType working fine

      if Arnoldcylinderlight.GetType() != 5102:
      

      while not CheckType don't.

      if not Arnoldcylinderlight.CheckType(5102) :
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 01/03/2017 at 02:27, xxxxxxxx wrote:

        Hi,

        This is not a bug. The documentation states that C4DAtom.CheckType() checks if the atom is an instance of a base type. And it should be true that an Arnold Light is an instance of c4d.Olight base type ( 5102 ).
        Note C4DAtom.IsInstanceOf() does exactly the same as C4DAtom.CheckType() but its name is better.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 01/03/2017 at 02:35, xxxxxxxx wrote:

          Thanks you for the informations for acheving that I was sure we must use C4DAtom.GetClassification()
          Then for me the only solution is by doing if Arnoldcylinderlight.GetType() != 5102:

          It's jsut curiosity since I get everything working ^^.

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