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

    Loading selected Points as an array?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 264 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 23/02/2010 at 05:53, xxxxxxxx wrote:

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

      ---------
      Hi,

      I was wondering if anybody could help me. I'm very new to scripting and have not done very much at all, so sorry if this is the easiest thing in the world.

      I'm trying to create a plugin that effects selected points of an object only. I'm struggling to find a way to load the currently selected points as an array so that I can move them. Is there a way to do this? I know how to get the point selection as a member of the BaseSelect class, but don't know how to access the individual point coordinates once I have done this.

      Any help would be greatly appreciated!

      Oh, one side note, I'm currently working out the script on a coffee tag within the document so I don't know whether this changes the way I approach this task.

      Thanks in Advance!

      Peth

      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/02/2010 at 06:46, xxxxxxxx wrote:

        The GetPoints() method of the PointObject class returns an array with the object's points.

        Or use the GetPoint() method to access single points.

        Example:

          
        // op is your polygon/point object  
        var sel = op->GetPointSelection();  
          
        var points = op->GetPoints();  
        var pcnt = op->GetPointCount();  
          
        var i = 0;  
        for (i = 0; i < pcnt; i++)  
        {  
          if (sel->IsSelected(i))  
          {  
              println(i);    //index of selected point  
              println(points[i]);    //value of selected point  
          }  
        }  
        

        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 23/02/2010 at 06:57, xxxxxxxx wrote:

          Excellent, thanks so much. I'd got some of the way there, but couldn't quite get it working. That's brilliant though, thanks!

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