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

    null object, where, how?

    SDK Help
    0
    5
    493
    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
      Helper
      last edited by

      On 08/09/2013 at 09:54, xxxxxxxx wrote:

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

      ---------
      hi there!

      i want to export "null objects" but can't find a constant for it like OBJECT_POLYGONOBJECT.
      when i GePrint the GetInfo() from a null object, i get a 1<<28, but also can't find a suitable
      define for it in the c++SDK. where is it?

      is it safe to use the 1<<28 or even go for the name including "null"?
      feels so dirty...

      now i have "forward-kinematics" with hierarchical poly-objects,
      but null-objetcs are so usefull for everything and i want them as parents
      for the SRT-matrices... dragging the other objects every time in/out would be painfull...

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

        On 08/09/2013 at 10:05, xxxxxxxx wrote:

        Hi Sibu,

        it's not 1 << 28, I wonder how you come to this value? The actual plugin ID of a Null-Object is Onull
        or 5140 in integral form. OBJECT_POLYGONOBJECT also is not the ID of a Polygon-Object, it is a
        bitflag used for the registration of object plugins. The plugin ID of Cinema 4D's standart polygon
        object is Opolygon (or 5100 in integral form).

        Best regards,
        -Niklas

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

          On 08/09/2013 at 10:11, xxxxxxxx wrote:

          hi niklas!

          well, i do this:

          if (o->GetInfo() & OBJECT_POLYGONOBJECT)
          and export my polyObjects.

          i want to do the same with null-objects.

          as said, when i GePrint the GetInfo from a null-object, i get 1<<28.

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

            On 08/09/2013 at 10:48, xxxxxxxx wrote:

            Hi Sibu,

            oh I'm sorry, I confused the GetInfo() method. Well, yes the return of GetInfo() is expected. You
            should switch to using IsInstanceOf() and the Onull and Opolygon constants.

            if (o->IsInstanceOf(Opolygon)) {
                // ...
            }
            else if (o->IsInstanceOf(Onull)) {
                // ...
            }
            

            While the Opolygon constant represents the plugin ID of the standart Cinema 4D polygon object,
            it also represents the "class" of the object being capable of the polygon object interface and is
            actually equal to your method.

            Same goes for the Opoint constant. For example, you can check an FFD deformer for

            ffd->IsInstanceOf(Opoint)
            

            and it yields TRUE! However,

            ffd->GetType() == Opoint
            

            yields FALSE. It depends on your needs which way you choose. Either way, any object which
            returns TRUE on calling IsInstanceOf(Opolygon) can be cast to a PolygonObject* of the SDK.

            GetInfo() only returns the flags that have been passed to RegisterObjectPlugin(), specifieng
            fundamental properties of the plugin (does it generate geometry? does it deform geometry? is it a point object? etc.)

            Cheers,
            -Niklas

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

              On 08/09/2013 at 11:08, xxxxxxxx wrote:

              thank you very much!

              thats what i was looking for, still new to the c4d-sdk, ofcourse i should check for IsInstanceOf...

              nochmal, vielen dank!
              bis demnäxt...

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