Check Link Field for Bezier Spline



  • 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?



  • 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.



  • 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;



  • 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.



  • 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.


Log in to reply