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

    Creating a Constraint Tag

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 285 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 22/11/2010 at 06:50, xxxxxxxx wrote:

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

      ---------
      Hi!
      Can anybody tell me please what I have to do to create a Constraint Tag (PSR)??
      Thanks!

      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 23/11/2010 at 05:32, xxxxxxxx wrote:

        Simple example how to create a CA Constraint tag and add a PSR target.

          
        Bool MenuTest::Execute(BaseDocument *doc)  
        {  
          // constraint object  
          BaseObject *op1 = doc->GetFirstObject();  
          if (!op1) return FALSE;  
          
          // target object  
          BaseObject *op2 = op1->GetNext();  
          if (!op2) return FALSE;  
          
          // create the tag  
          BaseTag *tag = op1->MakeTag(1019364, NULL);  
          if (!tag) return FALSE;  
          
          op1->Message(MSG_UPDATE);  
          
          // enable PSR constraints  
          tag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR), GeData(TRUE), DESCFLAGS_SET_0);  
          
          // calls the Add button to add a target  
          DescriptionCommand dc;  
          dc.id = DescID(DescLevel(ID_CA_CONSTRAINT_TAG_PSR_ADD, DTYPE_BUTTON, tag->GetType()));  
          
          tag->Message(MSG_DESCRIPTION_COMMAND, (void* )&dc);  
          
          AutoAlloc<BaseLink> link;  
          if (!link) return FALSE;  
          
          link->SetLink(op2);  
            
          // sets the link to the target object; target link IDs start with 10001 for the first target, 10002 for the second and so on  
          tag->SetParameter(DescID(10001), GeData(link), DESCFLAGS_SET_0);  
          
          tag->Message(MSG_UPDATE);  
          
          EventAdd();  
            
          return TRUE;  
        }  
        

        cheers,
        Matthias

        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 24/11/2010 at 07:43, xxxxxxxx wrote:

          thanks a lot!

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