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

    SetCursorPos is Possible?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 335 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 01/09/2015 at 04:16, xxxxxxxx wrote:

      Hi!🙂

      Is Possible, set Cursor Position in Screen?
      I have this Python Code, but in Cinema4D not work....
      Thanks!

      def mousePos(cord) :
          win32api.SetCursorPos((x_pad + cord[0], y_pad + cord[1]))
           
      def get_cords() :
          x,y = win32api.GetCursorPos()
          x = x - x_pad
          y = y - y_pad
          print x,y

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

        On 02/09/2015 at 10:01, xxxxxxxx wrote:

        Hi,

        it looks like you are using ActivePython. We (SDK Support Team) have no experience with this and can't support it.
        Also I'm not aware of any C4D function to position the cursor.

        In general it may also be a bad idea to use Win32 stuff in plugins and scripts. At least, if you are planning to make it public, as it won't work on Mac. But I'm sure you are aware of this.

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

          On 02/09/2015 at 10:31, xxxxxxxx wrote:

          @ Runner009
          over net, you can find interesting and fun projects for python or extend it
          like https://pypi.python.org/pypi/PyAutoGUI
          Seems cross-platform tool

          example of using: http://tinypic.com/player.php?v=2emijiq%3E&s=8#.VecyEJfLKzk

          i use from examples, manual

          import c4d  
          import pyautogui, pytweening  
            
          def main() :  
            screenWidth, screenHeight = pyautogui.size()  
            currentMouseX, currentMouseY = pyautogui.position()  
            pyautogui.moveTo(500, 500, duration=2, tween = pytweening.easeOutQuad)  
            
          if __name__=='__main__':  
            main()
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post