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
    • Recent
    • Tags
    • Users
    • Login

    Setting the color of individual polygons

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 215 Views
    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.
    • H Offline
      Helper
      last edited by

      On 08/07/2016 at 04:23, xxxxxxxx wrote:

      Hi all,

      I'm using a Python Generator object to create a cuboid using SetPoint and SetPolygon.
      Is it possible to have these polygons drawn in different colors (just editor colors, not materials)?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 11/07/2016 at 09:00, xxxxxxxx wrote:

        Hi,

        welcome to the Plugin Café forums 🙂

        An object's display color (Object's Attribute Manager -> Basic Tab -> Use Color + Display Color) can not be used for this as it can't be restricted to just a set of polygons.
        Actually there's no real solution in Python Generator or even in Python in general.

        One way to circumvent this, would be to create Texture and Selection tags on the created object and link them to already existing materials. Be aware, you are not allowed to change the scene from within the Python Generator, so creating materials for this in the Python Generator is no option. Also I know, you wanted to achieve this without materials.

        Another problem is, that we are currently lacking a data structure to store colors per polygon.

        One option could be to implement a plugin (ObjectData) instead of using the Python Generator and then use the Draw() function to directly draw to the viewport, whatever you want. But you can not change the drawing of the polygons itself, all you could do by this is add some sort of information on top.

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