mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
Define dummy 3DConnexion interface in case module is not available
CURA-12404
This commit is contained in:
parent
f23e881478
commit
5cf52a5d85
1 changed files with 237 additions and 221 deletions
|
@ -1,4 +1,3 @@
|
||||||
import pynavlib.pynavlib_interface as pynav
|
|
||||||
from UM.Math.Matrix import Matrix
|
from UM.Math.Matrix import Matrix
|
||||||
from UM.Math.Vector import Vector
|
from UM.Math.Vector import Vector
|
||||||
from UM.Math.AxisAlignedBox import AxisAlignedBox
|
from UM.Math.AxisAlignedBox import AxisAlignedBox
|
||||||
|
@ -6,6 +5,10 @@ from cura.PickingPass import PickingPass
|
||||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from cura.Scene.OverlayNode import OverlayNode, SceneNode
|
from cura.Scene.OverlayNode import OverlayNode, SceneNode
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
|
try:
|
||||||
|
import pynavlib.pynavlib_interface as pynav
|
||||||
|
|
||||||
class NavlibClient(pynav.NavlibNavigationModel):
|
class NavlibClient(pynav.NavlibNavigationModel):
|
||||||
|
|
||||||
|
@ -262,3 +265,16 @@ class NavlibClient(pynav.NavlibNavigationModel):
|
||||||
else:
|
else:
|
||||||
self._scene.getRoot().removeChild(self._pivot_node)
|
self._scene.getRoot().removeChild(self._pivot_node)
|
||||||
|
|
||||||
|
except BaseException as exception:
|
||||||
|
Logger.warning(f"Unable to load 3DConnexion library: {exception}")
|
||||||
|
|
||||||
|
# Define dummy class instead so that integration is transparent from outside
|
||||||
|
class NavlibClient:
|
||||||
|
def __init__(self, scene, renderer) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def put_profile_hint(self, hint) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def enable_navigation(self, enabled) -> None:
|
||||||
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue