Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    To grow selection in UVPolygon mode

    Cinema 4D SDK
    2
    2
    872
    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.
    • K
      kisaf
      last edited by

      Hi everyone!

      When C4D is in Polygon mode Grow selection can be done using SendModelingCommand e.g.

      utils.SendModelingCommand(
              c4d.MCOMMAND_SELECTGROW,
              [op],
              c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
              c4d.BaseContainer(),
              doc
          )
      

      After that, selection grows to neighbour polygons. Everithing is ok.
      However, when active mode is UV Polygon then code above select neighbour polygons the same way how it was in previous case. Sometime it's ok, but not always.

      The second way to grow selection is to use CallCommand

      c4d.CallCommand(12558, 12558) # Grow Selection
      

      In this case selection grows correctly in both modes.
      I'll show an example. There is a simple sphere that separated by UVs in the middle. So it has 2 UV islands.

      0_1550175526500_original.png

      0_1550175544700_result-1.png

      0_1550175550200_result-2.png

      From 1 selected polygon (the first image) I want to get the result which is shown on the last image.
      But I don't know how to get it without CallCommand
      Sorry for mistakes. English is not my szcznek language
      Cheers

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi Kisaf, I'm afraid this is not possible from SendModelingCommand to send command in UV mode.

        So it's up to you to remove the extra selected stuff or build your own grow algorithm.
        A good way to achieves that could be to:

        • Detects uv island and give them an ID.
        • Store uv island ID used with the current selection.
        • Grow the selection in polygon mode
        • Deselect all polygons if they are not in the uv island.

        But this not work in all cases (e.g. topology of the object is disconnected but uv are connected).
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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