3dConnexion for GH! ... somehow

Hi all!
Ultra-late evening (or early morning) madness here… I’ve got a flash!
Creating an out-of-screen active viewport and use the movement from there to move the gh canvas!
Very WIP, but still somehow useful … at least to understand if a proper plug-in should be made (or is it already?)
Some comment inside code.
Please BEWARE! Code not greatly stable…


3dconnexion_plugin_V2.gh (3.5 KB)

Have fun boyz! :laughing:

9 Likes

@osuire you seeing this?

1 Like

Hi Guys,

Yes, looks promissing.
Works for a sec or two and then zooms wildly out of control .

Looking forward to a more stable version :slight_smile:

1 Like

It is not happening to me. (it was, but i did already “fix” that on my machine)
What version of rhino and grasshopper do you have?

Version 6 SR13
(6.13.19058.371, 27/02/2019)
Commercial

Try to turn off grasshopper preview and reset/restart my script… does it work better?

Well, at some point, the view sways suddenly, and I have to hunt for my definition.
Also, it’s way too sensitive, and I have been using a 3D mouse for 15 years.
Maybe you could add a “sensitivity” input so that I don’t have to change that in the 3D Connexion settings which work fine for me in CAD and that I don’t want to change each time I go from GH to Rhino

There’s also the issue that I can’t access the tools in the menus…

Hi Riccardo, have you made a new version of this ?
Or maybe could you help me find out why it behaves like a bat on crack with my system ?
I don’t expect to live long enough to see GH2, so I set back my hopes on your hack…

1 Like

Hi Osuire.
I can see some reasons why it would “behave like a bat on crack” :rofl: .
Also, some additional tweaks are possible.

Anyway, i’m playing with things i don’t know.
It’s still the usual “pick random code from google results and mash up everything”.

I’ll edit this post later.

Edit:

Here it is!
Everything is a bit better now:

  • cursor in/out detection corrected to Grasshopper window instead of canvas:
  • it’s now possible to manually drag/zoom the canvas while the script is running;
  • added inputs for pan and zoom sensitivity.

The interesting thing is, like in rhino where we can use the 3d mouse while selecting functions or keypressing, her is the same… can sort of feel like actually have 2 1.5 hands!
Lame gif:


3dconnexion_plugin_V0.6.gh (12.9 KB)
(I can’t edit first post, but it would be good to remove the old version… or replace it)

This is still the same initial BAD code: it gets 3d connexion inputs by using a “decoy” viewport and aggressively resets it, and updates grasshopper canvas all the time!
This surely affect negatively rhino and grasshopper UI performance.
Stability is not known, I’ve played with it just during the coding +10 minutes.
It should be considered only as proof of concept.

Anyway, I hope it will be useful in some way.

1 Like

First version was “V2” ; new version is “V0.6”.
Looks like a count-down…
Will my computer take off for orbit in next version ?
:slight_smile:

Thank-you Riccardo !!!

This time, it works !
The fans of my laptop are at maximum speed though.
10…9…8…

It works here really fine except the additional Rhino vieport that keeps appearing after killing it and, once there, stays behind GH canvas.

I realized this tool can’t be seen as not-beta, so a version numbering >1 is needed. The first should be considered 0.2 … (Sadly I can’t edit first post…)
You can edit the code at “zoomsens” and change values.
I’ve seen default max zoom-in is 50 and max zoom-out is 0.05 … i wouldn’t go smaller than 0.01… try changes when you have nothing to lose on rhino/gh :rofl:

That’s meant to appear.
Read the description, you can hide that by moving it out of the screen.

Yeah, this doesn’t bother me.
What does is the strain it appears to put on the system.

FWIW, I noticed that the panning and zooming is more fluid when the GH window is maximized…

It’s totally expected.

But… i can’t replicate it.
I mean, it’s laggish to me too, but on my system cpu and gpu are not stressed, even with big definitions.

The last change i could make would be to not update the canvas if the decoy viewport is unchanged (read as, 3d mouse not touched)

Are you on a laptop or desktop ?
Laptop here, with hungry graphics card…

That would make plenty of sense.

Desktop.

To be hones, anyway, I’ve made this tool just to try how it would be… personally i’m not sure i would activate this, even if with a good performance.
I like that the 3dmouse let me navigate the 3d space anytime, whatever the windows rhino display over the viewport… grasshopper not excluded!
The face that we can navigate the 3d space while working on grasshopper is priceless.

This is why i’ve added the last functionality:

  • not updating canvas if decoy viewport is unchanged, indeed, it make sense.
  • left and right mouse buttons: while you click and hold both simultaneously, the script will be temp disabled.

3dconnexion_plugin_V0.65.gh (11.5 KB)

1 Like

Just noticed a problem with this new version 0.65, but in fact, it’s also there in V0.6 ; I just hadn’t noticed it :

As you can see, the perspective view is fine, but the projected views get reset whenever the cursor moves from Rhino to GH.

That’s “Linked viewport” option. I’ve never used it…
It seems that every viewport with parallel projection is automatically linked to the others.
Not sure how to avoid this for a single viewport…

And I think you’re not missing much indeed.
Unchecked the option, and the jiggly behavior is gone.
Man ! This little hack is really sweet !

Thank you so much !