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
    1. Maxon Developers Forum
    2. Tpaxep
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Tpaxep

    @Tpaxep

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Tpaxep Unfollow Follow

    Latest posts made by Tpaxep

    • Edge ring selection

      Hi folks, I am actively trying to learn Python for Cinema 4D, and lately I have been struggling with edge selection, specifically the Loop and Ring functions.
      I got the code working as expected in r21, but in r25 and 2024 it no longer works, I have been trying to figure out what the problem is, but alas, I have not been able to. I would really appreciate it if you could show me what I am missing

      import c4d
      from c4d import utils
      
      def select_ring_edge(obj, edge_id):
          bc = c4d.BaseContainer()
          bc.SetData(c4d.MDATA_RING_EDGE, edge_id)
          bc.SetData(c4d.MDATA_RING_SELECTION, c4d.SELECTION_NEW)
      
          result = c4d.utils.SendModelingCommand(
              command=c4d.ID_MODELING_RING_TOOL,
              list=[obj],
              mode=c4d.MODELINGCOMMANDMODE_EDGESELECTION,
              bc=bc,
              doc=c4d.documents.GetActiveDocument(),
              flags=c4d.MODELINGCOMMANDFLAGS_CREATEUNDO
          )
          c4d.EventAdd()
          return result
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          obj = doc.GetActiveObject()
          if obj is None:
              c4d.gui.MessageDialog("select obj.")
              return
      
          edge_index = 3
      
          result = select_ring_edge(obj, edge_index)
          if result:
              print("DONE")
          else:
              print("ERROR")
      
      if __name__ == '__main__':
          main()
      posted in Cinema 4D SDK 2024 python windows
      T
      Tpaxep