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

    DrawPolygon showing black triangles

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 593 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 20/08/2012 at 17:19, xxxxxxxx wrote:

      I'm drawing a triangle with a color ramp in the Draw member of my ObjectData plugin using DrawPolygon.
      It all shows fine if I have Enhanced OpenGL turned on.
      If I have Enhanced OpenGL off, the triangle shows up black.
      I'm drawing the triangle in the drawpass==c4d.DRAWPASS_OBJECT
      Is there anything that I need to do to make it work with Enhanced OpenGL turned off?

      Rui Batista

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 20/08/2012 at 17:28, xxxxxxxx wrote:

        Just found out that this only happens if my scene has any other polygonal object, besides my ObjectData object.
        Would this help to spot the problem?

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 20/08/2012 at 17:31, xxxxxxxx wrote:

          Also found out that is the additional polygonal object is in the scene but it is not visible, the triangle shows the color ramp, even without Enhanced OpenGL turned on.
          As soon as a little bit of any polygonal object is shown in the editor, my DrawPolygon triangles appear black.

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 23/08/2012 at 18:00, xxxxxxxx wrote:

            Anyone?

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 23/08/2012 at 18:11, xxxxxxxx wrote:

              Hello Rui,

              This is the default-code of the DrawHelper plugin and it works fine with OpenGL, Enhanced OGL and Software-Mode here on Windows 7 x64.

              import  c4d  
              from    c4d     import Vector  
                
              def main() :  
                bd.SetMatrix_Matrix(op, bh.GetMg())  
                bd.SetTransparency(1)  
                points      = (  
                    Vector(100, 0, 0),  
                    Vector(0, 100, 0),  
                    Vector(0, 0, 100),  
                )  
                colors      = (  
                    Vector(1,0,0),   
                    Vector(0,1,0),   
                    Vector(0,0,1),  
                )  
                bd.DrawPolygon(points, colors)  
                
              main()
              

              PS: Back then, I didn't knew about the use of the drawpass flag, so it's not in the code. But adding if drawpass != c4d.DRAWPASS_OBJECT: return works fine, too.

              -Niklas

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 23/08/2012 at 18:26, xxxxxxxx wrote:

                My code was similar to that one, Niklas.
                Try using it with a polygonal object added to the scene to see if it is drawn black.
                But, in the meanwhile, I found out the solution.
                I just had to add the following before drawing the polygon:

                bd.SetLightList(c4d.BDRAW_SETLIGHTLIST_NOLIGHTS);

                Rui Batista

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