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
    • Register
    • Login

    Getting some weird console output from GeDialog.Timer()

    Scheduled Pinned Locked Moved Cinema 4D SDK
    python2026
    3 Posts 2 Posters 25 Views 1 Watching
    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.
    • B Offline
      blkmsk
      last edited by

      Hello there^^

      I wanted to implement the GeDialoge.Timer() in one of my scripts and realized that it creates some
      output in the console and I dont know where its coming from or how to prevent it.

      When I run this example script:

      import c4d
      from c4d import gui
      
      _dlg = None
      
      
      class TimerTestDialog(gui.GeDialog):
          ID_STATUS = 1000
          ID_BTN = 1001
      
          def __init__(self):
              super().__init__()
              self._ticks = 0
      
          def CreateLayout(self):
              self.SetTitle("Timer Test")
              self.AddStaticText(self.ID_STATUS, c4d.BFH_LEFT, name="Starting…")
              self.AddButton(self.ID_BTN, c4d.BFH_LEFT, name="Close Dialoge")
              self.SetTimer(1000)
              return True
      
          def Command(self, wid, msg):
              if wid == self.ID_BTN:
                  self.Close()
                  return True
              return False
      
          def Timer(self, msg):
              self._ticks += 1
              self.SetString(self.ID_STATUS, f"Ticks: {self._ticks}")
              return True
      
      
      def main():
          global _dlg
          _dlg = TimerTestDialog()
          _dlg.Open(c4d.DLG_TYPE_ASYNC, defaultw=260, defaulth=80)
      
      
      if __name__ == "__main__":
          main()
      

      I get the following console output:

      (null)(null)(null)(null)(null)(null)(null)骥pf(null)骥pf(null)(null)骥pf(null)(null)骥pf
      

      Has anyone else experienced this before?

      Thanks in advance for any help or hints!
      Cheers,
      Ben

      1 Reply Last reply Reply Quote 0
      • DunhouD Offline
        Dunhou
        last edited by

        Timer should return None:

            def Timer(self, msg: BaseContainer) -> None:
                """
                If you subscribe to timer events using :meth:`SetTimer` (x), this function is called every x'th millisecond.
            
                :type msg: BaseContainer
                :param msg: The raw timer message.
                """
                pass
        

        https://boghma.com
        https://github.com/DunHouGo

        1 Reply Last reply Reply Quote 1
        • B Offline
          blkmsk
          last edited by

          Thank you @Dunhou ! That solved it!

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