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

    switching based on objects type?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 400 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 08/05/2009 at 12:38, xxxxxxxx wrote:

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

      ---------
      is there a way to determine wether an object is a polygonobject (be it a primitive or any mesh) or a spline object(of whatever kind)

      or do i need to check against every possible type (Ocube,Osphere,...) and (Ospline,Osplinecircle,...)

      thanks in advance for your tips...

      cheers

      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 08/05/2009 at 14:01, xxxxxxxx wrote:

        Not all primitives will become polygon objects when made edible. Until then, it is an Ocube, Osphere, etc - these are not Opolygon derived. Every 'object' in the Object Manager is derived from Obase. A few are derived from other things (Obasedeform or Opoint). Be careful checking for spline types as the protocol is different than IsInstanceOf().

        One way, albeit the hard way, would be to clone the object in question, make it editable, and test for Opolygon or Ospline, not forgetting to free the clone afterwards.

        I should add that BaseObject has a method GetRealSpline() which will return a SplineObject if the object is indeed a real spline, otherwise NULL. This might be a good direction to go but still doesn't help determine between, say, Obone, Olayer, and Ocube as proper polygon object candidates (hint: the first two listed here aren't).

        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 08/05/2009 at 19:26, xxxxxxxx wrote:

          Howdy,

          You can test for a spline object with:

          > if((op->GetInfo()&OBJECT;\_ISSPLINE))

          ... and you can check for a geometric primitive object with:

          > if((op->GetInfo()&OBJECT;\_GENERATOR) && !(op->GetInfo()&OBJECT;\_INPUT))

          Adios,
          Cactus Dan

          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 09/05/2009 at 02:01, xxxxxxxx wrote:

            thank you both! that was exactly what i needed to know
            and as i already created a clone i can test for Opolygon and Ospline

            cheers,
            ello

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