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

    Invert normals only for selected polygons

    Cinema 4D SDK
    r20 python
    3
    4
    3.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.
    • J
      Julien
      last edited by r_gigante

      Hello,

      is there a way to flip all the face normals for selected polygons in one direction, especially in python?
      The intended purpose is to fix a completly "broken" mesh to correct the background culling for Unity.

      Thanks in advance!

      Julien

      Example:
      All stair polygons should face upwards.
      Tried align normals and optimize commands, but they did not work with this mesh.

      0_1542735361100_example.png

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

        This happens because of a bad mesh. I doubt it will work in Unity without problems. Better do a complete retopo. Shouldn't be that hard as the object is very simple.
        By the way:

        All stair polygons should face upwards.

        No, they shoudn't. As seen in your screenshots, you also have selected erroneous normals that point forward (risers).

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

          Hi, @Julien first of all welcome in the plugincafe community.

          No worries at all since it's your first post here, but please make sure to read and apply the rules defined on the following topics:

          • How to Post Questions.
          • Q&A Functionality.
          • Developer Support

          Unfortunately as said in the Developer Support Topic, we can only help you regarding how normal are exposed and how to access them in C4D.
          Is up to you to build the algorithm.

          With that's said you can find some information about how to read/write normals in this post How can I get or set the normals direction?.

          Finally, I would like to point you to https://code.vonc.fr/?a=23 which offer a selection based on the normal direction. So you may be able to select all downward normals and call inverse Normal command.

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 2
          • J
            Julien
            last edited by Julien

            Thank you for the kind help!

            @m_adam: The plug-in you have linked is very useful. I could fix some problems with the "Select polygons by normal direction" function.

            Working with badly constructed meshes is no fun job either way.

            Kind regards,
            Julien.

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