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

    Reading out Tpointselection

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 410 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 14/07/2006 at 16:13, xxxxxxxx wrote:

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

      ---------
      HI !
      mayby someone can help me. i want to read out the points in a Tpointselection tag. but have no idea how to do that.
      main(doc,op)
      {
           var tag = op->GetFirstTag();
           tag = tag->GetNext();
           tag = tag->GetNext();
           tag = tag->GetNext();
           var Type = tag->GetType();
           println(Type); // 5674 -> Tpointselection
           var name = tag->GetName();
           println(name); // "MySel1"
      }
      Any idea how to move on? Where are the points in the selectionTag?
      Thx!

      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 14/07/2006 at 23:22, xxxxxxxx wrote:

        First, I would never depend upon a tag being in a particular place within the object's tag list. Do this:

        for (tag = op->GetFirstTag(); tag; tag = tag->GetNext())
        {
        if (instanceof(tag, Tpointselection))
        {
        var select = ((PointSelectionTag* )tag)->GetSelection();
        ...
        }
        }

        select is a BaseSelect class which contains an array which is the size of the number of points of the object. The points covered by the PointSelectionTag will be IsSelected(), the others not - think of this as an array of 1's and 0's. The selected points are 1, the others are 0. That is how a BaseSelect works, basically (same for PolygonSelectionTags as well). You can get the number of selected points in the array with select->GetCount().

        = select->IsSelected(x)). You'll need to get the object's vertex with PointObject->GetPoint(x). Now you have a one-one correspondence between selected points (IsSelected(x)) and the actual vertex (GetPoint(x)).

        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 15/07/2006 at 11:35, xxxxxxxx wrote:

          I say THX Kuroyume! now it should work.

          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 15/07/2006 at 13:26, xxxxxxxx wrote:

            Another short question.
            Is it possible to export model/tag data via coffee in Cinema4D 9.6 DEMO!! ?? I dont get the filename or basefile classes to work... mayby someone can help at that point??? please 🙂
            thx!

            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 15/07/2006 at 17:46, xxxxxxxx wrote:

              i fixed that problem. !

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