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

    Phong Break Selection

    Cinema 4D SDK
    python
    3
    4
    1.1k
    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.
    • merkvilsonM
      merkvilson
      last edited by m_adam

      Hello PluginCafe 🙂

      I need to select PHONG BREAK EDGES using python.
      In this code, I'm trying to accomplish this task by utilizing MCOMMAND_PHONGTOSELECTION

      import c4d
      
      def main():
          if op is None: return
          
          c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_PHONGTOSELECTION,
                                        list    = [op], 
                                        doc     = doc)
      
      if __name__=='__main__':
          main()
          c4d.EventAdd()
      

      I don't know if this is a bug or a limitation, but MCOMMAND_PHONGTOSELECTION selects edges only if their phong is broken manually using MCOMMAND_BREAKPHONG command. I need to select all phong break edges based on actuall phong tag, or by manually defining the angle.

      1 Reply Last reply Reply Quote 0
      • merkvilsonM
        merkvilson
        last edited by

        Is there any alternative way in C4D's Python SDK?

        1 Reply Last reply Reply Quote 0
        • dskeithbuckD
          dskeithbuck
          last edited by

          I've done this in the past by going through all edges in the object and comparing the normals of neighboring polygons. A bit ugly, but it works. There are some helper functions in the Neighbor class you might want to look at: https://developers.maxon.net/docs/py/2023_2/modules/c4d.utils/Neighbor/index.html

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

            Hi @merkvilson, this is a limitation actually the tool Phong Break selection and the modeling command MCOMMAND_PHONGTOSELECTION are two completely separate things.
            So the only solution available to you is to manually break the Phong.

            I'm sorry we can't help you more on that, Donovan points you to the correct direction with the neighbor class.
            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

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