mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 11:05:57 +08:00
Define dummy 3DConnexion interface in case module is not available
CURA-12404
This commit is contained in:
parent
f23e881478
commit
5cf52a5d85
@ -1,4 +1,3 @@
|
||||
import pynavlib.pynavlib_interface as pynav
|
||||
from UM.Math.Matrix import Matrix
|
||||
from UM.Math.Vector import Vector
|
||||
from UM.Math.AxisAlignedBox import AxisAlignedBox
|
||||
@ -6,8 +5,12 @@ from cura.PickingPass import PickingPass
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from cura.Scene.OverlayNode import OverlayNode, SceneNode
|
||||
from UM.Resources import Resources
|
||||
from UM.Logger import Logger
|
||||
|
||||
class NavlibClient(pynav.NavlibNavigationModel):
|
||||
try:
|
||||
import pynavlib.pynavlib_interface as pynav
|
||||
|
||||
class NavlibClient(pynav.NavlibNavigationModel):
|
||||
|
||||
def __init__(self, scene, renderer) -> None:
|
||||
super().__init__(False, pynav.NavlibOptions.RowMajorOrder)
|
||||
@ -262,3 +265,16 @@ class NavlibClient(pynav.NavlibNavigationModel):
|
||||
else:
|
||||
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…
x
Reference in New Issue
Block a user