Wish I saw u/WintrySnowman post on Reddit earlier.
https://www.reddit.com/r/ZBrush/comment ... /?sort=old
I happened to work on zBrush/3DConnexion integration too.
I derived all rotation formulas and was thinking how to move all calculations to dll, as sin and cos don`t work in zscript since zBrush 2019.
I`m not very good at C++ (to say the least). Thus I upload this as a proof of concept, and so that more knowledgeable folks could use formulas in "zConnexion.txt". Doing everything in C++ will take me another year.
I only ask that, if you happen to make everything work, please pm the source code for me to learn.
zConnexion adds 3DConnexion`s devices support to zBrush.
*************************WILL WORK ONLY IN zBRUSH 2018 or lower ************************
(since 2019 SIN and COS are broken in zscript)
1. 3DConnexion driver needs to be installed in the system.
2. Copy "zConnexion.zsc", "zConnexion.dll" and "zConnexion.exe" to [zBrush folder]\ZStartup\ZPlugs64.
3. Make shortcut of "zConnexion.exe" and place it on desktop.
4. "zConnexion" subpalette will appear in "Tools" after next zBrush start.
CTRL+ALT CLICK - assign "F12" key as "Tools:zConnexion:Execute" button`s keyboard shortcut.
5. Start "zConnexion.exe".
How it works:
"zConnexion.exe" gets all data from spacemouse driver, then sends it to "zConnexion.dll"
and at the same time triggers "zConnexion.zsc" via virtual keystroke of "F12" button.
When "Tools:zConnexion:Execute" button is pressed, zscript reads data from "zConnexion.dll",
calculates new position and applies it with [TransformSet, ] command.
Basically everything (pan, zoom, rotate, pie menus, shortcuts assigned via 3DConnexion driver etc.)
EXCEPT 3DConnexion specific commands (like QickZoomIn, change to top view etc.).
Why .exe and not HID data:
Free pie menus that come with the 3DConnexion driver.
IMPORTANT NOTES / ISSUES:
1. While "zConnexion.exe" is running ALL data from spacemouse is routed to it, no matter what window is now in focus.
So when you switch to other than zBrush app, in order to have spacemouse support there, you need to close "zConnexion.exe".
2. Performance depends heavily on CPU speed. Navigations become laggy on high-poly models. Try increasing sensivity to somewhat mitigate that via:
"Tool:zConnexion:Pan sens." "Tool:zConnexion:Zoom sens." "Tool:zConnexion:Rot. sens." or 3DConnexion driver.
3. Sometimes model flips (very very rare), that is most likely due to the fact that we have access only to Euler angles and
not to more appropriate matrices or quaternions. Sorry i`m too tired to debug this, maybe later.
4. Those who want to dig into zScript code - don`t ask me how rotation formulas work ))
I don`t know myself, despite my hair being significantly more gray, than a year ago, when i started this project.
Guys and gals at Pixologic are very uncoventional, to say the least.
Tested on and works:
Windows: 10 64-bit Professional
If you wish to support:
If you have questions or comments concerning any non-support related 3Dconnexion topic, please use this forum.