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

    getting and setting a point selection

    SDK Help
    0
    5
    498
    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
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 26/04/2004 at 19:43, xxxxxxxx wrote:

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

      ---------
      Hi,
      I am trying to change some individual points in a point selection tag. I have a handle to the tag (i know that because it returns the correct name), but when I try and get the individual points, I'm having no luck.
      I have searched the forums for info on this basic problem, but no luck so far.
      Here's the code I have so far....
      BaseTag* mTag = obj->GetTag(Tpointselection,0);
      BaseContainer data = mTag->GetData();
      Vector mVector = Vector();
      while (TRUE)
         {
          id = data.GetIndexId(i++);
          if (id==NOTOK)
           break;  
           data.GetVector(id, mVector);
        
      if(mVector.x)
          {
           mSelection= "mVectorx " + RealToString(mVector.x);
           GePrint(mSelection);
          }
          mVector.x += 100;
          data.SetVector(id, mVector);
        
          //redraw the whole scene
          EventAdd(EVENT_FORCEREDRAW);
          
         
         }
      This is just test code, to see what works, which is nothing so far.
      My test string is just to see what I have, and I always have zero there. Then, when I try and change the x value, it does nothing anyway.
      I am completely new to writing plugins, so don't be hard on me, and please help!
      Thanks in advance,
      K. <SCRIPT language=javascript>postamble();_<_Script_>_

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 26/04/2004 at 21:32, xxxxxxxx wrote:

        OK, so I guess my question is really can I get at the vector information of the points stored in a Point Selection Tag? If so, then how?
        Thanks! <SCRIPT language=javascript>postamble();_<_Script_>_

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 01/05/2004 at 17:38, xxxxxxxx wrote:

          The Tpointselection tag is a SelectionTag. Just cast it:

              
              
              BaseTag* tag = ...;  
              if (tag->GetType() == Tpointselection)  
              {  
                SelectionTag* seltag = static_cast<SelectionTag*>(tag);  
                BaseSelect* sel = seltag->GetBaseSelect();  
                ...  
              }
          
          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 01/05/2004 at 21:17, xxxxxxxx wrote:

            Thank you so much for replying!
            The thing is, I already successfuly have the correct information from the selection tag - I just don't know how to get to the guts of the information - the vector information, the x, y and z co-ordinates. BaseSelect class seems to be limited to point counts ans stuff like that - how do I read the actual information stored in the point selection?
            Thank so much in advance again for a quick reply.
            K.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 04/05/2004 at 06:00, xxxxxxxx wrote:

              All the point counts in the BaseSelect class refer to the PointObject::GetPoint() array. So just do

                  
                  
                  BaseObject* obj = tag->GetObject();  
                  if (obj->IsInstanceOf(Opoint))  
                  {  
                    PointObject* pobj = static_cast<PointObject*>(obj);  
                    Vector p = pobj->GetPoint()[i]; // i is the point index from the selection  
                  }
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post