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

    Mouse position when Tool Data inactive?

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

      Hello all,

      I've found quite a few posts on querying mouse position, but the only reliable things seem to be the ToolData's MouseInput() and gui's GetInputState().  In my case, the problem with the former is that you can only call it while that tool is active, and the problem with the latter is I can only get it to return True when I'm holding down a mouse button, not when I only click once.

      My end goal is to shoot a ray on left mouse button down like a ToolData might, but while, say, the live selection or move tool is active, and this first step is just me trying to get the mouse position.

      Thanks in advance for any advice!  If any of this doesn't make sense, lemme know 🙂

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

        On 18/04/2016 at 10:38, xxxxxxxx wrote:

        Hi,

        I'm afraid, what you are trying to do, is impossible in Python.
        It partly is a conceptual thing. In general you need to write a ToolData plugin to get control over the viewport and mouse input (as you already know and wrote). And you can not (and are not supposed to) interfere with other tools.
        Having said this, I'll now tell the opposite. In the C++ SDK there is something called a SceneHook (not available in Python SDK), which offers means to do something like this. Yet, it is recommended to behave nicely, with the provided powers.

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

          On 18/04/2016 at 11:01, xxxxxxxx wrote:

          Ah--thanks very much, as usual, Andreas 🙂

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