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

    Using Checktype...

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 860 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 09/07/2011 at 17:36, xxxxxxxx wrote:

      Hey all! had a quick question regarding the CheckType() function. is it possible to check to see if an object that has been dragged into a link field is BaseObject()? it always asks for the specific BaseObject ID when i use CheckType(), but in this case, i need to find out whether the linked object is a spline(c4d.Osplinerectangle,c4d.Osplinenside,c4d.BaseSpline, etc...). anyone know of a good way to check for a spline object?  Maybe CheckType() is the wrong function?  thanks in advance for the help!

      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 10/07/2011 at 02:32, xxxxxxxx wrote:

        What's the problem with CheckType ?

        Cheers,
        niklas

        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 10/07/2011 at 21:17, xxxxxxxx wrote:

          i want to find out if an object is a spline or not. how would one do that using CheckType()?

          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 10/07/2011 at 23:19, xxxxxxxx wrote:

            What about op.CheckType(c4d.Ospline) ?
            Or do you want to check for a generator spline ?
            I'm not sure, but if it's a generator - spline, it is a BaseSpline-Object and no more a BaseObject.
            You could test like isinstance(op, c4d.BaseSpline).

            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 11/07/2011 at 00:02, xxxxxxxx wrote:

              ok, so the two types are c4d.Ospline and c4d.BaseSpline? basespline points to a spline generator and Ospline points to a basic point/spline object. i think i understand. i have to look up that isinstance() function... not sure what that does yet...

              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/07/2011 at 04:55, xxxxxxxx wrote:

                it just checks wether an instance is of the specified type or not.

                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 13/07/2011 at 20:41, xxxxxxxx wrote:

                  hey nux, just wanted to clarify a couple things. first of all c4d.BaseSpline is not a class. isinstance seems to require a class, but i searched through the documentation and found c4d.SplineObject. this worked like a charm with isinstance. the code that worked is:

                  if isinstance(spline, c4d.SplineObject) :
                      spline = self.stype.GetClone()

                  thanks again duder!

                  EDIT:

                  another good one is:

                  if SplineObject.GetRealSpline() :
                  #put code here

                  this will only work if the spline is a spline generator object(c4d.Osplinerectangle, c4d.osplinenside, c4d.Osplinecircle, etc...)

                  c4d.Ospline only checks for a editable spline object

                  thought that might be helpful to someone.

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