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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    AligntoSpline SetData

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 528 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/04/2008 at 09:56, xxxxxxxx wrote:

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

      ---------
      What am I missing?  My position isn't changing.

          
          
          
          
          AS::Execute(doc, op)  
          {
          
          
          
          
           op->InitLength(0);  
           leng=op->GetLength();  
           var ind=0;  
           FT=op->GetDown();  
           pos=6.5*ind/leng;  
           FTC=FT->GetFirstTag()->GetContainer();  
           FTC->SetData(ALIGNTOSPLINETAG_POSITION,pos);  
           SetContainer(FTC);
          
          
          
      

      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 22/04/2008 at 10:17, xxxxxxxx wrote:

        ind = 0
        0*anything = 0
        0/anything = 0
        anything/0 = crash

        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 22/04/2008 at 10:43, xxxxxxxx wrote:

          Thanks Robert but,  In this case I want my position to be 0.  I am going to increment ind for subsequent objects.  I had my align to spline position set to 37%, and it doesn't change to 0%.  That is the problem.     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 22/04/2008 at 11:09, xxxxxxxx wrote:

            I'd definitely check the tag type and make sure it is Taligntospline. You'd be better off doing a for loop until you have it (there is no guarantee that the first tag is the one you think it is!). One quick way to check here is to do FTC->GetData(ALIGNTOSPLINETAG_POSITION) right after you get the container and before calling SetData(). If it returns NIL, it can't possibly be the correct tag.

            Otherwise, I don't see anything incorrect in the code.

            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 22/04/2008 at 11:11, xxxxxxxx wrote:

              I changed the SetContainer line to this and now it works.

                  
                  
                  
                  
                  AS::Execute(doc, op)  
                  {
                  
                  
                  
                  
                   op->InitLength(0);  
                   leng=op->GetLength();  
                   var ind=0;  
                   FT=op->GetDown();  
                   pos=6.5*ind/leng;  
                   FTC=FT->GetFirstTag()->GetContainer();  
                   FTC->SetData(ALIGNTOSPLINETAG_POSITION,pos);  
                   FT->GetFirstTag()->SetContainer(FTC);
                  
                  
                  
              

              Don't know why this is necessary, but it works

              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 22/04/2008 at 11:17, xxxxxxxx wrote:

                Ah. Didn't catch that. Well, yeah, SetContainer() all by itself doesn't tell you which container it is setting. There probably should have been a warning or something during execution.

                You might want to consider:

                var FTT = FT->GetFirstTag();
                if (!FTT) return FALSE;
                if (FTT->GetType() != Taligntospline) return FALSE;
                FTT->GetContainer();
                ...
                FTT->SetContainer(FTC);

                You should be checking for two things here: is there a tag and is it of the correct type.

                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 22/04/2008 at 11:25, xxxxxxxx wrote:

                  Thanks Robert,  I think that is a good idea.  I am going to switch and get the tag with a loop GetType() Taligntospline because eventually there may be more than one tag on the objects.

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