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
    1. Maxon Developers Forum
    2. pocacola
    P
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Groups 0

    pocacola

    @pocacola

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    pocacola Unfollow Follow

    Latest posts made by pocacola

    • How do I reproduce [IKeyPress, SHIFT + CTRL, [CanvasClick,[MouseHPos],[MouseVPos]]] in ZBrush Python?

      I’m trying to convert this ZScript behavior to ZBrush Python:
      [IKeyPress, SHIFT + CTRL, [CanvasClick,[MouseHPos],[MouseVPos]]]

      My Python attempt is:
      var = zbc.get_mouse_pos()
      zbc.press_key("SHIFT + CTRL", lambda: zbc.canvas_click(var[0], var[1]))

      I’ve also tried several variations of the shortcut string, but none of them work.

      What I already know:

      zbc.canvas_click(var[0], var[1]) works by itself.
      The problem only starts when I try to combine it with zbc.press_key().

      I already have a workaround by using zbc.press("macro button with [IKeyPress, SHIFT + CTRL, [CanvasClick,[MouseHPos],[MouseVPos]]] inside").

      What works and what doesn't:
      [Fails] zbc.press_key("CTRL+z")
      [Works] zbc.press_key("N", lambda: press("Document:New Document")) (don't know what "N" does)
      [Works] zbc.press_key("e", lambda: print("Scale mode enabled")) (don't know what "e" does)
      [Works] zbc.press_key("SHIFT+p", lambda: zbc.press("Tool:Subtool:MoveUp")) (correctly simulates moving subtool to the top, i had to add a key ("p") to the shift modifier for it to work)

      What i would like to have clarified:
      Is there a supported Python equivalent to ctrl + shift click?
      If zbc.press_key() is the wrong tool, what is it actually doing internally?
      Does it simulate real keyboard state?
      Does it support modifier-only combinations like SHIFT+CTRL without a normal key?
      Is this expected to fail with canvas_click() specifically?
      In other words, does press_key() work only for certain commands, but not for canvas interaction?
      I’m trying to avoid guesses here. A concrete answer about what press_key() can and cannot do would help a lot.

      posted in ZBrush SDK windows
      P
      pocacola