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

    Execute (When?) lock x,y,z

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 271 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 18/05/2011 at 06:11, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hello

      I am working on a little plugin tag which is supposed to lock selected axis - somewhat like the X,Y,Z lock of the C4D interface.

      No problem locking an object to a specified fixed location which the user can enter in the Tag description. But what about simply locking an object at it's current position?

      In Execute() I would have to get info about where the object is before moved and where it is going. How can this be done?

      Thanks

      Peter

      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 18/05/2011 at 08:16, xxxxxxxx wrote:

          
        //This is COFFEE, not C++  
          
        var isLocked = FALSE;  
        var pos = NULL;  
        TAG::Execute(op,doc) {  
          if (op->GetData(TAG_ISLOCKENABLED)) {  
              if (!isLocked) {  
                  pos = op->GetPosition();  
              }  
              isLocked = TRUE;  
              if (pos) {  
                  op->SetPosition(pos);  
              }  
          }  
          else { isLocked = FALSE; }  
        }  
        

        Cheers, Niklas

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