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

    Need help making this script

    Cinema 4D SDK
    3
    4
    609
    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.
    • R
      rgi
      last edited by

      Hi, I am trying to make a python script for Cinema4D to help me with my repetitive task. I have a lot of models to optimize the same way. Look at the leaf in the picture:

      5b0afac8-7693-4fa4-828d-2022f8e98a5f-image.png

      I want to optimize the leaf by reducing the number of vertices on the circumference. I was doing it manually for a while but I realized there is a way to automate the task.

      What I have in mind is iterating each edge of the circumference and deselecting each point that has a high angle with it's neighbours. If the angles are low with neighbours, the point would stay selected so I can delete it, thus reducing vertices that are not needed to keep the general shape and uvs of the leaf.

      So the script should work with a preselected loop, doing dot product on each neighbouring edges and compare them to a treshold value, then deselect them accordingly.

      The result should look something like this:

      f794d5f9-4295-40ef-bd56-31e64b1dfb5d-image.png

      I know the results won't be always perfect with an automated solution, but efficiency is more important than looks here.

      I've been trying to make this script for a while with no sucess. Python has not been good to me..
      The most I've managed is a script that discards every second selected vertex randomly..

      Could someone make this script for me? I'd be willing to pay some money for this.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • А
        Артём
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand @rgi
          last edited by ferdinand

          Hello @rgi,

          thank you for reaching out to us and welcome to the Cinema 4D development community. Please take a look at our Forum Guidelines, as we do require postings to follow a certain form. Your posting is most importantly missing the required tags describing the programming environment, the targeted version(s) of Cinema 4D and the targeted operating system(s).

          About your question: We have a series of example scripts on polygon reduction GitHub which might be useful to you. The one most relevant for you is probably polygonreduction_vertexlevel_r19.

          Cheers,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hello @rgi,

            without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly.

            Thank you for your understanding,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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