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

    Check Link Field for Bezier Spline

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 391 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 03/01/2009 at 23:35, xxxxxxxx wrote:

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

      ---------
      I'm trying to set up a tag link field to accept only bezier splines.

      I can limit it to point splines by either specifying Ospline in the res file or using DescriptionCheckDragAndDrop with
      > dcu->result = dcu->element->GetNodeID() == 0;
      .
      Does anyone know how to refine this down to bezier splines specifically?

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

        Since there is no 'bezier' spline object as it is a setting not a type, first verify that the object type is spline (you should be using: op->GetInfo()&OBJECT;_ISSPLINE). Then you'll have to get the type setting (SPLINEOBJECT_TYPE) from it using its BaseContainer or GetParameter() and accept/decline the drag-n-drop accordingly. The setting types are described in resource/res/description/ospline.res.

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

          Thanks for your help, this worked a treat.

          I actually started with GetInfo() & OBJECT_ISSPLINE as per the SDK example before taking a wrong turn.

          Here's the working code:

          > dcu->result = dcu->element->GetInfo() & OBJECT_ISSPLINE; \> dcu->element->GetParameter(SPLINEOBJECT_TYPE, splineSetting, 0); \> dcu->result = splineSetting == SPLINEOBJECT_TYPE_BEZIER;

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

            I'd do the final line this way:

            dcu->result = dcu->result && (splineSetting == SPLINEOBJECT_TYPE_BEZIER);

            This will guarantee that the object is a SplineObject and using a Bezier setting. SPLINEOBJECT_TYPE could return a random value from another object type using the same description id value for another parameter.

            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 04/01/2009 at 17:17, xxxxxxxx wrote:

              Good point, I've updated the code. Cast-iron underpants are always prudent.

              Thanks again for your help.

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