🎲 ViewDice Overlay (ViewCube)

I already have a pretty good working draft code that uses .push_tool .pop_tool. Without going “outside”. :innocent:

I created a ViewDiceClick_helper_Tool class, which push-pop-ed according to overlay onMouseMove “finding” the command or not.
In this “helper” the onLButtonDown, execute the command if there is a command in the overlay.

Looks like SU handles the tools stack and switching over to the right one - including that “temporary” native camera and other tools (which are using the same push-pop methods, I guess) - pretty fast and well.
I still needs to work on, but it’s really looks promising. :slight_smile:

So, I’m using the overlay as "very clear in the documentation " :wink: , and added a “hidden” helper tool.

ViewDice_clickhelper

3 Likes

The Overlay in SketchUp provides the onMouseMove method, making it easy to detect when the user hovers over the overlay elements I’m displaying. Based on that, I can push/pop a Ruby Tool to gain full control over mouse/keyboard events or revert to the previous active tool when needed. I’ve implemented this approach in Curic Scale++, Gizmo, or Camera Gizmo, providing an even better user experience than a standard Ruby Tool. :smiley:

7 Likes

Oh yeah, I came to that same conclusion too, as you see above. :v:

4 Likes

Can’t believe I didn’t think of that :see_no_evil:. Sounds like something I should do for component breadcrumbs to navigate up the model hierarchy.

Do you deactivate the overlay while the tool is active to avoid drawing twice?

2 Likes

I get rid of Tool mode of ViewDiceToolOV class completely. (Only earlier than SU2023 will be used as tool).
The OV mode always active (as far as user wants) and this will do the drawing and calculations, determine the actual command by mouse position…
From its onMouseMove method the helper tool class is pushed or pop-ed.
The new helper ViewDiceClickTool class contains mainly the onLButtonDown witch calls the ececute command method. There are some variables to share to other classes to keep track of activate and deactivate and some timer for repeat the command if mouse button keep pushed…and so on.
I hope within 1-2 weeks I will be able to release new beta.

(The shortcut key method still will be there, because e.g. the “hover point” of pan command is part of the model)

2 Likes

RC1 almost ready (a few more days to test)… little brake:

Diffusion:

2 Likes

Can you add a tooltip and center icon to the options to disable this? It may take some getting used to, but this flickering on the screen is distracting). Thank you :handshake:

I can’t!
… since it is already there: :wink:
image


image

(BTW, I also mentioned it in my first post…)

2 Likes

New release in the first post.

I kindly ask you to read that first post. All, again! Please! :innocent:

Important:
If you had Beta 1 installed, uninstall that first, restart SU and install this new version and restart SU again. Assign your keyboard shortcut again as mentioned in a first post.

(If you get, ignore the warning about the shortcut already assigned to ViewDice …)

1 Like

Bonus content:
D_V-Dice.skp (274.6 KB)

Thank you. It works perfectly for me.

1 Like