Short-key to show nav-cube?

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
MisterMaker
Posts: 740
Joined: Mon Sep 21, 2020 7:41 am

Short-key to show nav-cube?

Post by MisterMaker »

Ok here is an idea, that maybe or maybe not looks very similar to something that is already on the market.
The idea is too hide the nav cube by default and then when you need it, you hit space twice and it pop-ups into view really big.
Then you set the correct view and it hides again. Example on how this might look: https://youtu.be/Lq4LeClPrGM?t=23
Since we already can make the nav-cube bigger, I only need some way to hook it up to the spacebar to hide or show it. Maybe an auto-hide would be nice.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Short-key to show nav-cube?

Post by adrianinsaval »

spacebar is already used for a shortcut in FreeCAD so it might not be a good idea.
hide the nav cube by default
if you mean to have this as default behavior on FreeCAD master I disagree entirely, I like the current behavior better than solidworks, I do like the bigger corners and offset backfaces it has though.
User avatar
MisterMaker
Posts: 740
Joined: Mon Sep 21, 2020 7:41 am

Re: Short-key to show nav-cube?

Post by MisterMaker »

Not as default but the way I see it, this can be implemented with minimal effort as an option. Just add auto hide option and a key bind.
I'll try if I can make a macro that can do this.
User avatar
MisterMaker
Posts: 740
Joined: Mon Sep 21, 2020 7:41 am

Re: Short-key to show nav-cube?

Post by MisterMaker »

I was hoping this was just a simple command that would pop-up in a macro recording but seems like the macro doesn't record any settings changed in the settings menu.
Any here know how to turn off the navcube in a macro?
This is the nav cube cpp
https://github.com/FreeCAD/FreeCAD/blob ... viCube.cpp
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Short-key to show nav-cube?

Post by Roy_043 »

Code: Select all

import FreeCAD
import FreeCADGui

param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")
param.SetBool("ShowNaviCube", True)
FreeCADGui.ActiveDocument.ActiveView.redraw()
User avatar
MisterMaker
Posts: 740
Joined: Mon Sep 21, 2020 7:41 am

Re: Short-key to show nav-cube?

Post by MisterMaker »

Roy_043 wrote: Mon Jul 11, 2022 2:41 pm

Code: Select all

import FreeCAD
import FreeCADGui

param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")
param.SetBool("ShowNaviCube", True)
FreeCADGui.ActiveDocument.ActiveView.redraw()
That is awesome thanks! That was enough for me to get it working ended up with:

Code: Select all

import FreeCAD
import FreeCADGui

param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")

if param.GetBool('ShowNaviCube'):
  param.SetBool('ShowNaviCube',False)
  FreeCADGui.ActiveDocument.ActiveView.redraw()
else:
  param.SetBool('ShowNaviCube',True)
  FreeCADGui.ActiveDocument.ActiveView.redraw()	
It do lags a bit which is a shame.
Can see it work here:
https://twitter.com/MisterMakerNL_/stat ... 0488114177
Post Reply