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

    gui.TreeViewFunctions.InputEvent arguments error

    Cinema 4D SDK
    python
    2
    3
    386
    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.
    • mikeudinM
      mikeudin
      last edited by ferdinand

      Hello guys!
      There is a strange error when i trying to use InputEvent in TreeViewFunctions.

      da2f6250-c354-4e5e-9e40-2c1c83f75fc8-image.png

      def InputEvent(self, root, userdata, pArea, msg):
              
              if msg[c4d.BFM_INPUT_CHANNEL] == c4d.BFM_INPUT_MOUSELEFT: 
                  print "Left Mouse Pressed" 
      
              return True
      

      returns

      TypeError: InputEvent() takes exactly 5 arguments (4 given)
      

      Any idea how to fix it?
      Example plugin:
      TreeViewExample.pyp.txt

      Checkout my python tutorials, plugins, scripts, xpresso presets and more
      https://mikeudin.net

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

        Hi @mikeudin,

        Thanks for reporting this is a bug in c4d.gui.TreeViewFunctions.InputEvent. Only the two first parameter is correctly passed, the third one was passed as an int (nothing useful). So nothing in your sied to fix it.

        It's going to be fixed in the next Cinema 4D version.
        I will update the post once it's available.

        However, you could use MouseDown/DoubleClick.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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

          This bug is now resolved in R21 sp2.

          Cheers,
          Maxime

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

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