mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
directtools: Import cluster code only on demand
This prevents importing directtools modules also importing cluster code, which may fail to import with Panda builds that have net code disabled
This commit is contained in:
parent
86ceade7b3
commit
17e3f3331c
@ -28,8 +28,6 @@ from .DirectSelection import SelectionRay, COA_ORIGIN, SelectedNodePaths
|
||||
from .DirectGrid import DirectGrid
|
||||
#from DirectGeometry import *
|
||||
from .DirectLights import DirectLights
|
||||
from direct.cluster.ClusterClient import createClusterClient, DummyClusterClient
|
||||
from direct.cluster.ClusterServer import ClusterServer
|
||||
## from direct.tkpanels import Placer
|
||||
## from direct.tkwidgets import Slider
|
||||
## from direct.tkwidgets import SceneGraphExplorer
|
||||
@ -319,10 +317,13 @@ class DirectSession(DirectObject):
|
||||
self.clusterMode = ConfigVariableString("cluster-mode", '').value
|
||||
|
||||
if self.clusterMode == 'client':
|
||||
from direct.cluster.ClusterClient import createClusterClient
|
||||
self.cluster = createClusterClient()
|
||||
elif self.clusterMode == 'server':
|
||||
from direct.cluster.ClusterServer import ClusterServer
|
||||
self.cluster = ClusterServer(base.camera, base.cam)
|
||||
else:
|
||||
from direct.cluster.ClusterClient import DummyClusterClient
|
||||
self.cluster = DummyClusterClient()
|
||||
__builtins__['cluster'] = self.cluster
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user