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

    Polygon selection tag to vertex (weight) map

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 807 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

      On 15/10/2017 at 08:36, xxxxxxxx wrote:

      Hi all!

      Been trying to get my script ready that simple makes a vertex map tag based on a polygon selection.
      Inside c4d you do this with the Set vertex map command. But inside python it works a little different I think??

      Setting the vertex map is with:
      vertexmaptag.SetAllHighlevelData(selection tag values here)

      But how do I set the selection tag to be the value to make to weight tag?
      After that I also like to do an smooth weight command. Tips on that are also welcome!

      All help is appreciated!🙂

      Thanks!

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

        On 15/10/2017 at 08:53, xxxxxxxx wrote:

        As the name vertexMap is per vertex and not per polygon.

        Anyway here is an exemple I made for set/read weight data in python
        https://gist.github.com/gr4ph0s/1bc0075ce733afb8b6678531a37f065b

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

          On 15/10/2017 at 09:47, xxxxxxxx wrote:

          Thanks for the example script!:)
          Still a question (No expert I have to admit😊)

          How do I read in my selection tag to be the value of the weight map?

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

            On 16/10/2017 at 02:28, xxxxxxxx wrote:

            Hi,

            assuming you have a polygon selection stored in a SelectionTag, get the BaseSelect from the SelectionTag (GetBaseSelect()). This BaseSelect stores the selection state per index (of points, polygons,...), see for example IsSelected().

            In case the selection is not stored in a SelectionTag, but is only an active selection on a PolygonObject, then you can get the BaseSelect via GetPolygonS().

            Now, as gr4ph0s already pointed out, when having a polygon selection, you will need to find out the points/vertices belonging to a selected polygon. Via PolygonObject.GetAllPolygons() (or GetPolygonR() or directly via GetPolygon()) you get the CPolygon structure of a polygon, which stores the point indeces you are looking for.

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