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

    Asign different color to each polygon?

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 329 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 18/05/2014 at 13:37, xxxxxxxx wrote:

      Hi everyone,

      this sounds familiar to some of you I guess, anyway I need a bump in the right direction to get me going on this.

      Q1: I want to asign each polygon in a scene a color without generationg selection tags and other cumbersome stuff. Something more elegant and simple like editor colors.

      And also I need to store each Polygon "ID" to "link" to the color?

      Q2: Is there something like a polygon ID? or is it just a List of Vectors of each object ID?

      kind regards mogh

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

        On 25/05/2014 at 11:38, xxxxxxxx wrote:

        A polygon is just an index into an array of 4 points (point indices actually) per entry, which are the vertices of that polygon. Look at the structure manager, that's pretty much it.

        Without a selection tag as intermediary, you can't extend this lightweight structure to hold a color. Editor colors refer to the whole object.

        The only ID for this polygon is its index. Note that tools may change the object topologically, which would force you to adapt the index appropriately.

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

          On 26/05/2014 at 09:11, xxxxxxxx wrote:

          Well, I once used a trick to assign individual colors to polygons...
          You can define RGB colors as UVW values inside an UVWTag that you create for your object. This trick allows you to store colors for each of the 4 points of a polygon. To get this rendered, you need to write your own shader, that uses the UVW values as RGB values.

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

            On 27/05/2014 at 02:30, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Well, I once used a trick to assign individual colors to polygons...
            You can define RGB colors as UVW values inside an UVWTag that you create for your object. This trick allows you to store colors for each of the 4 points of a polygon. To get this rendered, you need to write your own shader, that uses the UVW values as RGB values.

            Thanks for the tip.

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