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
    • Register
    • Login

    Change object position by tag's param

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 206 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 02/04/2005 at 22:56, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.1 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      How to change object position after the change position value of tag aligntospline in the while circle?

      main(doc,op)
      {
      var obj_master = doc->FindObject("master");
      var obj_slave = doc->FindObject("slave");

      var pos_master = obj_master->GetMg()->GetV0();
      var pos_slave = obj_slave->GetMg()->GetV0();

      var pos=0;

      var dist=0;
      var i=0;
      dist=vlen(pos_master-pos_slave);
      println("start dist is ",dist);
      while ((dist>100)&&(i<15))
      {
           pos+=0.05;
      obj_slave->GetFirstTag()#ALIGNTOSPLINETAG_POSITION=pos;
      //******************************************************
      //In this point position of "slave" must be changed but it not happened 😞
      //*****************************************************
      pos_master = obj_master->GetMg()->GetV0();
      pos_slave = obj_slave->GetMg()->GetV0();
      dist=vlen(pos_master-pos_slave);
      i++;
      println(dist," ",pos);
      }

      }

      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/04/2005 at 14:58, xxxxxxxx wrote:

        Unfortunately it's not possible to control the execution from within a single C.O.F.F.E.E. tag like that. One possibility would be to put all of the script in a single menu plugin or similar, and then use EventAdd() to force the scene to redraw. Another way might be to split the script into two tags and make one of the execute before the align tag and the other after, thought I'm not sure how to get the loop effect that way. A third way would be to implement the align-to-spline functionality yourself using SplineObject functions. Probably not possible if you need a 100% match.

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