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
    • Recent
    • Tags
    • Users
    • Login

    Determining type of an object

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 288 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 11/08/2009 at 11:27, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R11 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I know this has been asked several times, and I've searched the forum for explanations, but I'm still confused. It's so easy in COFFEE but how to do it in C++?

      Specifically, I want to determine if an object in the scene is a point object. According to the SDK, I should be able to do:

      if(obj->GetInfo() & OBJECT_POINTOBJECT) ...

      but it won't compile, in that OBJECT_POINTOBJECT is undefined. Where in the API is this (and the other OBJECT_ constants) defined? I can't find them anywhere. Or am I misinterpreting the SDK (more than likely!)?

      Thanks,
      Steve

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 11/08/2009 at 12:37, xxxxxxxx wrote:

        if (obj->IsInstanceOf(Opoint)) ...

        Except for Splines, this works for everything (tags, materials, objects, ...). Most of the available IDs are in the SDK docs.

        For Splines, use:

        if (obj->GetInfo()&OBJECT;_ISSPLINE) ...

        To use IsInstanceOf() with your own plugin classes, use the unique Plugin ID in place of something like 'Opoint' and add this to the top of your class definition:

        class MyObject : public ObjectData
        {
        INSTANCEOF(MyObject,ObjectData)
        ...
        };

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 11/08/2009 at 14:46, xxxxxxxx wrote:

          Ah... thank you! I was obviously going wrong with GetInfo, IsInstanceOf does exactly what I need.

          I'll be back when I hit another brick wall, many thanks in the meantime.

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