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

    GeUserArea.DrawEllipseFill() draws a circle the wrong way

    Cinema 4D SDK
    python r25 sdk
    2
    4
    610
    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.
    • K
      kng_ito
      last edited by m_adam

      Hi,
      There seems to be a problem with DrawEllipseFill() and DrawEllipseLine().

      Here is a simple script that opens a dialog that draws two different circles in the UserArea.
      Both circles are supposed to be a circle with 10px radius at different positions, but the second argument "radius" does not seem to work.

      Please let me know if I am doing it wrong or if there is another way to draw a circle in UserArea. Thanks!

      import c4d
      
      class MyUserArea(c4d.gui.GeUserArea):
          def DrawMsg(self, x1, y1, x2, y2, msg_ref):
              # Initializes draw region
              self.OffScreenOn()
              self.SetClippingRegion(x1, y1, x2, y2)
              self.DrawRectangle(x1, y1, x2, y2)
              # Draws Circles
              self.DrawSetPen(color=c4d.Vector(1,1,1)) # White
              self.DrawEllipseFill(centerPoint=[100, 50], radius=10) # Filled Circle
              self.DrawSetPen(color=c4d.Vector(1,0,0)) # Red
              self.DrawEllipseLine(centerPoint=[50, 100], radius=10) # Line Circle
      
      
      class MyDialog(c4d.gui.GeDialog):
          ua = MyUserArea()
          def CreateLayout(self):
              area = self.AddUserArea(id=0, flags=c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT)
              self.AttachUserArea(ua=self.ua, id=area)
              return True
      
      def main():
          dialog = MyDialog()
          dialog.Open(dlgtype=c4d.DLG_TYPE_MODAL, defaulth=400, defaultw=400)
      
      if __name__ == '__main__':
          main()
      

      Result:
      2022-04-25 200556.png

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

        Hi thanks for the report, there is sadly a bug in the python layer, nothing you can fix.

        The fix will be available in the next Cinema 4D update.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • K
          kng_ito
          last edited by

          Great, thank you!

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

            Hi this bug was fixed with release 2023.0 of Cinema 4D.

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

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