ZBrushCentral

zBrush + 3DConnexion = zConnexion

zConnexion adds 3DConnexion`s devices support to zBrush.

Versions:
v1.0 - will work in zB2018 or lower.
v1.1.1 - zB2020, 2020.1.1 2019. Also somewhat optimized performance.


Installation:

  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.

What works?
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 - dont ask me how rotation formulas work :))) I dont 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.

Wish I saw u/WintrySnowman post on Reddit earlier.


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 dont work in zscript since zBrush 2019. Im 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.

2 Likes

Wow! Just Wow!

You have made what people here have been asking both Pixologic and 3D Connexion to make for years. Years!

Back in a way older version of the 3DConnexion driver I was able to hack in (in ZBrush and Sculptris) the axis as keyboard shortcuts + mouse movements, but that meant the mouse cursor moved all over the place, and couldn’t sculpt while moving the SpaceNavigator.

So can you do the dream? Can you sculpt with a Wacom or mouse at the same time as navigating with the 3D Connexion device?

With the sin cos functions broken, another plugin author, Dargalos, said he was going to write his own functions to fix his plugins. Maybe it’s worth contacting him to see if this is something he may be willing to share with the community?

But seriously, that is amazing progress. I’m watching this with interest!


v1.1.1 - zB2020, 2020.1.1 (not tested, but should work in 2019). Also somewhat optimized performance.
Used routines for sin and cos by Fabio_Goncalves from here.

Can you sculpt with a Wacom or mouse at the same time as navigating with the 3D Connexion device?

I`m afraid not, due to the way zBrush works. This is purely for navigation.

Thank you so much for working on this.
I think you’ve compiled these with debug .DLL’s, so it’s not running on my system. I’ve tried 1.1 and 1.1.1

So 3 or 4 error messages depending on 1.1 or 1.1.1
The code execution cannot proceed because ucrtbased.dll was not found. Reinstalling the program may fix this problem.

Same for VCRUNTIME140D.dll and MSVCP140D.dll

I’ve tried installing the standard VC runtime redstibutable, however I thing you’ve used the debug versions, which are included with Visual studio?

Any help would be appreciated.

Best Regards

Sorry for inconvenience. I`m total noob in C++, dlls etc. Will have access to source code tomorrow, will try to figure something out. I compiled everything on one system, and then moved to another and everything worked fine, so I assumed there would be no problems. FYI I have Visual Studio installed on both machines.

Rebuilt with release option. Guess you will need some VC++ redist anyways (checked with dependency walker).
Also noticed a couple of interesting things.

  1. Unlike click & drag navigation, there is no adaptive viewport degradation when using TransformSet command in zscript - thus lags on high poly models. Does anyone know the way to turn on viewport degradation in zscript?
  2. Checked perfomance on i3-6100 - high poly model lags, yet CPU never reaches 100%.
    https://gum.co/AjmDo

That’s amazing! It works!
It didn’t at first, but that was me misreading you instrructions.
Thank you. Thank you. Thank you.

v1.2 - added support for 3DConnexion specific commands (like QuickZoomIn, change to top view, save view etc.).

v 1.2

yep, that works with my Spacenavigator.
I’ve paid a bit again becasue my first payment was more in the hope it worked rather than realistic expectation. You’ve done the impossible. Thank you. You’ve bought life back into hardware I bought to use with XSI. At least I can use it again now in ZBrush.

Just a question/sugestion for an updated version. At the moment it works like your holding the object in your hand, and moving the “puck” changes the position of the object. How about an alternative mode where moving the “puck” moves the camera instead? It might not be feasable, but it’s just how I got used to using it in XSI, and muscle memory, y’know.

Once again, thank you for breathing life back into this hardware.

Thank you, but this is absolutely not required. Times are difficult nowadays - better save for more material things.
As for “camera mode” (as it is called in 3DC documentation) - I cant say it is impossible, but Im not very optimistic either, sorry. Maybe something will come to mind.

Just installing now, if not already in, just leave a way to reverse the input directions. All axis reversed but the “push forward, pull back” axis reversed is “camera fly” mode technically.

Hello
Thank you so much for your contribution and hard work. Much appreciated. Is there a way to change the AXIS Direction? I’m accustomed to the 3D Mouse moving the opposite directions of the default. Thanks so much

Hello.
Thank you. To reverse the axis direction you can use “advanced settings” in driver properties utility.

I am in a mixed hardware environment, but these drivers are for Windows only, right?

I’m glad this has finally happening, but if I’m being honest part of me doesn’t want to buy one, because I’ve requested DCC app support for like 10 years and 3DConnexion has always pretty much ignored those requests…I know I can’t be the only one. I am kind of curious about why now.

Anyway I hope this is the beginning and 3DConnexion will extend support to blender, Maya, Max, Houdini, C4D etc.

Yep.

Its free.

I assure you, 3DConnexion are not the ones to blame here. Their SDK is absolutely comprehensive.

Hello.
Thanks so much for making this. I have a SpacePilot (non-pro), and it now works with ZBrush 2021.5.1 with your plugin using the “10.4.10” version. The Left, Right, Top and Front buttons are priceless.

After using it for a bit, a few feature requests: How would it work to optionally pivot around the last vertex clicked on (like ZBrush’s right click navigation) vs the center of the model, etc. that’s currently used? When one is sculpting close-up details like an eyelid, the broad rotations from the center tend to move you away from what you’re focused on.

Possible bug: If you happen to bump the SpacePilot knob while using standard ZBrush navigation like right click nav, ZBrush will freeze entirely for a second or two.

I believe the internal names of the drawing optimization parameters are QTransThreshold1, QTransThreshold2 and QEditThreshold, perhaps these could be used to optimize the rendering? Has ZBrush support gotten back to you with any tips here?

There can be large swings in how quickly the model moves depending on size and view, etc. — would it be possible to query the real time clock to make the updates more regular?

For folks using the plugin, I’ve mapped Esc and Shift to [ ] for changing the Draw Size (you can hold these down and they will auto-repeat!), and use the Panel button for Shift (Smooth Brush). Buttons 1-6 are Move Brush, DamStandard, Inflat, TrimDynamic, ClayBuildup, and hPolish. It’s so cool to see these on the LCD display. Fit is “f” of course (Frame), and Config set to Shift+F for PolyFrame. You pretty much do not need the keyboard at this point.

Thank you again.

@Butch007 - you can pick up a SpacePilot (100% compatible with this plugin) for well under <$100 USD if you look. And it has 18 configurable buttons and an LCD display.

Hi. Thank you.
Guess there is no need for plugin anymore.

Thank God Pixologic finally added native support. Adding proper local rotations via zScript is such a PITA.

Thanks to everyone who supported.

1 Like

Mate, thank you for making it. The cynic in me thinks without your nudge showing it’s possible, we might never have had actuall official support. It’s been asked for, for over a decade, and both sides blaming the other saying it’s down to them. You showed it was possible.
Thank you

1 Like