Browse Source

direct: Cut down on usage of `import *` (#1454)

* Remove most `import *`s in `direct`

* Address feedback
WMOkiishi 2 years ago
parent
commit
c7c70bc32a
100 changed files with 659 additions and 333 deletions
  1. 23 1
      direct/src/actor/Actor.py
  2. 21 3
      direct/src/cluster/ClusterClient.py
  3. 1 1
      direct/src/cluster/ClusterConfig.py
  4. 1 1
      direct/src/cluster/ClusterMsgs.py
  5. 27 3
      direct/src/cluster/ClusterServer.py
  6. 1 1
      direct/src/controls/BattleWalker.py
  7. 1 1
      direct/src/controls/DevWalker.py
  8. 16 1
      direct/src/controls/GravityWalker.py
  9. 14 1
      direct/src/controls/NonPhysicsWalker.py
  10. 7 1
      direct/src/controls/ObserverWalker.py
  11. 25 2
      direct/src/controls/PhysicsWalker.py
  12. 5 2
      direct/src/controls/TwoDWalker.py
  13. 1 2
      direct/src/directbase/TestStart.py
  14. 1 2
      direct/src/directbase/ThreeUpStart.py
  15. 9 2
      direct/src/directdevices/DirectDeviceManager.py
  16. 2 1
      direct/src/directdevices/DirectFastrak.py
  17. 3 3
      direct/src/directdevices/DirectJoybox.py
  18. 1 2
      direct/src/directdevices/DirectRadamec.py
  19. 9 1
      direct/src/directscripts/eggcacher.py
  20. 24 22
      direct/src/directtools/DirectCameraControl.py
  21. 18 4
      direct/src/directtools/DirectGeometry.py
  22. 4 4
      direct/src/directtools/DirectGrid.py
  23. 11 1
      direct/src/directtools/DirectLights.py
  24. 64 42
      direct/src/directtools/DirectManipulation.py
  25. 40 22
      direct/src/directtools/DirectSelection.py
  26. 38 23
      direct/src/directtools/DirectSession.py
  27. 0 2
      direct/src/directtools/DirectUtil.py
  28. 15 3
      direct/src/directutil/Mopath.py
  29. 1 1
      direct/src/dist/FreezeTool.py
  30. 1 1
      direct/src/dist/icon.py
  31. 2 1
      direct/src/distributed/AsyncRequest.py
  32. 13 1
      direct/src/distributed/ClientRepository.py
  33. 8 4
      direct/src/distributed/ClientRepositoryBase.py
  34. 2 2
      direct/src/distributed/ConnectionRepository.py
  35. 2 3
      direct/src/distributed/DistributedCamera.py
  36. 0 2
      direct/src/distributed/DistributedCameraOV.py
  37. 2 5
      direct/src/distributed/DistributedCartesianGrid.py
  38. 0 3
      direct/src/distributed/DistributedCartesianGridAI.py
  39. 1 2
      direct/src/distributed/DistributedObject.py
  40. 0 2
      direct/src/distributed/DistributedObjectAI.py
  41. 0 2
      direct/src/distributed/DistributedObjectUD.py
  42. 4 3
      direct/src/distributed/DistributedSmoothNode.py
  43. 1 1
      direct/src/distributed/DistributedSmoothNodeBase.py
  44. 11 5
      direct/src/distributed/DoInterestManager.py
  45. 1 3
      direct/src/distributed/GridParent.py
  46. 22 2
      direct/src/distributed/PyDatagram.py
  47. 22 2
      direct/src/distributed/PyDatagramIterator.py
  48. 2 2
      direct/src/distributed/SampleObject.py
  49. 33 3
      direct/src/distributed/ServerRepository.py
  50. 1 2
      direct/src/distributed/TimeManager.py
  51. 2 2
      direct/src/distributed/TimeManagerAI.py
  52. 1 1
      direct/src/filter/FilterManager.py
  53. 2 2
      direct/src/gui/DirectButton.py
  54. 2 2
      direct/src/gui/DirectCheckBox.py
  55. 3 3
      direct/src/gui/DirectCheckButton.py
  56. 3 3
      direct/src/gui/DirectDialog.py
  57. 2 2
      direct/src/gui/DirectEntry.py
  58. 3 4
      direct/src/gui/DirectEntryScroll.py
  59. 2 2
      direct/src/gui/DirectFrame.py
  60. 11 4
      direct/src/gui/DirectGuiBase.py
  61. 9 1
      direct/src/gui/DirectGuiGlobals.py
  62. 3 2
      direct/src/gui/DirectGuiTest.py
  63. 2 2
      direct/src/gui/DirectLabel.py
  64. 3 4
      direct/src/gui/DirectOptionMenu.py
  65. 3 3
      direct/src/gui/DirectRadioButton.py
  66. 3 3
      direct/src/gui/DirectScrollBar.py
  67. 3 3
      direct/src/gui/DirectScrolledFrame.py
  68. 3 3
      direct/src/gui/DirectScrolledList.py
  69. 3 3
      direct/src/gui/DirectSlider.py
  70. 2 2
      direct/src/gui/DirectWaitBar.py
  71. 1 1
      direct/src/gui/OnscreenGeom.py
  72. 1 1
      direct/src/gui/OnscreenImage.py
  73. 1 1
      direct/src/gui/OnscreenText.py
  74. 2 3
      direct/src/interval/ActorInterval.py
  75. 3 3
      direct/src/interval/AnimControlInterval.py
  76. 2 3
      direct/src/interval/FunctionInterval.py
  77. 2 3
      direct/src/interval/IndirectInterval.py
  78. 2 2
      direct/src/interval/Interval.py
  79. 2 3
      direct/src/interval/IntervalManager.py
  80. 15 3
      direct/src/interval/IntervalTest.py
  81. 1 1
      direct/src/interval/LerpBlendHelpers.py
  82. 3 3
      direct/src/interval/LerpInterval.py
  83. 3 3
      direct/src/interval/MetaInterval.py
  84. 1 3
      direct/src/interval/MopathInterval.py
  85. 1 2
      direct/src/interval/ParticleInterval.py
  86. 2 3
      direct/src/interval/ProjectileInterval.py
  87. 2 3
      direct/src/interval/ProjectileIntervalTest.py
  88. 2 3
      direct/src/interval/SoundInterval.py
  89. 1 2
      direct/src/interval/TestInterval.py
  90. 1 1
      direct/src/leveleditor/ActionMgr.py
  91. 0 2
      direct/src/leveleditor/AnimControlUI.py
  92. 1 1
      direct/src/leveleditor/AnimMgr.py
  93. 3 1
      direct/src/leveleditor/AnimMgrBase.py
  94. 0 2
      direct/src/leveleditor/CurveAnimUI.py
  95. 2 4
      direct/src/leveleditor/CurveEditor.py
  96. 0 1
      direct/src/leveleditor/GraphEditorUI.py
  97. 0 1
      direct/src/leveleditor/LayerEditorUI.py
  98. 9 7
      direct/src/leveleditor/LevelEditor.py
  99. 19 9
      direct/src/leveleditor/LevelEditorBase.py
  100. 1 1
      direct/src/leveleditor/LevelEditorUI.py

+ 23 - 1
direct/src/actor/Actor.py

@@ -6,7 +6,29 @@ to learn more about loading animated models.
 
 
 __all__ = ['Actor']
 __all__ = ['Actor']
 
 
-from panda3d.core import *
+from panda3d.core import (
+    AnimBundleNode,
+    AnimControlCollection,
+    Character,
+    ConfigVariableBool,
+    DecalEffect,
+    Filename,
+    GlobPattern,
+    LineStream,
+    LoaderOptions,
+    LODNode,
+    ModelNode,
+    MovingPartBase,
+    MovingPartMatrix,
+    NodePath,
+    PandaNode,
+    PartBundle,
+    PartSubset,
+    Point3,
+    TransformState,
+    Vec3,
+    autoBind,
+)
 from panda3d.core import Loader as PandaLoader
 from panda3d.core import Loader as PandaLoader
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.Loader import Loader
 from direct.showbase.Loader import Loader

+ 21 - 3
direct/src/cluster/ClusterClient.py

@@ -1,8 +1,26 @@
 """ClusterClient: Master for multi-piping or PC clusters."""
 """ClusterClient: Master for multi-piping or PC clusters."""
 
 
-from panda3d.core import *
-from .ClusterMsgs import *
-from .ClusterConfig import *
+from panda3d.core import (
+    ClockObject,
+    ConnectionWriter,
+    Point3,
+    QueuedConnectionManager,
+    QueuedConnectionReader,
+    VBase3,
+    Vec3,
+    decomposeMatrix,
+)
+from .ClusterMsgs import (
+    CLUSTER_DAEMON_PORT,
+    CLUSTER_NAMED_MOVEMENT_DONE,
+    CLUSTER_NAMED_OBJECT_MOVEMENT,
+    CLUSTER_NONE,
+    CLUSTER_SERVER_PORT,
+    CLUSTER_SWAP_READY,
+    SERVER_STARTUP_STRING,
+    ClusterMsgHandler,
+)
+from .ClusterConfig import ClientConfigs
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.task import Task
 from direct.task import Task

+ 1 - 1
direct/src/cluster/ClusterConfig.py

@@ -1,5 +1,5 @@
 
 
-from .ClusterClient import *
+from panda3d.core import Vec3
 
 
 #: A dictionary of information for various cluster configurations.
 #: A dictionary of information for various cluster configurations.
 #: Dictionary is keyed on cluster-config string
 #: Dictionary is keyed on cluster-config string

+ 1 - 1
direct/src/cluster/ClusterMsgs.py

@@ -3,7 +3,7 @@
 # This module is intended to supply routines and dataformats common to
 # This module is intended to supply routines and dataformats common to
 # both ClusterClient and ClusterServer.
 # both ClusterClient and ClusterServer.
 
 
-from panda3d.core import *
+from panda3d.core import NetDatagram
 from direct.distributed.PyDatagram import PyDatagram
 from direct.distributed.PyDatagram import PyDatagram
 from direct.distributed.PyDatagramIterator import PyDatagramIterator
 from direct.distributed.PyDatagramIterator import PyDatagramIterator
 import time
 import time

+ 27 - 3
direct/src/cluster/ClusterServer.py

@@ -1,6 +1,30 @@
-from panda3d.core import *
-from .ClusterMsgs import *
-from direct.distributed.MsgTypes import *
+from panda3d.core import (
+    ClockObject,
+    ConnectionWriter,
+    NetAddress,
+    PointerToConnection,
+    QueuedConnectionListener,
+    QueuedConnectionManager,
+    QueuedConnectionReader,
+    Vec3,
+)
+from .ClusterMsgs import (
+    CLUSTER_CAM_FRUSTUM,
+    CLUSTER_CAM_MOVEMENT,
+    CLUSTER_CAM_OFFSET,
+    CLUSTER_COMMAND_STRING,
+    CLUSTER_DAEMON_PORT,
+    CLUSTER_EXIT,
+    CLUSTER_NAMED_MOVEMENT_DONE,
+    CLUSTER_NAMED_OBJECT_MOVEMENT,
+    CLUSTER_NONE,
+    CLUSTER_SELECTED_MOVEMENT,
+    CLUSTER_SERVER_PORT,
+    CLUSTER_SWAP_NOW,
+    CLUSTER_SWAP_READY,
+    CLUSTER_TIME_DATA,
+    ClusterMsgHandler,
+)
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.task import Task
 from direct.task import Task

+ 1 - 1
direct/src/controls/BattleWalker.py

@@ -2,7 +2,7 @@
 from direct.showbase.InputStateGlobal import inputState
 from direct.showbase.InputStateGlobal import inputState
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.task.Task import Task
 from direct.task.Task import Task
-from panda3d.core import *
+from panda3d.core import ClockObject, Mat3, Point3, Vec3
 from . import GravityWalker
 from . import GravityWalker
 
 
 BattleStrafe = 0
 BattleStrafe = 0

+ 1 - 1
direct/src/controls/DevWalker.py

@@ -22,7 +22,7 @@ from direct.showbase import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from panda3d.core import *
+from panda3d.core import ClockObject, ConfigVariableBool, ConfigVariableDouble, Mat3, Point3, Vec3
 
 
 
 
 class DevWalker(DirectObject.DirectObject):
 class DevWalker(DirectObject.DirectObject):

+ 16 - 1
direct/src/controls/GravityWalker.py

@@ -24,7 +24,22 @@ from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.extensions_native import VBase3_extensions
 from direct.extensions_native import VBase3_extensions
 from direct.extensions_native import VBase4_extensions
 from direct.extensions_native import VBase4_extensions
-from panda3d.core import *
+from panda3d.core import (
+    BitMask32,
+    ClockObject,
+    CollisionHandlerEvent,
+    CollisionHandlerFluidPusher,
+    CollisionHandlerGravity,
+    CollisionHandlerPusher,
+    CollisionNode,
+    CollisionRay,
+    CollisionSphere,
+    CollisionTraverser,
+    ConfigVariableBool,
+    Mat3,
+    Point3,
+    Vec3,
+)
 import math
 import math
 
 
 
 

+ 14 - 1
direct/src/controls/NonPhysicsWalker.py

@@ -23,7 +23,20 @@ from direct.showbase.InputStateGlobal import inputState
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from panda3d.core import *
+from panda3d.core import (
+    BitMask32,
+    ClockObject,
+    CollisionHandlerFloor,
+    CollisionHandlerPusher,
+    CollisionNode,
+    CollisionRay,
+    CollisionSphere,
+    CollisionTraverser,
+    ConfigVariableBool,
+    Mat3,
+    Point3,
+    Vec3,
+)
 
 
 class NonPhysicsWalker(DirectObject.DirectObject):
 class NonPhysicsWalker(DirectObject.DirectObject):
     notify = DirectNotifyGlobal.directNotify.newCategory("NonPhysicsWalker")
     notify = DirectNotifyGlobal.directNotify.newCategory("NonPhysicsWalker")

+ 7 - 1
direct/src/controls/ObserverWalker.py

@@ -16,7 +16,13 @@ although it does send messages that allow a listener to play sounds or
 animations based on walker events.
 animations based on walker events.
 """
 """
 
 
-from panda3d.core import *
+from panda3d.core import (
+    BitMask32,
+    CollisionHandlerPusher,
+    CollisionNode,
+    CollisionSphere,
+    CollisionTraverser,
+)
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from . import NonPhysicsWalker
 from . import NonPhysicsWalker
 
 

+ 25 - 2
direct/src/controls/PhysicsWalker.py

@@ -26,8 +26,31 @@ from direct.task.TaskManagerGlobal import taskMgr
 from direct.extensions_native import Mat3_extensions
 from direct.extensions_native import Mat3_extensions
 from direct.extensions_native import VBase3_extensions
 from direct.extensions_native import VBase3_extensions
 from direct.extensions_native import VBase4_extensions
 from direct.extensions_native import VBase4_extensions
-from panda3d.core import *
-from panda3d.physics import *
+from panda3d.core import (
+    BitMask32,
+    ClockObject,
+    CollisionHandlerFloor,
+    CollisionHandlerQueue,
+    CollisionNode,
+    CollisionRay,
+    CollisionSphere,
+    CollisionTraverser,
+    ConfigVariableBool,
+    LRotationf,
+    Mat3,
+    NodePath,
+    Point3,
+    Vec3,
+)
+from panda3d.physics import (
+    ActorNode,
+    ForceNode,
+    LinearEulerIntegrator,
+    LinearFrictionForce,
+    LinearVectorForce,
+    PhysicsCollisionHandler,
+    PhysicsManager,
+)
 import math
 import math
 
 
 #import LineStream
 #import LineStream

+ 5 - 2
direct/src/controls/TwoDWalker.py

@@ -2,9 +2,12 @@
 TwoDWalker.py is for controlling the avatars in a 2D scroller game environment.
 TwoDWalker.py is for controlling the avatars in a 2D scroller game environment.
 """
 """
 
 
-from .GravityWalker import *
+from .GravityWalker import GravityWalker
+from direct.directnotify.DirectNotifyGlobal import directNotify
+from direct.showbase.InputStateGlobal import inputState
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from panda3d.core import ConfigVariableBool
+from direct.task.Task import Task
+from panda3d.core import ConfigVariableBool, Vec3
 
 
 
 
 class TwoDWalker(GravityWalker):
 class TwoDWalker(GravityWalker):

+ 1 - 2
direct/src/directbase/TestStart.py

@@ -1,8 +1,7 @@
 print('TestStart: Starting up test environment.')
 print('TestStart: Starting up test environment.')
 
 
-from panda3d.core import *
+import direct.showbase.PythonUtil  # pylint: disable=unused-import
 
 
-from direct.showbase.PythonUtil import *
 from direct.showbase import ShowBase
 from direct.showbase import ShowBase
 base = ShowBase.ShowBase()
 base = ShowBase.ShowBase()
 
 

+ 1 - 2
direct/src/directbase/ThreeUpStart.py

@@ -1,9 +1,8 @@
 
 
 print('ThreeUpStart: Starting up environment.')
 print('ThreeUpStart: Starting up environment.')
 
 
-from panda3d.core import *
+import direct.showbase.PythonUtil  # pylint: disable=unused-import
 
 
-from direct.showbase.PythonUtil import *
 from direct.showbase import ThreeUpShow
 from direct.showbase import ThreeUpShow
 
 
 base = ThreeUpShow.ThreeUpShow()
 base = ThreeUpShow.ThreeUpShow()

+ 9 - 2
direct/src/directdevices/DirectDeviceManager.py

@@ -1,8 +1,15 @@
 """Class used to create and control VRPN devices."""
 """Class used to create and control VRPN devices."""
 
 
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from panda3d.core import *
-from panda3d.vrpn import *
+from panda3d.core import (
+    AnalogNode,
+    ButtonNode,
+    ConfigVariableDouble,
+    ConfigVariableString,
+    DialNode,
+    TrackerNode,
+)
+from panda3d.vrpn import VrpnClient
 
 
 ANALOG_MIN = -0.95
 ANALOG_MIN = -0.95
 ANALOG_MAX = 0.95
 ANALOG_MAX = 0.95

+ 2 - 1
direct/src/directdevices/DirectFastrak.py

@@ -1,8 +1,9 @@
 """ Class used to create and control radamec device """
 """ Class used to create and control radamec device """
+from panda3d.core import Vec3
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from .DirectDeviceManager import *
+from .DirectDeviceManager import DirectDeviceManager
 
 
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 
 

+ 3 - 3
direct/src/directdevices/DirectJoybox.py

@@ -1,11 +1,11 @@
 """ Class used to create and control joybox device """
 """ Class used to create and control joybox device """
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from .DirectDeviceManager import *
-from direct.directtools.DirectUtil import *
+from .DirectDeviceManager import ANALOG_DEADBAND, ANALOG_MAX, ANALOG_MIN, DirectDeviceManager
+from direct.directtools.DirectUtil import CLAMP
 from direct.gui import OnscreenText
 from direct.gui import OnscreenText
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from panda3d.core import ClockObject
+from panda3d.core import ButtonRegistry, ButtonThrower, ClockObject, NodePath, VBase3, Vec3
 
 
 import math
 import math
 
 

+ 1 - 2
direct/src/directdevices/DirectRadamec.py

@@ -1,9 +1,8 @@
 """ Class used to create and control radamec device """
 """ Class used to create and control radamec device """
-from math import *
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from .DirectDeviceManager import *
+from .DirectDeviceManager import DirectDeviceManager
 
 
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 
 

+ 9 - 1
direct/src/directscripts/eggcacher.py

@@ -11,7 +11,15 @@
 import os
 import os
 import sys
 import sys
 import gc
 import gc
-from panda3d.core import *
+from panda3d.core import (
+    BamCache,
+    ExecutionEnvironment,
+    Filename,
+    Loader,
+    LoaderOptions,
+    ModelPool,
+    TexturePool,
+)
 
 
 class EggCacher:
 class EggCacher:
     def __init__(self, args):
     def __init__(self, args):

+ 24 - 22
direct/src/directtools/DirectCameraControl.py

@@ -1,7 +1,9 @@
+import math
+from panda3d.core import BitMask32, Mat4, NodePath, Point3, VBase3, Vec3, Vec4, rad2Deg
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from .DirectUtil import *
-from .DirectGeometry import *
-from .DirectGlobals import *
+from .DirectUtil import CLAMP, useDirectRenderStyle
+from .DirectGeometry import getCrankAngle, getScreenXY
+from . import DirectGlobals as DG
 from .DirectSelection import SelectionRay
 from .DirectSelection import SelectionRay
 from direct.interval.IntervalGlobal import Sequence, Func
 from direct.interval.IntervalGlobal import Sequence, Func
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
@@ -218,9 +220,9 @@ class DirectCameraControl(DirectObject):
             # Allow intersection with unpickable objects
             # Allow intersection with unpickable objects
             # And then spawn task to determine mouse mode
             # And then spawn task to determine mouse mode
             # Don't intersect with hidden or backfacing objects
             # Don't intersect with hidden or backfacing objects
-            skipFlags = SKIP_HIDDEN | SKIP_BACKFACE
+            skipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE
             # Skip camera (and its children), unless control key is pressed
             # Skip camera (and its children), unless control key is pressed
-            skipFlags |= SKIP_CAMERA * (1 - base.getControl())
+            skipFlags |= DG.SKIP_CAMERA * (1 - base.getControl())
             self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags))
             self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags))
             # Record reference point
             # Record reference point
             self.coaMarkerRef.setPosHprScale(base.cam, 0, 0, 0, 0, 0, 0, 1, 1, 1)
             self.coaMarkerRef.setPosHprScale(base.cam, 0, 0, 0, 0, 0, 0, 1, 1, 1)
@@ -422,7 +424,7 @@ class DirectCameraControl(DirectObject):
 
 
         # Set at markers position in render coordinates
         # Set at markers position in render coordinates
         self.camManipRef.setPos(self.coaMarkerPos)
         self.camManipRef.setPos(self.coaMarkerPos)
-        self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
+        self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
         t = Task.Task(self.mouseRotateTask)
         t = Task.Task(self.mouseRotateTask)
         if abs(base.direct.dr.mouseX) > 0.9:
         if abs(base.direct.dr.mouseX) > 0.9:
             t.constrainedDir = 'y'
             t.constrainedDir = 'y'
@@ -454,7 +456,7 @@ class DirectCameraControl(DirectObject):
                 # flatten roll
                 # flatten roll
                 base.direct.camera.setR(0)
                 base.direct.camera.setR(0)
             self.camManipRef.setPos(self.coaMarkerPos)
             self.camManipRef.setPos(self.coaMarkerPos)
-            self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
+            self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
         else:
         else:
             if base.direct.camera.getPos().getZ() >=0 or not self.switchDirBelowZero:
             if base.direct.camera.getPos().getZ() >=0 or not self.switchDirBelowZero:
                 dirX = -1
                 dirX = -1
@@ -478,7 +480,7 @@ class DirectCameraControl(DirectObject):
         self.__stopManipulateCamera()
         self.__stopManipulateCamera()
         # Set at markers position in render coordinates
         # Set at markers position in render coordinates
         self.camManipRef.setPos(self.coaMarkerPos)
         self.camManipRef.setPos(self.coaMarkerPos)
-        self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
+        self.camManipRef.setHpr(base.direct.camera, DG.ZERO_POINT)
         t = Task.Task(self.mouseRollTask)
         t = Task.Task(self.mouseRollTask)
         t.coaCenter = getScreenXY(self.coaMarker)
         t.coaCenter = getScreenXY(self.coaMarker)
         t.lastAngle = getCrankAngle(t.coaCenter)
         t.lastAngle = getCrankAngle(t.coaCenter)
@@ -565,7 +567,7 @@ class DirectCameraControl(DirectObject):
             base.direct.message('COA Distance: ' + repr(dist))
             base.direct.message('COA Distance: ' + repr(dist))
             coa.set(0, dist, 0)
             coa.set(0, dist, 0)
         # Compute COA Dist
         # Compute COA Dist
-        coaDist = Vec3(coa - ZERO_POINT).length()
+        coaDist = Vec3(coa - DG.ZERO_POINT).length()
         if coaDist < (1.1 * dr.near):
         if coaDist < (1.1 * dr.near):
             coa.set(0, 100, 0)
             coa.set(0, 100, 0)
             coaDist = 100
             coaDist = 100
@@ -575,7 +577,7 @@ class DirectCameraControl(DirectObject):
     def updateCoa(self, ref2point, coaDist = None, ref = None):
     def updateCoa(self, ref2point, coaDist = None, ref = None):
         self.coa.set(ref2point[0], ref2point[1], ref2point[2])
         self.coa.set(ref2point[0], ref2point[1], ref2point[2])
         if not coaDist:
         if not coaDist:
-            coaDist = Vec3(self.coa - ZERO_POINT).length()
+            coaDist = Vec3(self.coa - DG.ZERO_POINT).length()
         # Place the marker in render space
         # Place the marker in render space
         if ref is None:
         if ref is None:
             # KEH: use the current display region
             # KEH: use the current display region
@@ -642,19 +644,19 @@ class DirectCameraControl(DirectObject):
         # Transform camera z axis to render space
         # Transform camera z axis to render space
         mCam2Render = Mat4(Mat4.identMat()) # [gjeon] fixed to give required argument
         mCam2Render = Mat4(Mat4.identMat()) # [gjeon] fixed to give required argument
         mCam2Render.assign(base.direct.camera.getMat(render))
         mCam2Render.assign(base.direct.camera.getMat(render))
-        zAxis = Vec3(mCam2Render.xformVec(Z_AXIS))
+        zAxis = Vec3(mCam2Render.xformVec(DG.Z_AXIS))
         zAxis.normalize()
         zAxis.normalize()
         # Compute rotation angle needed to upright cam
         # Compute rotation angle needed to upright cam
-        orbitAngle = rad2Deg(math.acos(CLAMP(zAxis.dot(Z_AXIS), -1, 1)))
+        orbitAngle = rad2Deg(math.acos(CLAMP(zAxis.dot(DG.Z_AXIS), -1, 1)))
         # Check angle
         # Check angle
         if orbitAngle < 0.1:
         if orbitAngle < 0.1:
             # Already upright
             # Already upright
             return
             return
         # Compute orthogonal axis of rotation
         # Compute orthogonal axis of rotation
-        rotAxis = Vec3(zAxis.cross(Z_AXIS))
+        rotAxis = Vec3(zAxis.cross(DG.Z_AXIS))
         rotAxis.normalize()
         rotAxis.normalize()
         # Find angle between rot Axis and render X_AXIS
         # Find angle between rot Axis and render X_AXIS
-        rotAngle = rad2Deg(math.acos(CLAMP(rotAxis.dot(X_AXIS), -1, 1)))
+        rotAngle = rad2Deg(math.acos(CLAMP(rotAxis.dot(DG.X_AXIS), -1, 1)))
         # Determine sign or rotation angle
         # Determine sign or rotation angle
         if rotAxis[1] < 0:
         if rotAxis[1] < 0:
             rotAngle *= -1
             rotAngle *= -1
@@ -685,7 +687,7 @@ class DirectCameraControl(DirectObject):
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Determine marker location
         # Determine marker location
         markerToCam = self.coaMarker.getPos(base.direct.camera)
         markerToCam = self.coaMarker.getPos(base.direct.camera)
-        dist = Vec3(markerToCam - ZERO_POINT).length()
+        dist = Vec3(markerToCam - DG.ZERO_POINT).length()
         scaledCenterVec = Y_AXIS * dist
         scaledCenterVec = Y_AXIS * dist
         delta = markerToCam - scaledCenterVec
         delta = markerToCam - scaledCenterVec
         self.camManipRef.setPosHpr(base.direct.camera, Point3(0), Point3(0))
         self.camManipRef.setPosHpr(base.direct.camera, Point3(0), Point3(0))
@@ -709,7 +711,7 @@ class DirectCameraControl(DirectObject):
         self.camManipRef.setPos(base.direct.camera, zoomPtToCam)
         self.camManipRef.setPos(base.direct.camera, zoomPtToCam)
         # Move to that point
         # Move to that point
         ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
         ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
-                                              ZERO_POINT,
+                                              DG.ZERO_POINT,
                                               other = self.camManipRef,
                                               other = self.camManipRef,
                                               blendType = 'easeInOut')
                                               blendType = 'easeInOut')
         ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
         ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
@@ -746,20 +748,20 @@ class DirectCameraControl(DirectObject):
         elif view == 7:
         elif view == 7:
             hprOffset.set(135., -35.264, 0.)
             hprOffset.set(135., -35.264, 0.)
         # Position target
         # Position target
-        self.camManipRef.setPosHpr(self.coaMarker, ZERO_VEC,
+        self.camManipRef.setPosHpr(self.coaMarker, DG.ZERO_VEC,
                                    hprOffset)
                                    hprOffset)
         # Scale center vec by current distance to target
         # Scale center vec by current distance to target
         offsetDistance = Vec3(base.direct.camera.getPos(self.camManipRef) -
         offsetDistance = Vec3(base.direct.camera.getPos(self.camManipRef) -
-                              ZERO_POINT).length()
+                              DG.ZERO_POINT).length()
         scaledCenterVec = Y_AXIS * (-1.0 * offsetDistance)
         scaledCenterVec = Y_AXIS * (-1.0 * offsetDistance)
         # Now put the camManipRef at that point
         # Now put the camManipRef at that point
         self.camManipRef.setPosHpr(self.camManipRef,
         self.camManipRef.setPosHpr(self.camManipRef,
                                    scaledCenterVec,
                                    scaledCenterVec,
-                                   ZERO_VEC)
+                                   DG.ZERO_VEC)
         # Record view for next time around
         # Record view for next time around
         self.lastView = view
         self.lastView = view
         ival = base.direct.camera.posHprInterval(CAM_MOVE_DURATION,
         ival = base.direct.camera.posHprInterval(CAM_MOVE_DURATION,
-                                                 pos = ZERO_POINT,
+                                                 pos = DG.ZERO_POINT,
                                                  hpr = VBase3(0, 0, self.orthoViewRoll),
                                                  hpr = VBase3(0, 0, self.orthoViewRoll),
                                                  other = self.camManipRef,
                                                  other = self.camManipRef,
                                                  blendType = 'easeInOut')
                                                  blendType = 'easeInOut')
@@ -776,9 +778,9 @@ class DirectCameraControl(DirectObject):
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
 
 
         # Coincident with widget
         # Coincident with widget
-        self.camManipRef.setPos(self.coaMarker, ZERO_POINT)
+        self.camManipRef.setPos(self.coaMarker, DG.ZERO_POINT)
         # But aligned with render space
         # But aligned with render space
-        self.camManipRef.setHpr(ZERO_POINT)
+        self.camManipRef.setHpr(DG.ZERO_POINT)
 
 
         parent = base.direct.camera.getParent()
         parent = base.direct.camera.getParent()
         base.direct.camera.wrtReparentTo(self.camManipRef)
         base.direct.camera.wrtReparentTo(self.camManipRef)

+ 18 - 4
direct/src/directtools/DirectGeometry.py

@@ -1,7 +1,21 @@
-
-from panda3d.core import *
-from .DirectGlobals import *
-from .DirectUtil import *
+from panda3d.core import (
+    CSDefault,
+    GeomNode,
+    LineSegs,
+    Mat4,
+    NodePath,
+    Point3,
+    Quat,
+    VBase3,
+    VBase4,
+    Vec3,
+    composeMatrix,
+    decomposeMatrix,
+    deg2Rad,
+    rad2Deg,
+)
+from .DirectGlobals import Q_EPSILON, UNIT_VEC, ZERO_VEC
+from .DirectUtil import CLAMP
 import math
 import math
 
 
 class LineNodePath(NodePath):
 class LineNodePath(NodePath):

+ 4 - 4
direct/src/directtools/DirectGrid.py

@@ -1,8 +1,8 @@
-
-from panda3d.core import *
+import math
+from panda3d.core import NodePath, Point3, VBase4
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-from .DirectUtil import *
-from .DirectGeometry import *
+from .DirectUtil import ROUND_TO, useDirectRenderStyle
+from .DirectGeometry import LineNodePath
 
 
 
 
 class DirectGrid(NodePath, DirectObject):
 class DirectGrid(NodePath, DirectObject):

+ 11 - 1
direct/src/directtools/DirectLights.py

@@ -1,5 +1,15 @@
 
 
-from panda3d.core import *
+from panda3d.core import (
+    AmbientLight,
+    DirectionalLight,
+    LightAttrib,
+    Material,
+    NodePath,
+    PerspectiveLens,
+    PointLight,
+    Spotlight,
+    VBase4,
+)
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 
 
 
 

+ 64 - 42
direct/src/directtools/DirectManipulation.py

@@ -1,10 +1,32 @@
+import math
+from panda3d.core import (
+    BitMask32,
+    BoundingHexahedron,
+    CSDefault,
+    Mat4,
+    NodePath,
+    Point3,
+    VBase3,
+    VBase4,
+    Vec3,
+    decomposeMatrix,
+    deg2Rad,
+)
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from .DirectGlobals import *
-from .DirectUtil import *
-from .DirectGeometry import *
+from . import DirectGlobals as DG
+from .DirectUtil import useDirectRenderStyle
+from .DirectGeometry import (
+    LineNodePath,
+    getCrankAngle,
+    getNearProjectionPoint,
+    getScreenXY,
+    planeIntersect,
+    relHpr,
+)
 from .DirectSelection import SelectionRay
 from .DirectSelection import SelectionRay
 from direct.task import Task
 from direct.task import Task
+from direct.task.TaskManagerGlobal import taskMgr
 from copy import deepcopy
 from copy import deepcopy
 
 
 
 
@@ -51,7 +73,7 @@ class DirectManipulationControl(DirectObject):
             ['shift-f', self.objectHandles.growToFit],
             ['shift-f', self.objectHandles.growToFit],
             ['i', self.plantSelectedNodePath],
             ['i', self.plantSelectedNodePath],
             ]
             ]
-        self.defaultSkipFlags = SKIP_HIDDEN | SKIP_BACKFACE
+        self.defaultSkipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE
         self.optionalSkipFlags = 0
         self.optionalSkipFlags = 0
         self.unmovableTagList = []
         self.unmovableTagList = []
 
 
@@ -115,7 +137,7 @@ class DirectManipulationControl(DirectObject):
            self.fScaling3D == 0:
            self.fScaling3D == 0:
 
 
             # Check for a widget hit point
             # Check for a widget hit point
-            entry = base.direct.iRay.pickWidget(skipFlags = SKIP_WIDGET)
+            entry = base.direct.iRay.pickWidget(skipFlags = DG.SKIP_WIDGET)
             # Did we hit a widget?
             # Did we hit a widget?
             if entry:
             if entry:
                 # Yes!
                 # Yes!
@@ -137,7 +159,7 @@ class DirectManipulationControl(DirectObject):
             if entry:
             if entry:
                 # Check to see if we are moving the object
                 # Check to see if we are moving the object
                 # We are moving the object if we either wait long enough
                 # We are moving the object if we either wait long enough
-                taskMgr.doMethodLater(MANIPULATION_MOVE_DELAY,
+                taskMgr.doMethodLater(DG.MANIPULATION_MOVE_DELAY,
                                       self.switchToMoveMode,
                                       self.switchToMoveMode,
                                       'manip-move-wait')
                                       'manip-move-wait')
                 # Or we move far enough
                 # Or we move far enough
@@ -213,7 +235,7 @@ class DirectManipulationControl(DirectObject):
         self.marquee.create()
         self.marquee.create()
 
 
         if self.fMultiView:
         if self.fMultiView:
-            LE_showInOneCam(self.marquee, base.direct.camera.getName())
+            DG.LE_showInOneCam(self.marquee, base.direct.camera.getName())
 
 
     def manipulationStop(self):
     def manipulationStop(self):
         taskMgr.remove('manipulateObject')
         taskMgr.remove('manipulateObject')
@@ -227,7 +249,7 @@ class DirectManipulationControl(DirectObject):
             # optionally specified things
             # optionally specified things
             skipFlags = self.defaultSkipFlags | self.optionalSkipFlags
             skipFlags = self.defaultSkipFlags | self.optionalSkipFlags
             # Skip camera (and its children), unless control key is pressed
             # Skip camera (and its children), unless control key is pressed
-            skipFlags |= SKIP_CAMERA * (1 - base.getControl())
+            skipFlags |= DG.SKIP_CAMERA * (1 - base.getControl())
 
 
             if self.marquee:
             if self.marquee:
                 self.marquee.removeNode()
                 self.marquee.removeNode()
@@ -269,18 +291,18 @@ class DirectManipulationControl(DirectObject):
 
 
                 selectionList = []
                 selectionList = []
                 for geom in render.findAllMatches("**/+GeomNode"):
                 for geom in render.findAllMatches("**/+GeomNode"):
-                    if (skipFlags & SKIP_HIDDEN) and geom.isHidden():
+                    if (skipFlags & DG.SKIP_HIDDEN) and geom.isHidden():
                         # Skip if hidden node
                         # Skip if hidden node
                         continue
                         continue
-##                     elif (skipFlags & SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():
+##                     elif (skipFlags & DG.SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():
 ##                         # Skip, if backfacing poly
 ##                         # Skip, if backfacing poly
 ##                         pass
 ##                         pass
-                    elif (skipFlags & SKIP_CAMERA) and \
+                    elif (skipFlags & DG.SKIP_CAMERA) and \
                          (base.camera in geom.getAncestors()):
                          (base.camera in geom.getAncestors()):
                         # Skip if parented to a camera.
                         # Skip if parented to a camera.
                         continue
                         continue
                     # Can pick unpickable, use the first visible node
                     # Can pick unpickable, use the first visible node
-                    elif (skipFlags & SKIP_UNPICKABLE) and \
+                    elif (skipFlags & DG.SKIP_UNPICKABLE) and \
                          (geom.getName() in base.direct.iRay.unpickable):
                          (geom.getName() in base.direct.iRay.unpickable):
                         # Skip if in unpickable list
                         # Skip if in unpickable list
                         continue
                         continue
@@ -500,7 +522,7 @@ class DirectManipulationControl(DirectObject):
         selectedList = base.direct.selected.getSelectedAsList()
         selectedList = base.direct.selected.getSelectedAsList()
         # See if any of the selected are completely uneditable
         # See if any of the selected are completely uneditable
         editTypes = self.getEditTypes(selectedList)
         editTypes = self.getEditTypes(selectedList)
-        if (editTypes & EDIT_TYPE_UNEDITABLE) == EDIT_TYPE_UNEDITABLE:
+        if (editTypes & DG.EDIT_TYPE_UNEDITABLE) == DG.EDIT_TYPE_UNEDITABLE:
             return
             return
         self.currEditTypes = editTypes
         self.currEditTypes = editTypes
         if selectedList:
         if selectedList:
@@ -568,13 +590,13 @@ class DirectManipulationControl(DirectObject):
             if self.constraint:
             if self.constraint:
                 type = self.constraint[2:]
                 type = self.constraint[2:]
                 if self.useSeparateScaleHandles:
                 if self.useSeparateScaleHandles:
-                    if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                    if type == 'post' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                         self.xlate1D(state)
                         self.xlate1D(state)
-                    elif type == 'disc' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                    elif type == 'disc' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                         self.xlate2D(state)
                         self.xlate2D(state)
-                    elif type == 'ring' and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
+                    elif type == 'ring' and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
                         self.rotate1D(state)
                         self.rotate1D(state)
-                    elif type == 'scale' and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
+                    elif type == 'scale' and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
                         if base.direct.fShift:
                         if base.direct.fShift:
                             self.fScaling3D = 1
                             self.fScaling3D = 1
                             self.scale3D(state)
                             self.scale3D(state)
@@ -582,7 +604,7 @@ class DirectManipulationControl(DirectObject):
                             self.fScaling1D = 1
                             self.fScaling1D = 1
                             self.scale1D(state)
                             self.scale1D(state)
                 else:
                 else:
-                    if base.direct.fControl and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
+                    if base.direct.fControl and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
                         if type == 'post':
                         if type == 'post':
                             # [gjeon] non-uniform scaling
                             # [gjeon] non-uniform scaling
                             self.fScaling1D = 1
                             self.fScaling1D = 1
@@ -592,11 +614,11 @@ class DirectManipulationControl(DirectObject):
                             self.fScaling3D = 1
                             self.fScaling3D = 1
                             self.scale3D(state)
                             self.scale3D(state)
                     else:
                     else:
-                        if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                        if type == 'post' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                             self.xlate1D(state)
                             self.xlate1D(state)
-                        elif type == 'disc' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                        elif type == 'disc' and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                             self.xlate2D(state)
                             self.xlate2D(state)
-                        elif type == 'ring' and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
+                        elif type == 'ring' and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
                             self.rotate1D(state)
                             self.rotate1D(state)
             # No widget interaction, determine free manip mode
             # No widget interaction, determine free manip mode
             elif self.fFreeManip and not self.useSeparateScaleHandles:
             elif self.fFreeManip and not self.useSeparateScaleHandles:
@@ -610,17 +632,17 @@ class DirectManipulationControl(DirectObject):
                     self.fScaling1D = 0
                     self.fScaling1D = 0
                     self.fScaling3D = 0
                     self.fScaling3D = 0
                 # Alt key switches to a scaling mode
                 # Alt key switches to a scaling mode
-                if base.direct.fControl and not self.currEditTypes & EDIT_TYPE_UNSCALABLE:
+                if base.direct.fControl and not self.currEditTypes & DG.EDIT_TYPE_UNSCALABLE:
                     self.fScaling3D = 1
                     self.fScaling3D = 1
                     self.scale3D(state)
                     self.scale3D(state)
                 # Otherwise, manip mode depends on where you started
                 # Otherwise, manip mode depends on where you started
-                elif state.fMouseX and state.fMouseY and not self.currEditTypes & EDIT_TYPE_UNROTATABLE:
+                elif state.fMouseX and state.fMouseY and not self.currEditTypes & DG.EDIT_TYPE_UNROTATABLE:
                     # In the corner, spin around camera's axis
                     # In the corner, spin around camera's axis
                     self.rotateAboutViewVector(state)
                     self.rotateAboutViewVector(state)
-                elif state.fMouseX or state.fMouseY and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                elif state.fMouseX or state.fMouseY and not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                     # Mouse started elsewhere in the outer frame, rotate
                     # Mouse started elsewhere in the outer frame, rotate
                     self.rotate2D(state)
                     self.rotate2D(state)
-                elif not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
+                elif not self.currEditTypes & DG.EDIT_TYPE_UNMOVABLE:
                     # Mouse started in central region, xlate
                     # Mouse started in central region, xlate
                     # Mode depends on shift key
                     # Mode depends on shift key
                     if base.direct.fShift or base.direct.fControl:
                     if base.direct.fShift or base.direct.fControl:
@@ -805,11 +827,11 @@ class DirectManipulationControl(DirectObject):
         widgetDir.normalize()
         widgetDir.normalize()
         # Convert specified widget axis to view space
         # Convert specified widget axis to view space
         if axis == 'x':
         if axis == 'x':
-            widgetAxis = Vec3(mWidget2Cam.xformVec(X_AXIS))
+            widgetAxis = Vec3(mWidget2Cam.xformVec(DG.X_AXIS))
         elif axis == 'y':
         elif axis == 'y':
-            widgetAxis = Vec3(mWidget2Cam.xformVec(Y_AXIS))
+            widgetAxis = Vec3(mWidget2Cam.xformVec(DG.Y_AXIS))
         elif axis == 'z':
         elif axis == 'z':
-            widgetAxis = Vec3(mWidget2Cam.xformVec(Z_AXIS))
+            widgetAxis = Vec3(mWidget2Cam.xformVec(DG.Z_AXIS))
         widgetAxis.normalize()
         widgetAxis.normalize()
         if type == 'top?':
         if type == 'top?':
             # Check sign of angle between two vectors
             # Check sign of angle between two vectors
@@ -868,7 +890,7 @@ class DirectManipulationControl(DirectObject):
                 moveDir.assign(moveDir * -1)
                 moveDir.assign(moveDir * -1)
             moveDir.normalize()
             moveDir.normalize()
         else:
         else:
-            moveDir = Vec3(Y_AXIS)
+            moveDir = Vec3(DG.Y_AXIS)
         # Move selected objects
         # Move selected objects
         dr = base.direct.dr
         dr = base.direct.dr
         # Scale move dir
         # Scale move dir
@@ -1043,7 +1065,7 @@ class DirectManipulationControl(DirectObject):
         """ Move selected object to intersection point of cursor on scene """
         """ Move selected object to intersection point of cursor on scene """
         # Check for intersection
         # Check for intersection
         entry = base.direct.iRay.pickGeom(
         entry = base.direct.iRay.pickGeom(
-            skipFlags = SKIP_HIDDEN | SKIP_BACKFACE | SKIP_CAMERA)
+            skipFlags = DG.SKIP_HIDDEN | DG.SKIP_BACKFACE | DG.SKIP_CAMERA)
         # MRM: Need to handle moving COA
         # MRM: Need to handle moving COA
         if entry is not None and base.direct.selected.last is not None:
         if entry is not None and base.direct.selected.last is not None:
             # Record undo point
             # Record undo point
@@ -1642,32 +1664,32 @@ class ObjectHandles(NodePath, DirectObject):
         # by comparing lineDir with plane normals.  The plane with the
         # by comparing lineDir with plane normals.  The plane with the
         # largest dotProduct is most "normal"
         # largest dotProduct is most "normal"
         if axis == 'x':
         if axis == 'x':
-            if abs(lineDir.dot(Y_AXIS)) > abs(lineDir.dot(Z_AXIS)):
+            if abs(lineDir.dot(DG.Y_AXIS)) > abs(lineDir.dot(DG.Z_AXIS)):
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, Y_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
             else:
             else:
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, Z_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
             # We really only care about the nearest point on the axis
             # We really only care about the nearest point on the axis
             self.hitPt.setY(0)
             self.hitPt.setY(0)
             self.hitPt.setZ(0)
             self.hitPt.setZ(0)
         elif axis == 'y':
         elif axis == 'y':
-            if abs(lineDir.dot(X_AXIS)) > abs(lineDir.dot(Z_AXIS)):
+            if abs(lineDir.dot(DG.X_AXIS)) > abs(lineDir.dot(DG.Z_AXIS)):
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, X_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
             else:
             else:
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, Z_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
             # We really only care about the nearest point on the axis
             # We really only care about the nearest point on the axis
             self.hitPt.setX(0)
             self.hitPt.setX(0)
             self.hitPt.setZ(0)
             self.hitPt.setZ(0)
         elif axis == 'z':
         elif axis == 'z':
-            if abs(lineDir.dot(X_AXIS)) > abs(lineDir.dot(Y_AXIS)):
+            if abs(lineDir.dot(DG.X_AXIS)) > abs(lineDir.dot(DG.Y_AXIS)):
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, X_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
             else:
             else:
                 self.hitPt.assign(
                 self.hitPt.assign(
-                    planeIntersect(lineOrigin, lineDir, ORIGIN, Y_AXIS))
+                    planeIntersect(lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
             # We really only care about the nearest point on the axis
             # We really only care about the nearest point on the axis
             self.hitPt.setX(0)
             self.hitPt.setX(0)
             self.hitPt.setY(0)
             self.hitPt.setY(0)
@@ -1722,13 +1744,13 @@ class ObjectHandles(NodePath, DirectObject):
         # Find the hit point
         # Find the hit point
         if plane == 'x':
         if plane == 'x':
             self.hitPt.assign(planeIntersect(
             self.hitPt.assign(planeIntersect(
-                lineOrigin, lineDir, ORIGIN, X_AXIS))
+                lineOrigin, lineDir, DG.ORIGIN, DG.X_AXIS))
         elif plane == 'y':
         elif plane == 'y':
             self.hitPt.assign(planeIntersect(
             self.hitPt.assign(planeIntersect(
-                lineOrigin, lineDir, ORIGIN, Y_AXIS))
+                lineOrigin, lineDir, DG.ORIGIN, DG.Y_AXIS))
         elif plane == 'z':
         elif plane == 'z':
             self.hitPt.assign(planeIntersect(
             self.hitPt.assign(planeIntersect(
-                lineOrigin, lineDir, ORIGIN, Z_AXIS))
+                lineOrigin, lineDir, DG.ORIGIN, DG.Z_AXIS))
 
 
         return self.hitPt
         return self.hitPt
 
 

+ 40 - 22
direct/src/directtools/DirectSelection.py

@@ -1,8 +1,26 @@
+from panda3d.core import (
+    BitMask32,
+    BoundingSphere,
+    CollisionHandlerQueue,
+    CollisionNode,
+    CollisionRay,
+    CollisionSegment,
+    CollisionSphere,
+    CollisionTraverser,
+    GeomNode,
+    Mat4,
+    NodePath,
+    Point3,
+    TransformState,
+    VBase4,
+    Vec3,
+    Vec4,
+)
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from .DirectGlobals import *
-from .DirectUtil import *
-from .DirectGeometry import *
+from . import DirectGlobals as DG
+from .DirectUtil import useDirectRenderStyle
+from .DirectGeometry import LineNodePath
 
 
 COA_ORIGIN = 0
 COA_ORIGIN = 0
 COA_CENTER = 1
 COA_CENTER = 1
@@ -439,7 +457,7 @@ class SelectionQueue(CollisionHandlerQueue):
         # Current index and entry in collision queue
         # Current index and entry in collision queue
         self.index = -1
         self.index = -1
         self.entry = None
         self.entry = None
-        self.skipFlags = SKIP_NONE
+        self.skipFlags = DG.SKIP_NONE
         # Create a collision node path attached to the given NP
         # Create a collision node path attached to the given NP
         self.collisionNodePath = NodePath(CollisionNode("collisionNP"))
         self.collisionNodePath = NodePath(CollisionNode("collisionNP"))
         self.setParentNP(parentNP)
         self.setParentNP(parentNP)
@@ -454,7 +472,7 @@ class SelectionQueue(CollisionHandlerQueue):
         # Let the traverser know about the collision node and the queue
         # Let the traverser know about the collision node and the queue
         self.ct.addCollider(self.collisionNodePath, self)
         self.ct.addCollider(self.collisionNodePath, self)
         # List of objects that can't be selected
         # List of objects that can't be selected
-        self.unpickable = UNPICKABLE
+        self.unpickable = DG.UNPICKABLE
         # Derived class must add Collider to complete initialization
         # Derived class must add Collider to complete initialization
 
 
     def setParentNP(self, parentNP):
     def setParentNP(self, parentNP):
@@ -548,10 +566,10 @@ class SelectionQueue(CollisionHandlerQueue):
         v.normalize()
         v.normalize()
         return v.dot(n) >= 0
         return v.dot(n) >= 0
 
 
-    def findNextCollisionEntry(self, skipFlags = SKIP_NONE):
+    def findNextCollisionEntry(self, skipFlags = DG.SKIP_NONE):
         return self.findCollisionEntry(skipFlags, self.index + 1)
         return self.findCollisionEntry(skipFlags, self.index + 1)
 
 
-    def findCollisionEntry(self, skipFlags = SKIP_NONE, startIndex = 0):
+    def findCollisionEntry(self, skipFlags = DG.SKIP_NONE, startIndex = 0):
         # Init self.index and self.entry
         # Init self.index and self.entry
         self.setCurrentIndex(-1)
         self.setCurrentIndex(-1)
         self.setCurrentEntry(None)
         self.setCurrentEntry(None)
@@ -559,28 +577,28 @@ class SelectionQueue(CollisionHandlerQueue):
         for i in range(startIndex, self.getNumEntries()):
         for i in range(startIndex, self.getNumEntries()):
             entry = self.getEntry(i)
             entry = self.getEntry(i)
             nodePath = entry.getIntoNodePath()
             nodePath = entry.getIntoNodePath()
-            if (skipFlags & SKIP_HIDDEN) and nodePath.isHidden():
+            if (skipFlags & DG.SKIP_HIDDEN) and nodePath.isHidden():
                 # Skip if hidden node
                 # Skip if hidden node
                 pass
                 pass
-            elif (skipFlags & SKIP_BACKFACE) and self.isEntryBackfacing(entry):
+            elif (skipFlags & DG.SKIP_BACKFACE) and self.isEntryBackfacing(entry):
                 # Skip, if backfacing poly
                 # Skip, if backfacing poly
                 pass
                 pass
-            elif (skipFlags & SKIP_CAMERA) and \
+            elif (skipFlags & DG.SKIP_CAMERA) and \
                  (base.camera in nodePath.getAncestors()):
                  (base.camera in nodePath.getAncestors()):
                 # Skip if parented to a camera.
                 # Skip if parented to a camera.
                 pass
                 pass
             # Can pick unpickable, use the first visible node
             # Can pick unpickable, use the first visible node
-            elif (skipFlags & SKIP_UNPICKABLE) and\
+            elif (skipFlags & DG.SKIP_UNPICKABLE) and\
                  (nodePath.getName() in self.unpickable):
                  (nodePath.getName() in self.unpickable):
                 # Skip if in unpickable list
                 # Skip if in unpickable list
                 pass
                 pass
             elif base.direct and\
             elif base.direct and\
-                 ((skipFlags & SKIP_WIDGET) and
+                 ((skipFlags & DG.SKIP_WIDGET) and
                 (nodePath.getTag('WidgetName') != base.direct.widget.getName())):
                 (nodePath.getTag('WidgetName') != base.direct.widget.getName())):
                 # Skip if this widget part is not belong to current widget
                 # Skip if this widget part is not belong to current widget
                 pass
                 pass
             elif base.direct and\
             elif base.direct and\
-                 ((skipFlags & SKIP_WIDGET) and base.direct.fControl and
+                 ((skipFlags & DG.SKIP_WIDGET) and base.direct.fControl and
                 (nodePath.getName()[2:] == 'ring')):
                 (nodePath.getName()[2:] == 'ring')):
                 # Skip when ununiformly scale in ortho view
                 # Skip when ununiformly scale in ortho view
                 pass
                 pass
@@ -623,7 +641,7 @@ class SelectionRay(SelectionQueue):
 
 
     def pickBitMask(self, bitMask = BitMask32.allOff(),
     def pickBitMask(self, bitMask = BitMask32.allOff(),
                     targetNodePath = None,
                     targetNodePath = None,
-                    skipFlags = SKIP_ALL):
+                    skipFlags = DG.SKIP_ALL):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithBitMask(bitMask)
         self.collideWithBitMask(bitMask)
@@ -631,7 +649,7 @@ class SelectionRay(SelectionQueue):
         # Determine collision entry
         # Determine collision entry
         return self.findCollisionEntry(skipFlags)
         return self.findCollisionEntry(skipFlags)
 
 
-    def pickGeom(self, targetNodePath = None, skipFlags = SKIP_ALL,
+    def pickGeom(self, targetNodePath = None, skipFlags = DG.SKIP_ALL,
                  xy = None):
                  xy = None):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
@@ -640,7 +658,7 @@ class SelectionRay(SelectionQueue):
         # Determine collision entry
         # Determine collision entry
         return self.findCollisionEntry(skipFlags)
         return self.findCollisionEntry(skipFlags)
 
 
-    def pickWidget(self, targetNodePath = None, skipFlags = SKIP_NONE):
+    def pickWidget(self, targetNodePath = None, skipFlags = DG.SKIP_NONE):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithWidget()
         self.collideWithWidget()
@@ -657,7 +675,7 @@ class SelectionRay(SelectionQueue):
 
 
     def pickGeom3D(self, targetNodePath = None,
     def pickGeom3D(self, targetNodePath = None,
                    origin = Point3(0), dir = Vec3(0, 0, -1),
                    origin = Point3(0), dir = Vec3(0, 0, -1),
-                   skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
+                   skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithGeom()
         self.collideWithGeom()
@@ -668,7 +686,7 @@ class SelectionRay(SelectionQueue):
     def pickBitMask3D(self, bitMask = BitMask32.allOff(),
     def pickBitMask3D(self, bitMask = BitMask32.allOff(),
                       targetNodePath = None,
                       targetNodePath = None,
                       origin = Point3(0), dir = Vec3(0, 0, -1),
                       origin = Point3(0), dir = Vec3(0, 0, -1),
-                      skipFlags = SKIP_ALL):
+                      skipFlags = DG.SKIP_ALL):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithBitMask(bitMask)
         self.collideWithBitMask(bitMask)
@@ -698,7 +716,7 @@ class SelectionSegment(SelectionQueue):
         self.numColliders += 1
         self.numColliders += 1
 
 
     def pickGeom(self, targetNodePath = None, endPointList = [],
     def pickGeom(self, targetNodePath = None, endPointList = [],
-                 skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
+                 skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithGeom()
         self.collideWithGeom()
@@ -713,7 +731,7 @@ class SelectionSegment(SelectionQueue):
 
 
     def pickBitMask(self, bitMask = BitMask32.allOff(),
     def pickBitMask(self, bitMask = BitMask32.allOff(),
                     targetNodePath = None, endPointList = [],
                     targetNodePath = None, endPointList = [],
-                 skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
+                 skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithBitMask(bitMask)
         self.collideWithBitMask(bitMask)
@@ -781,7 +799,7 @@ class SelectionSphere(SelectionQueue):
         return self.findCollisionEntry(skipFlags)
         return self.findCollisionEntry(skipFlags)
 
 
     def pickGeom(self, targetNodePath = None,
     def pickGeom(self, targetNodePath = None,
-                 skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
+                 skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithGeom()
         self.collideWithGeom()
@@ -789,7 +807,7 @@ class SelectionSphere(SelectionQueue):
 
 
     def pickBitMask(self, bitMask = BitMask32.allOff(),
     def pickBitMask(self, bitMask = BitMask32.allOff(),
                     targetNodePath = None,
                     targetNodePath = None,
-                    skipFlags = SKIP_HIDDEN | SKIP_CAMERA):
+                    skipFlags = DG.SKIP_HIDDEN | DG.SKIP_CAMERA):
         if targetNodePath is None:
         if targetNodePath is None:
             targetNodePath = render
             targetNodePath = render
         self.collideWithBitMask(bitMask)
         self.collideWithBitMask(bitMask)

+ 38 - 23
direct/src/directtools/DirectSession.py

@@ -1,13 +1,27 @@
 import math
 import math
 
 
-from panda3d.core import *
-from .DirectUtil import *
+from panda3d.core import (
+    CollisionNode,
+    ConfigVariableBool,
+    ConfigVariableString,
+    CSDefault,
+    NodePath,
+    Point3,
+    TextNode,
+    VBase3,
+    VBase4,
+    Vec3,
+    Vec4,
+    decomposeMatrix,
+    deg2Rad,
+)
+from .DirectUtil import useDirectRenderStyle
 
 
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.BulletinBoardGlobal import bulletinBoard as bboard
 from direct.showbase.BulletinBoardGlobal import bulletinBoard as bboard
 from direct.task import Task
 from direct.task import Task
 
 
-from .DirectGlobals import DIRECT_NO_MOD
+from . import DirectGlobals as DG
 from .DirectCameraControl import DirectCameraControl
 from .DirectCameraControl import DirectCameraControl
 from .DirectManipulation import DirectManipulationControl
 from .DirectManipulation import DirectManipulationControl
 from .DirectSelection import SelectionRay, COA_ORIGIN, SelectedNodePaths
 from .DirectSelection import SelectionRay, COA_ORIGIN, SelectedNodePaths
@@ -20,7 +34,8 @@ from direct.cluster.ClusterServer import ClusterServer
 ## from direct.tkwidgets import Slider
 ## from direct.tkwidgets import Slider
 ## from direct.tkwidgets import SceneGraphExplorer
 ## from direct.tkwidgets import SceneGraphExplorer
 from direct.gui import OnscreenText
 from direct.gui import OnscreenText
-from direct.interval.IntervalGlobal import *
+from direct.interval.IntervalGlobal import Func, Sequence
+from direct.task.TaskManagerGlobal import taskMgr
 
 
 class DirectSession(DirectObject):
 class DirectSession(DirectObject):
 
 
@@ -541,7 +556,7 @@ class DirectSession(DirectObject):
                     base.mouseWatcher = winCtrl.mouseWatcher
                     base.mouseWatcher = winCtrl.mouseWatcher
                     base.mouseWatcherNode = winCtrl.mouseWatcher.node()
                     base.mouseWatcherNode = winCtrl.mouseWatcher.node()
                     base.direct.dr.mouseUpdate()
                     base.direct.dr.mouseUpdate()
-                    LE_showInOneCam(self.selectedNPReadout, self.camera.getName())
+                    DG.LE_showInOneCam(self.selectedNPReadout, self.camera.getName())
                     base.direct.widget = base.direct.manipulationControl.widgetList[base.camList.index(NodePath(winCtrl.camNode))]
                     base.direct.widget = base.direct.manipulationControl.widgetList[base.camList.index(NodePath(winCtrl.camNode))]
 
 
                 input = input[8:] # get rid of camera prefix
                 input = input[8:] # get rid of camera prefix
@@ -590,8 +605,8 @@ class DirectSession(DirectObject):
             self.fControl = 1
             self.fControl = 1
             # [gjeon] to update control key information while mouse1 is pressed
             # [gjeon] to update control key information while mouse1 is pressed
             if self.fMouse1:
             if self.fMouse1:
-                modifiers = DIRECT_NO_MOD
-                modifiers |= DIRECT_CONTROL_MOD
+                modifiers = DG.DIRECT_NO_MOD
+                modifiers |= DG.DIRECT_CONTROL_MOD
                 messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
                 messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
         elif input == 'control-up':
         elif input == 'control-up':
             self.fControl = 0
             self.fControl = 0
@@ -601,16 +616,16 @@ class DirectSession(DirectObject):
             self.fAlt = 1
             self.fAlt = 1
             # [gjeon] to update alt key information while mouse1 is pressed
             # [gjeon] to update alt key information while mouse1 is pressed
             if self.fMouse1:
             if self.fMouse1:
-                modifiers = DIRECT_NO_MOD
-                modifiers |= DIRECT_ALT_MOD
+                modifiers = DG.DIRECT_NO_MOD
+                modifiers |= DG.DIRECT_ALT_MOD
                 messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
                 messenger.send('DIRECT-mouse1', sentArgs = [modifiers])
             elif self.fMouse2:
             elif self.fMouse2:
-                modifiers = DIRECT_NO_MOD
-                modifiers |= DIRECT_ALT_MOD
+                modifiers = DG.DIRECT_NO_MOD
+                modifiers |= DG.DIRECT_ALT_MOD
                 messenger.send('DIRECT-mouse2', sentArgs = [modifiers])
                 messenger.send('DIRECT-mouse2', sentArgs = [modifiers])
             elif self.fMouse3:
             elif self.fMouse3:
-                modifiers = DIRECT_NO_MOD
-                modifiers |= DIRECT_ALT_MOD
+                modifiers = DG.DIRECT_NO_MOD
+                modifiers |= DG.DIRECT_ALT_MOD
                 messenger.send('DIRECT-mouse3', sentArgs = [modifiers])
                 messenger.send('DIRECT-mouse3', sentArgs = [modifiers])
         elif input == 'alt-up':
         elif input == 'alt-up':
             self.fAlt = 0
             self.fAlt = 0
@@ -637,24 +652,24 @@ class DirectSession(DirectObject):
             self.select(self.selected.last)
             self.select(self.selected.last)
 
 
     def getModifiers(self, input, base):
     def getModifiers(self, input, base):
-        modifiers = DIRECT_NO_MOD
+        modifiers = DG.DIRECT_NO_MOD
         modifierString = input[: input.find(base)]
         modifierString = input[: input.find(base)]
         if modifierString.find('shift') != -1:
         if modifierString.find('shift') != -1:
-            modifiers |= DIRECT_SHIFT_MOD
+            modifiers |= DG.DIRECT_SHIFT_MOD
         if modifierString.find('control') != -1:
         if modifierString.find('control') != -1:
-            modifiers |= DIRECT_CONTROL_MOD
+            modifiers |= DG.DIRECT_CONTROL_MOD
         if modifierString.find('alt') != -1:
         if modifierString.find('alt') != -1:
-            modifiers |= DIRECT_ALT_MOD
+            modifiers |= DG.DIRECT_ALT_MOD
         return modifiers
         return modifiers
 
 
     def gotShift(self, modifiers):
     def gotShift(self, modifiers):
-        return modifiers & DIRECT_SHIFT_MOD
+        return modifiers & DG.DIRECT_SHIFT_MOD
 
 
     def gotControl(self, modifiers):
     def gotControl(self, modifiers):
-        return modifiers & DIRECT_CONTROL_MOD
+        return modifiers & DG.DIRECT_CONTROL_MOD
 
 
     def gotAlt(self, modifiers):
     def gotAlt(self, modifiers):
-        return modifiers & DIRECT_ALT_MOD
+        return modifiers & DG.DIRECT_ALT_MOD
 
 
     def setFScaleWidgetByCam(self, flag):
     def setFScaleWidgetByCam(self, flag):
         self.fScaleWidgetByCam = flag
         self.fScaleWidgetByCam = flag
@@ -708,7 +723,7 @@ class DirectSession(DirectObject):
             else:
             else:
                 self.widget.showWidget()
                 self.widget.showWidget()
             editTypes = self.manipulationControl.getEditTypes([dnp])
             editTypes = self.manipulationControl.getEditTypes([dnp])
-            if (editTypes & EDIT_TYPE_UNEDITABLE) == EDIT_TYPE_UNEDITABLE:
+            if (editTypes & DG.EDIT_TYPE_UNEDITABLE) == DG.EDIT_TYPE_UNEDITABLE:
                 self.manipulationControl.disableWidgetMove()
                 self.manipulationControl.disableWidgetMove()
             else:
             else:
                 self.manipulationControl.enableWidgetMove()
                 self.manipulationControl.enableWidgetMove()
@@ -831,7 +846,7 @@ class DirectSession(DirectObject):
             # Temporarily set node path color
             # Temporarily set node path color
             nodePath.setColor(flashColor)
             nodePath.setColor(flashColor)
             # Clean up color in a few seconds
             # Clean up color in a few seconds
-            t = taskMgr.doMethodLater(DIRECT_FLASH_DURATION,
+            t = taskMgr.doMethodLater(DG.DIRECT_FLASH_DURATION,
                                       # This is just a dummy task
                                       # This is just a dummy task
                                       self.flashDummy,
                                       self.flashDummy,
                                       'flashNodePath',)
                                       'flashNodePath',)
@@ -1272,7 +1287,7 @@ class DisplayRegionList(DirectObject):
         for dr in self.displayRegionList:
         for dr in self.displayRegionList:
             dr.setVfov(fov)
             dr.setVfov(fov)
 
 
-    def mouseUpdate(self, modifiers = DIRECT_NO_MOD):
+    def mouseUpdate(self, modifiers = DG.DIRECT_NO_MOD):
         for dr in self.displayRegionList:
         for dr in self.displayRegionList:
             dr.mouseUpdate()
             dr.mouseUpdate()
         #base.direct.dr = self.getCurrentDr()
         #base.direct.dr = self.getCurrentDr()

+ 0 - 2
direct/src/directtools/DirectUtil.py

@@ -1,5 +1,3 @@
-
-from .DirectGlobals import *
 from panda3d.core import VBase4
 from panda3d.core import VBase4
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr

+ 15 - 3
direct/src/directutil/Mopath.py

@@ -1,8 +1,20 @@
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from direct.directtools.DirectGeometry import *
-
-from panda3d.core import NodePath, LineSegs, ClockObject
+from direct.directtools.DirectUtil import CLAMP
+from direct.task.TaskManagerGlobal import taskMgr
+
+from panda3d.core import (
+    PCTHPR,
+    PCTNONE,
+    PCTT,
+    PCTXYZ,
+    ClockObject,
+    LineSegs,
+    NodePath,
+    ParametricCurve,
+    Point3,
+    Vec3,
+)
 
 
 
 
 class Mopath(DirectObject):
 class Mopath(DirectObject):

+ 1 - 1
direct/src/dist/FreezeTool.py

@@ -22,7 +22,7 @@ try:
 except ImportError:
 except ImportError:
     p3extend_frozen = None
     p3extend_frozen = None
 
 
-from panda3d.core import *
+from panda3d.core import Filename, Multifile, PandaSystem, StringStream
 
 
 # Check to see if we are running python_d, which implies we have a
 # Check to see if we are running python_d, which implies we have a
 # debug build, and we have to build the module with debug options.
 # debug build, and we have to build the module with debug options.

+ 1 - 1
direct/src/dist/icon.py

@@ -1,4 +1,4 @@
-from direct.directnotify.DirectNotifyGlobal import *
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from panda3d.core import PNMImage, Filename, PNMFileTypeRegistry, StringStream
 from panda3d.core import PNMImage, Filename, PNMFileTypeRegistry, StringStream
 import struct
 import struct
 
 

+ 2 - 1
direct/src/distributed/AsyncRequest.py

@@ -2,7 +2,8 @@
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from .ConnectionRepository import *
+from direct.task import Task
+from direct.task.TaskManagerGlobal import taskMgr
 from panda3d.core import ConfigVariableDouble, ConfigVariableInt, ConfigVariableBool
 from panda3d.core import ConfigVariableDouble, ConfigVariableInt, ConfigVariableBool
 
 
 ASYNC_REQUEST_DEFAULT_TIMEOUT_IN_SECONDS = 8.0
 ASYNC_REQUEST_DEFAULT_TIMEOUT_IN_SECONDS = 8.0

+ 13 - 1
direct/src/distributed/ClientRepository.py

@@ -3,7 +3,19 @@
 from .ClientRepositoryBase import ClientRepositoryBase
 from .ClientRepositoryBase import ClientRepositoryBase
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from .MsgTypesCMU import *
+from .MsgTypesCMU import (
+    CLIENT_DISCONNECT_CMU,
+    CLIENT_HEARTBEAT_CMU,
+    CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU,
+    CLIENT_SET_INTEREST_CMU,
+    OBJECT_DELETE_CMU,
+    OBJECT_DISABLE_CMU,
+    OBJECT_GENERATE_CMU,
+    OBJECT_SET_ZONE_CMU,
+    OBJECT_UPDATE_FIELD_CMU,
+    REQUEST_GENERATES_CMU,
+    SET_DOID_RANGE_CMU,
+)
 from .PyDatagram import PyDatagram
 from .PyDatagram import PyDatagram
 from .PyDatagramIterator import PyDatagramIterator
 from .PyDatagramIterator import PyDatagramIterator
 from panda3d.core import UniqueIdAllocator, Notify, ClockObject
 from panda3d.core import UniqueIdAllocator, Notify, ClockObject

+ 8 - 4
direct/src/distributed/ClientRepositoryBase.py

@@ -1,5 +1,10 @@
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import (
+    ClockObject,
+    ConfigVariableBool,
+    ConfigVariableDouble,
+    Datagram,
+    DatagramIterator,
+)
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
@@ -7,11 +12,10 @@ from direct.distributed.CRDataCache import CRDataCache
 from direct.distributed.ConnectionRepository import ConnectionRepository
 from direct.distributed.ConnectionRepository import ConnectionRepository
 from direct.showbase.PythonUtil import safeRepr, itype, makeList
 from direct.showbase.PythonUtil import safeRepr, itype, makeList
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
-from .MsgTypes import *
+from .MsgTypes import CLIENT_ENTER_OBJECT_REQUIRED_OTHER, MsgId2Names
 from . import CRCache
 from . import CRCache
 from . import ParentMgr
 from . import ParentMgr
 from . import RelatedObjectMgr
 from . import RelatedObjectMgr
-from .ClockDelta import *
 import time
 import time
 
 
 
 

+ 2 - 2
direct/src/distributed/ConnectionRepository.py

@@ -1,5 +1,5 @@
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import DocumentSpec, Filename, HTTPClient, VirtualFileSystem, getModelPath
+from panda3d.direct import CConnectionRepository, DCPacker
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify

+ 2 - 3
direct/src/distributed/DistributedCamera.py

@@ -1,7 +1,6 @@
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import ConfigVariableInt, GeomNode, NodePath, PerspectiveLens, Point3, VBase2
 from direct.fsm.FSM import FSM
 from direct.fsm.FSM import FSM
-from direct.interval.IntervalGlobal import *
+from direct.interval.IntervalGlobal import LerpScaleInterval, Sequence
 from direct.distributed.DistributedObject import DistributedObject
 from direct.distributed.DistributedObject import DistributedObject
 
 
 
 

+ 0 - 2
direct/src/distributed/DistributedCameraOV.py

@@ -1,5 +1,3 @@
-from panda3d.core import *
-from panda3d.direct import *
 from direct.distributed.DistributedObjectOV import DistributedObjectOV
 from direct.distributed.DistributedObjectOV import DistributedObjectOV
 
 
 class DistributedCameraOV(DistributedObjectOV):
 class DistributedCameraOV(DistributedObjectOV):

+ 2 - 5
direct/src/distributed/DistributedCartesianGrid.py

@@ -1,7 +1,4 @@
-
-from panda3d.core import *
-from panda3d.direct import *
-from direct.interval.IntervalGlobal import *
+from panda3d.core import ConfigVariableBool, TextNode, VBase4, Vec3
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 
 
 from direct.distributed.DistributedNode import DistributedNode
 from direct.distributed.DistributedNode import DistributedNode
@@ -13,7 +10,7 @@ from direct.distributed.GridParent import GridParent
 
 
 if __debug__:
 if __debug__:
     # For grid drawing
     # For grid drawing
-    from direct.directtools.DirectGeometry import *
+    from direct.directtools.DirectGeometry import LineNodePath
     from direct.showbase.PythonUtil import randFloat
     from direct.showbase.PythonUtil import randFloat
 
 
 from .CartesianGridBase import CartesianGridBase
 from .CartesianGridBase import CartesianGridBase

+ 0 - 3
direct/src/distributed/DistributedCartesianGridAI.py

@@ -1,6 +1,3 @@
-
-from panda3d.core import *
-from panda3d.direct import *
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr

+ 1 - 2
direct/src/distributed/DistributedObject.py

@@ -1,7 +1,6 @@
 """DistributedObject module: contains the DistributedObject class"""
 """DistributedObject module: contains the DistributedObject class"""
 
 
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.direct import DCPacker
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.distributed.DistributedObjectBase import DistributedObjectBase
 from direct.distributed.DistributedObjectBase import DistributedObjectBase

+ 0 - 2
direct/src/distributed/DistributedObjectAI.py

@@ -4,8 +4,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.distributed.DistributedObjectBase import DistributedObjectBase
 from direct.distributed.DistributedObjectBase import DistributedObjectBase
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase import PythonUtil
 from direct.showbase import PythonUtil
-from panda3d.core import *
-from panda3d.direct import *
 #from PyDatagram import PyDatagram
 #from PyDatagram import PyDatagram
 #from PyDatagramIterator import PyDatagramIterator
 #from PyDatagramIterator import PyDatagramIterator
 
 

+ 0 - 2
direct/src/distributed/DistributedObjectUD.py

@@ -4,8 +4,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.distributed.DistributedObjectBase import DistributedObjectBase
 from direct.distributed.DistributedObjectBase import DistributedObjectBase
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase import PythonUtil
 from direct.showbase import PythonUtil
-from panda3d.core import *
-from panda3d.direct import *
 #from PyDatagram import PyDatagram
 #from PyDatagram import PyDatagram
 #from PyDatagramIterator import PyDatagramIterator
 #from PyDatagramIterator import PyDatagramIterator
 
 

+ 4 - 3
direct/src/distributed/DistributedSmoothNode.py

@@ -1,8 +1,9 @@
 """DistributedSmoothNode module: contains the DistributedSmoothNode class"""
 """DistributedSmoothNode module: contains the DistributedSmoothNode class"""
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from .ClockDelta import *
+import math
+from panda3d.core import ClockObject, ConfigVariableBool, ConfigVariableDouble, NodePath
+from panda3d.direct import SmoothMover
+from .ClockDelta import globalClockDelta
 from . import DistributedNode
 from . import DistributedNode
 from . import DistributedSmoothNodeBase
 from . import DistributedSmoothNodeBase
 from direct.task.Task import cont
 from direct.task.Task import cont

+ 1 - 1
direct/src/distributed/DistributedSmoothNodeBase.py

@@ -1,6 +1,6 @@
 """DistributedSmoothNodeBase module: contains the DistributedSmoothNodeBase class"""
 """DistributedSmoothNodeBase module: contains the DistributedSmoothNodeBase class"""
 
 
-from .ClockDelta import *
+from .ClockDelta import globalClockDelta
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.showbase.PythonUtil import randFloat
 from direct.showbase.PythonUtil import randFloat

+ 11 - 5
direct/src/distributed/DoInterestManager.py

@@ -7,16 +7,22 @@ zone, remove interest in that zone.
 p.s. A great deal of this code is just code moved from ClientRepository.py.
 p.s. A great deal of this code is just code moved from ClientRepository.py.
 """
 """
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from .MsgTypes import *
-from direct.showbase.PythonUtil import *
+from panda3d.core import ConfigVariableBool
+from .MsgTypes import CLIENT_ADD_INTEREST, CLIENT_ADD_INTEREST_MULTIPLE, CLIENT_REMOVE_INTEREST
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from .PyDatagram import PyDatagram
 from .PyDatagram import PyDatagram
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 import types
 import types
-from direct.showbase.PythonUtil import report
+from direct.showbase.PythonUtil import (
+    FrameDelayedCall,
+    ScratchPad,
+    SerialNumGen,
+    report,
+    serialNum,
+    uniqueElements,
+    uniqueName,
+)
 
 
 class InterestState:
 class InterestState:
     StateActive = 'Active'
     StateActive = 'Active'

+ 1 - 3
direct/src/distributed/GridParent.py

@@ -1,6 +1,4 @@
-
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import NodePath
 
 
 #
 #
 # GridParent.py
 # GridParent.py

+ 22 - 2
direct/src/distributed/PyDatagram.py

@@ -4,10 +4,30 @@
 # of the file rather than every time we call the putArg function.
 # of the file rather than every time we call the putArg function.
 
 
 from panda3d.core import Datagram
 from panda3d.core import Datagram
-from panda3d.direct import *
+from panda3d.direct import (
+    STInt8,
+    STInt16,
+    STInt32,
+    STInt64,
+    STUint8,
+    STUint16,
+    STUint32,
+    STUint64,
+    STFloat64,
+    STString,
+    STBlob,
+    STBlob32,
+    STInt16array,
+    STInt32array,
+    STUint16array,
+    STUint32array,
+    STInt8array,
+    STUint8array,
+    STUint32uint8array,
+)
 # Import the type numbers
 # Import the type numbers
 
 
-from direct.distributed.MsgTypes import *
+from direct.distributed.MsgTypes import CONTROL_CHANNEL
 
 
 
 
 class PyDatagram(Datagram):
 class PyDatagram(Datagram):

+ 22 - 2
direct/src/distributed/PyDatagramIterator.py

@@ -3,8 +3,28 @@
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # class variable FuncDict and so we can import DCSubatomicType at the top
 # of the file rather than every time we call the putArg function.
 # of the file rather than every time we call the putArg function.
 
 
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import DatagramIterator
+from panda3d.direct import (
+    STInt8,
+    STInt16,
+    STInt32,
+    STInt64,
+    STUint8,
+    STUint16,
+    STUint32,
+    STUint64,
+    STFloat64,
+    STString,
+    STBlob,
+    STBlob32,
+    STInt16array,
+    STInt32array,
+    STUint16array,
+    STUint32array,
+    STInt8array,
+    STUint8array,
+    STUint32uint8array,
+)
 # Import the type numbers
 # Import the type numbers
 
 
 
 

+ 2 - 2
direct/src/distributed/SampleObject.py

@@ -1,7 +1,7 @@
 """SampleObject module: contains the SampleObject class"""
 """SampleObject module: contains the SampleObject class"""
 
 
-from direct.directnotify.DirectNotifyGlobal import *
-from direct.distributed.DistributedObject import *
+from direct.directnotify.DirectNotifyGlobal import directNotify
+from direct.distributed.DistributedObject import DistributedObject
 
 
 class SampleObject(DistributedObject):
 class SampleObject(DistributedObject):
 
 

+ 33 - 3
direct/src/distributed/ServerRepository.py

@@ -1,8 +1,38 @@
 """ServerRepository module: contains the ServerRepository class"""
 """ServerRepository module: contains the ServerRepository class"""
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.distributed.MsgTypesCMU import *
+from panda3d.core import (
+    ConfigVariableBool,
+    ConfigVariableDouble,
+    ConfigVariableInt,
+    ConnectionWriter,
+    DatagramIterator,
+    Filename,
+    NetAddress,
+    NetDatagram,
+    PointerToConnection,
+    QueuedConnectionListener,
+    QueuedConnectionManager,
+    QueuedConnectionReader,
+    TPLow,
+    UniqueIdAllocator,
+    VirtualFileSystem,
+    getModelPath,
+)
+from panda3d.direct import DCFile
+from direct.distributed.MsgTypesCMU import (
+    CLIENT_DISCONNECT_CMU,
+    CLIENT_OBJECT_GENERATE_CMU,
+    CLIENT_OBJECT_UPDATE_FIELD,
+    CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU,
+    CLIENT_SET_INTEREST_CMU,
+    OBJECT_DELETE_CMU,
+    OBJECT_DISABLE_CMU,
+    OBJECT_GENERATE_CMU,
+    OBJECT_SET_ZONE_CMU,
+    OBJECT_UPDATE_FIELD_CMU,
+    REQUEST_GENERATES_CMU,
+    SET_DOID_RANGE_CMU,
+)
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal

+ 1 - 2
direct/src/distributed/TimeManager.py

@@ -1,5 +1,4 @@
-from panda3d.core import *
-from direct.showbase.DirectObject import *
+from panda3d.core import ClockObject, ConfigVariableDouble, ConfigVariableInt
 from direct.task import Task
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.distributed import DistributedObject
 from direct.distributed import DistributedObject

+ 2 - 2
direct/src/distributed/TimeManagerAI.py

@@ -1,5 +1,5 @@
-from panda3d.core import *
-from direct.distributed.ClockDelta import *
+from direct.directnotify import DirectNotifyGlobal
+from direct.distributed.ClockDelta import globalClockDelta
 from direct.distributed import DistributedObjectAI
 from direct.distributed import DistributedObjectAI
 
 
 class TimeManagerAI(DistributedObjectAI.DistributedObjectAI):
 class TimeManagerAI(DistributedObjectAI.DistributedObjectAI):

+ 1 - 1
direct/src/filter/FilterManager.py

@@ -25,7 +25,7 @@ from panda3d.core import Camera
 from panda3d.core import OrthographicLens
 from panda3d.core import OrthographicLens
 from panda3d.core import AuxBitplaneAttrib
 from panda3d.core import AuxBitplaneAttrib
 from panda3d.core import LightRampAttrib
 from panda3d.core import LightRampAttrib
-from direct.directnotify.DirectNotifyGlobal import *
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 
 
 __all__ = ["FilterManager"]
 __all__ = ["FilterManager"]

+ 2 - 2
direct/src/gui/DirectButton.py

@@ -6,9 +6,9 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectButton']
 __all__ = ['DirectButton']
 
 
-from panda3d.core import *
+from panda3d.core import Mat4, MouseButton, PGButton
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
+from .DirectFrame import DirectFrame
 
 
 class DirectButton(DirectFrame):
 class DirectButton(DirectFrame):
     """
     """

+ 2 - 2
direct/src/gui/DirectCheckBox.py

@@ -1,5 +1,5 @@
-from direct.gui.DirectGui import *
-from panda3d.core import *
+from direct.gui.DirectGui import DGG, DirectButton
+from panda3d.core import PGButton
 
 
 
 
 class DirectCheckBox(DirectButton):
 class DirectCheckBox(DirectButton):

+ 3 - 3
direct/src/gui/DirectCheckButton.py

@@ -8,9 +8,9 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectCheckButton']
 __all__ = ['DirectCheckButton']
 
 
-from panda3d.core import *
-from .DirectButton import *
-from .DirectLabel import *
+from panda3d.core import PGFrameStyle, VBase4
+from .DirectButton import DirectButton
+from .DirectLabel import DirectLabel
 
 
 class DirectCheckButton(DirectButton):
 class DirectCheckButton(DirectButton):
     """
     """

+ 3 - 3
direct/src/gui/DirectDialog.py

@@ -9,11 +9,11 @@ __all__ = [
     'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog',
     'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog',
 ]
 ]
 
 
-from panda3d.core import *
+from panda3d.core import NodePath, Point3, TextNode, VBase3
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
-from .DirectButton import *
+from .DirectFrame import DirectFrame
+from .DirectButton import DirectButton
 
 
 
 
 def findDialog(uniqueName):
 def findDialog(uniqueName):

+ 2 - 2
direct/src/gui/DirectEntry.py

@@ -7,10 +7,10 @@ explanation and an example of how to use this class.
 
 
 __all__ = ['DirectEntry']
 __all__ = ['DirectEntry']
 
 
-from panda3d.core import *
+from panda3d.core import ConfigVariableBool, PGEntry, Point3, TextNode, Vec3
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
+from .DirectFrame import DirectFrame
 from .OnscreenText import OnscreenText
 from .OnscreenText import OnscreenText
 # import this to make sure it gets pulled into the publish
 # import this to make sure it gets pulled into the publish
 import encodings.utf_8
 import encodings.utf_8

+ 3 - 4
direct/src/gui/DirectEntryScroll.py

@@ -1,10 +1,9 @@
 __all__ = ['DirectEntryScroll']
 __all__ = ['DirectEntryScroll']
 
 
-from panda3d.core import *
+from panda3d.core import NodePath, OmniBoundingVolume, PGVirtualFrame
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectScrolledFrame import *
-from .DirectFrame import *
-from .DirectEntry import *
+from .DirectFrame import DirectFrame
+from .DirectEntry import DirectEntry
 
 
 class DirectEntryScroll(DirectFrame):
 class DirectEntryScroll(DirectFrame):
     def __init__(self, entry, parent = None, **kw):
     def __init__(self, entry, parent = None, **kw):

+ 2 - 2
direct/src/gui/DirectFrame.py

@@ -18,9 +18,9 @@ explanation and an example of how to use this class.
 
 
 __all__ = ['DirectFrame']
 __all__ = ['DirectFrame']
 
 
-from panda3d.core import *
+from panda3d.core import Filename, NodePath, PGItem, Texture
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectGuiBase import *
+from .DirectGuiBase import DirectGuiWidget
 from .OnscreenImage import OnscreenImage
 from .OnscreenImage import OnscreenImage
 from .OnscreenGeom import OnscreenGeom
 from .OnscreenGeom import OnscreenGeom
 from .OnscreenText import OnscreenText
 from .OnscreenText import OnscreenText

+ 11 - 4
direct/src/gui/DirectGuiBase.py

@@ -87,14 +87,21 @@ Code overview:
 __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 
 
 
 
-from panda3d.core import *
+from panda3d.core import (
+    ConfigVariableBool,
+    KeyboardButton,
+    MouseWatcherRegion,
+    NodePath,
+    PGFrameStyle,
+    PGItem,
+    Point3,
+    Texture,
+    Vec3,
+)
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
 from direct.showbase.ShowBase import ShowBase
 from direct.showbase.ShowBase import ShowBase
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .OnscreenText import *
-from .OnscreenGeom import *
-from .OnscreenImage import *
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.task import Task
 from direct.task import Task

+ 9 - 1
direct/src/gui/DirectGuiGlobals.py

@@ -5,7 +5,15 @@ that can be used during widget construction
 
 
 __all__ = []
 __all__ = []
 
 
-from panda3d.core import *
+from panda3d.core import (
+    KeyboardButton,
+    MouseButton,
+    PGButton,
+    PGEntry,
+    PGFrameStyle,
+    PGSliderBar,
+    TextNode,
+)
 
 
 defaultFont = None
 defaultFont = None
 defaultFontFunc = TextNode.getDefaultFont
 defaultFontFunc = TextNode.getDefaultFont

+ 3 - 2
direct/src/gui/DirectGuiTest.py

@@ -4,12 +4,13 @@ __all__ = []
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
+    from panda3d.core import Point3
     from direct.showbase.ShowBase import ShowBase
     from direct.showbase.ShowBase import ShowBase
     from direct.task.TaskManagerGlobal import taskMgr
     from direct.task.TaskManagerGlobal import taskMgr
     from . import DirectGuiGlobals
     from . import DirectGuiGlobals
-    from .DirectGui import *
+    from .DirectGui import DirectButton, DirectDialog, DirectEntry, DirectFrame, YesNoDialog
     #from whrandom import *
     #from whrandom import *
-    from random import *
+    from random import random
 
 
     base = ShowBase()
     base = ShowBase()
 
 

+ 2 - 2
direct/src/gui/DirectLabel.py

@@ -6,8 +6,8 @@ explanation and an example of how to use this class.
 
 
 __all__ = ['DirectLabel']
 __all__ = ['DirectLabel']
 
 
-from panda3d.core import *
-from .DirectFrame import *
+from panda3d.core import PGItem
+from .DirectFrame import DirectFrame
 
 
 class DirectLabel(DirectFrame):
 class DirectLabel(DirectFrame):
     """
     """

+ 3 - 4
direct/src/gui/DirectOptionMenu.py

@@ -6,12 +6,11 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectOptionMenu']
 __all__ = ['DirectOptionMenu']
 
 
-from panda3d.core import *
+from panda3d.core import OmniBoundingVolume, TextNode, VBase3
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectButton import *
-from .DirectLabel import *
-from .DirectFrame import *
+from .DirectButton import DirectButton
+from .DirectFrame import DirectFrame
 
 
 
 
 class DirectOptionMenu(DirectButton):
 class DirectOptionMenu(DirectButton):

+ 3 - 3
direct/src/gui/DirectRadioButton.py

@@ -9,10 +9,10 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectRadioButton']
 __all__ = ['DirectRadioButton']
 
 
-from panda3d.core import *
+from panda3d.core import PGFrameStyle, VBase4
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectButton import *
-from .DirectLabel import *
+from .DirectButton import DirectButton
+from .DirectLabel import DirectLabel
 
 
 class DirectRadioButton(DirectButton):
 class DirectRadioButton(DirectButton):
     """
     """

+ 3 - 3
direct/src/gui/DirectScrollBar.py

@@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectScrollBar']
 __all__ = ['DirectScrollBar']
 
 
-from panda3d.core import *
+from panda3d.core import PGSliderBar, Vec3
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
-from .DirectButton import *
+from .DirectFrame import DirectFrame
+from .DirectButton import DirectButton
 
 
 
 
 class DirectScrollBar(DirectFrame):
 class DirectScrollBar(DirectFrame):

+ 3 - 3
direct/src/gui/DirectScrolledFrame.py

@@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectScrolledFrame']
 __all__ = ['DirectScrolledFrame']
 
 
-from panda3d.core import *
+from panda3d.core import NodePath, PGScrollFrame
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
-from .DirectScrollBar import *
+from .DirectFrame import DirectFrame
+from .DirectScrollBar import DirectScrollBar
 
 
 
 
 class DirectScrolledFrame(DirectFrame):
 class DirectScrolledFrame(DirectFrame):

+ 3 - 3
direct/src/gui/DirectScrolledList.py

@@ -6,14 +6,14 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectScrolledListItem', 'DirectScrolledList']
 __all__ = ['DirectScrolledListItem', 'DirectScrolledList']
 
 
-from panda3d.core import *
+from panda3d.core import TextNode
 from direct.showbase import ShowBaseGlobal
 from direct.showbase import ShowBaseGlobal
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.task.Task import Task
 from direct.task.Task import Task
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
-from .DirectFrame import *
-from .DirectButton import *
+from .DirectFrame import DirectFrame
+from .DirectButton import DirectButton
 
 
 
 
 class DirectScrolledListItem(DirectButton):
 class DirectScrolledListItem(DirectButton):

+ 3 - 3
direct/src/gui/DirectSlider.py

@@ -6,10 +6,10 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectSlider']
 __all__ = ['DirectSlider']
 
 
-from panda3d.core import *
+from panda3d.core import PGSliderBar, Vec3
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
-from .DirectButton import *
+from .DirectFrame import DirectFrame
+from .DirectButton import DirectButton
 from math import isnan
 from math import isnan
 
 
 
 

+ 2 - 2
direct/src/gui/DirectWaitBar.py

@@ -6,9 +6,9 @@ in-depth explanation and an example of how to use this class.
 
 
 __all__ = ['DirectWaitBar']
 __all__ = ['DirectWaitBar']
 
 
-from panda3d.core import *
+from panda3d.core import PGFrameStyle, PGWaitBar
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
-from .DirectFrame import *
+from .DirectFrame import DirectFrame
 
 
 
 
 class DirectWaitBar(DirectFrame):
 class DirectWaitBar(DirectFrame):

+ 1 - 1
direct/src/gui/OnscreenGeom.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['OnscreenGeom']
 __all__ = ['OnscreenGeom']
 
 
-from panda3d.core import *
+from panda3d.core import NodePath, VBase3
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 
 
 
 

+ 1 - 1
direct/src/gui/OnscreenImage.py

@@ -6,7 +6,7 @@ this class.
 
 
 __all__ = ['OnscreenImage']
 __all__ = ['OnscreenImage']
 
 
-from panda3d.core import *
+from panda3d.core import CardMaker, NodePath, Texture, TexturePool, VBase3
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 
 
 
 

+ 1 - 1
direct/src/gui/OnscreenText.py

@@ -6,7 +6,7 @@ this class.
 
 
 __all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm', 'BlackOnWhite']
 __all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm', 'BlackOnWhite']
 
 
-from panda3d.core import *
+from panda3d.core import LColor, Mat4, NodePath, Point3, TextNode, TextProperties, Vec3
 from . import DirectGuiGlobals as DGG
 from . import DirectGuiGlobals as DGG
 import warnings
 import warnings
 
 

+ 2 - 3
direct/src/interval/ActorInterval.py

@@ -6,9 +6,8 @@ of this class.
 
 
 __all__ = ['ActorInterval', 'LerpAnimInterval']
 __all__ = ['ActorInterval', 'LerpAnimInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.direct import CInterval, CLerpAnimEffectInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 import math
 import math
 
 

+ 3 - 3
direct/src/interval/AnimControlInterval.py

@@ -2,9 +2,9 @@
 
 
 __all__ = ['AnimControlInterval']
 __all__ = ['AnimControlInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.core import AnimControl, AnimControlCollection, ConfigVariableBool
+from panda3d.direct import CInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 import math
 import math
 
 

+ 2 - 3
direct/src/interval/FunctionInterval.py

@@ -2,9 +2,8 @@
 
 
 __all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait']
 __all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.showbase.MessengerGlobal import *
+from panda3d.direct import WaitInterval
+from direct.showbase.MessengerGlobal import messenger
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 
 

+ 2 - 3
direct/src/interval/IndirectInterval.py

@@ -2,9 +2,8 @@
 
 
 __all__ = ['IndirectInterval']
 __all__ = ['IndirectInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.direct import CInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 from . import LerpBlendHelpers
 from . import LerpBlendHelpers
 
 

+ 2 - 2
direct/src/interval/Interval.py

@@ -2,8 +2,8 @@
 
 
 __all__ = ['Interval']
 __all__ = ['Interval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.core import ClockObject, PStatCollector
+from panda3d.direct import CInterval
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.MessengerGlobal import messenger
 from direct.showbase.MessengerGlobal import messenger

+ 2 - 3
direct/src/interval/IntervalManager.py

@@ -3,9 +3,8 @@ this class, ivalMgr."""
 
 
 __all__ = ['IntervalManager', 'ivalMgr']
 __all__ = ['IntervalManager', 'ivalMgr']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.core import EventQueue
+from panda3d.direct import CIntervalManager, Dtool_BorrowThisReference
 from direct.showbase import EventManager
 from direct.showbase import EventManager
 import fnmatch
 import fnmatch
 
 

+ 15 - 3
direct/src/interval/IntervalTest.py

@@ -4,11 +4,23 @@ __all__ = []
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
-    from panda3d.core import *
+    from panda3d.core import Filename, Point3, Vec3
+    from direct.showbase.DirectObject import DirectObject
     from direct.showbase.ShowBase import ShowBase
     from direct.showbase.ShowBase import ShowBase
-    from direct.actor.Actor import *
+    from direct.actor.Actor import Actor
     from direct.directutil import Mopath
     from direct.directutil import Mopath
-    from .IntervalGlobal import *
+    from .ActorInterval import ActorInterval
+    from .FunctionInterval import (
+        AcceptInterval,
+        EventInterval,
+        FunctionInterval,
+        IgnoreInterval,
+        PosHprInterval,
+    )
+    from .LerpInterval import LerpPosInterval, LerpHprInterval, LerpPosHprInterval
+    from .MopathInterval import MopathInterval
+    from .SoundInterval import SoundInterval
+    from .MetaInterval import PREVIOUS_END, PREVIOUS_START, TRACK_START, Track
 
 
     base = ShowBase()
     base = ShowBase()
 
 

+ 1 - 1
direct/src/interval/LerpBlendHelpers.py

@@ -2,7 +2,7 @@
 
 
 __all__ = ['getBlend']
 __all__ = ['getBlend']
 
 
-from panda3d.direct import *
+from panda3d.direct import EaseInBlendType, EaseInOutBlendType, EaseOutBlendType, NoBlendType
 
 
 
 
 easeIn = EaseInBlendType()
 easeIn = EaseInBlendType()

+ 3 - 3
direct/src/interval/LerpInterval.py

@@ -12,9 +12,9 @@ __all__ = [
     'LerpFunctionInterval', 'LerpFunc','LerpFunctionNoStateInterval','LerpFuncNS'
     'LerpFunctionInterval', 'LerpFunc','LerpFunctionNoStateInterval','LerpFuncNS'
     ]
     ]
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.core import LOrientationf, NodePath
+from panda3d.direct import CInterval, CLerpNodePathInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 from . import LerpBlendHelpers
 from . import LerpBlendHelpers
 
 

+ 3 - 3
direct/src/interval/MetaInterval.py

@@ -5,9 +5,9 @@ intervals either in parallel or in a specified sequential order.
 
 
 __all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track']
 __all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.core import PStatCollector, ostream
+from panda3d.direct import CInterval, CMetaInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from .IntervalManager import ivalMgr
 from .IntervalManager import ivalMgr
 from . import Interval
 from . import Interval
 from direct.task.Task import TaskManager
 from direct.task.Task import TaskManager

+ 1 - 3
direct/src/interval/MopathInterval.py

@@ -3,9 +3,7 @@
 __all__ = ['MopathInterval']
 __all__ = ['MopathInterval']
 
 
 from . import LerpInterval
 from . import LerpInterval
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from direct.directnotify.DirectNotifyGlobal import directNotify
 
 
 # import Mopath
 # import Mopath
 
 

+ 1 - 2
direct/src/interval/ParticleInterval.py

@@ -4,8 +4,7 @@ Contains the ParticleInterval class
 
 
 __all__ = ['ParticleInterval']
 __all__ = ['ParticleInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.direct import CInterval
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from .Interval import Interval
 from .Interval import Interval
 
 

+ 2 - 3
direct/src/interval/ProjectileInterval.py

@@ -2,9 +2,8 @@
 
 
 __all__ = ['ProjectileInterval']
 __all__ = ['ProjectileInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.core import CollisionParabola, LParabola, NodePath, Point3, VBase3
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from .Interval import Interval
 from .Interval import Interval
 from direct.showbase import PythonUtil
 from direct.showbase import PythonUtil
 
 

+ 2 - 3
direct/src/interval/ProjectileIntervalTest.py

@@ -2,9 +2,8 @@
 
 
 __all__ = ['doTest']
 __all__ = ['doTest']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from .IntervalGlobal import *
+from panda3d.core import Point3
+from .ProjectileInterval import ProjectileInterval
 
 
 
 
 def doTest():
 def doTest():

+ 2 - 3
direct/src/interval/SoundInterval.py

@@ -2,9 +2,8 @@
 
 
 __all__ = ['SoundInterval']
 __all__ = ['SoundInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
-from direct.directnotify.DirectNotifyGlobal import *
+from panda3d.direct import CInterval
+from direct.directnotify.DirectNotifyGlobal import directNotify
 from . import Interval
 from . import Interval
 import random
 import random
 
 

+ 1 - 2
direct/src/interval/TestInterval.py

@@ -4,8 +4,7 @@ Contains the TestInterval class
 
 
 __all__ = ['TestInterval']
 __all__ = ['TestInterval']
 
 
-from panda3d.core import *
-from panda3d.direct import *
+from panda3d.direct import CInterval
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from .Interval import Interval
 from .Interval import Interval
 
 

+ 1 - 1
direct/src/leveleditor/ActionMgr.py

@@ -1,4 +1,4 @@
-from panda3d.core import *
+from panda3d.core import Mat4
 from direct.showbase.PythonUtil import Functor
 from direct.showbase.PythonUtil import Functor
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 
 

+ 0 - 2
direct/src/leveleditor/AnimControlUI.py

@@ -1,8 +1,6 @@
 """
 """
    This is the GUI for the Animation Control Panel
    This is the GUI for the Animation Control Panel
 """
 """
-from direct.interval.IntervalGlobal import *
-from direct.actor.Actor import *
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 
 
 import os
 import os

+ 1 - 1
direct/src/leveleditor/AnimMgr.py

@@ -1,7 +1,7 @@
 """
 """
 Defines AnimMgr
 Defines AnimMgr
 """
 """
-from .AnimMgrBase import *
+from .AnimMgrBase import AnimMgrBase
 
 
 class AnimMgr(AnimMgrBase):
 class AnimMgr(AnimMgrBase):
     """ Animation will create, manage, update animations in the scene """
     """ Animation will create, manage, update animations in the scene """

+ 3 - 1
direct/src/leveleditor/AnimMgrBase.py

@@ -5,7 +5,9 @@ Defines AnimMgrBase
 import os
 import os
 import math
 import math
 
 
-from direct.interval.IntervalGlobal import *
+from direct.interval.ActorInterval import ActorInterval
+from direct.interval.LerpInterval import LerpFunc, LerpPosHprInterval
+from direct.interval.MetaInterval import Parallel, Sequence
 from panda3d.core import VBase3
 from panda3d.core import VBase3
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 from . import AnimGlobals as AG
 from . import AnimGlobals as AG

+ 0 - 2
direct/src/leveleditor/CurveAnimUI.py

@@ -3,8 +3,6 @@
 """
 """
 import wx
 import wx
 
 
-from direct.interval.IntervalGlobal import *
-from direct.actor.Actor import *
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 
 
 
 

+ 2 - 4
direct/src/leveleditor/CurveEditor.py

@@ -2,12 +2,10 @@
 This is the module for curve edit
 This is the module for curve edit
 """
 """
 
 
-from panda3d.core import *
-from direct.wxwidgets.WxPandaShell import *
-from direct.showbase.DirectObject import *
+from panda3d.core import BitMask32, Mat4, NodePath
+from direct.showbase.DirectObject import DirectObject
 from direct.directtools.DirectSelection import SelectionRay
 from direct.directtools.DirectSelection import SelectionRay
 from direct.showutil.Rope import Rope
 from direct.showutil.Rope import Rope
-from .ActionMgr import *
 from direct.task import Task
 from direct.task import Task
 
 
 
 

+ 0 - 1
direct/src/leveleditor/GraphEditorUI.py

@@ -3,7 +3,6 @@ Defines Graph Editor
 """
 """
 import wx
 import wx
 import math
 import math
-from .PaletteTreeCtrl import *
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 from . import AnimGlobals as AG
 from . import AnimGlobals as AG
 from wx.lib.embeddedimage import PyEmbeddedImage
 from wx.lib.embeddedimage import PyEmbeddedImage

+ 0 - 1
direct/src/leveleditor/LayerEditorUI.py

@@ -2,7 +2,6 @@
 Defines Layer UI
 Defines Layer UI
 """
 """
 import wx
 import wx
-from panda3d.core import *
 
 
 from . import ObjectGlobals as OG
 from . import ObjectGlobals as OG
 
 

+ 9 - 7
direct/src/leveleditor/LevelEditor.py

@@ -5,13 +5,15 @@ LevelEditor, ObjectHandler, ObjectPalette should be rewritten
 to be game specific.
 to be game specific.
 """
 """
 
 
-from .LevelEditorUI import *
-from .LevelEditorBase import *
-from .ObjectMgr import *
-from .AnimMgr import *
-from .ObjectHandler import *
-from .ObjectPalette import *
-from .ProtoPalette import *
+import os
+import wx
+from .LevelEditorUI import LevelEditorUI
+from .LevelEditorBase import LevelEditorBase
+from .ObjectMgr import ObjectMgr
+from .AnimMgr import AnimMgr
+from .ObjectHandler import ObjectHandler
+from .ObjectPalette import ObjectPalette
+from .ProtoPalette import ProtoPalette
 
 
 class LevelEditor(LevelEditorBase):
 class LevelEditor(LevelEditorBase):
     """ Class for Panda3D LevelEditor """
     """ Class for Panda3D LevelEditor """

+ 19 - 9
direct/src/leveleditor/LevelEditorBase.py

@@ -5,15 +5,25 @@ You should write your own LevelEditor class inheriting this.
 Refer LevelEditor.py for example.
 Refer LevelEditor.py for example.
 """
 """
 
 
-from direct.showbase.DirectObject import *
-from direct.directtools.DirectUtil import *
-from direct.gui.DirectGui import *
-from panda3d.core import ClockObject
-
-from .CurveEditor import *
-from .FileMgr import *
-from .ActionMgr import *
-from .MayaConverter import *
+import os
+import wx
+
+from direct.showbase.DirectObject import DirectObject
+from direct.directtools.DirectUtil import useDirectRenderStyle
+from direct.gui.OnscreenText import OnscreenText
+from panda3d.core import BitMask32, ClockObject, Mat4, NodePath, Point3, TextNode, Vec4
+
+from . import ObjectGlobals as OG
+from .CurveEditor import CurveEditor
+from .FileMgr import FileMgr
+from .ActionMgr import (
+    ActionDeleteObj,
+    ActionDeselectAll,
+    ActionMgr,
+    ActionSelectObj,
+    ActionTransformObj,
+)
+from .MayaConverter import FROM_BAM_TO_MAYA, MayaConverter
 
 
 
 
 class LevelEditorBase(DirectObject):
 class LevelEditorBase(DirectObject):

+ 1 - 1
direct/src/leveleditor/LevelEditorUI.py

@@ -1,4 +1,4 @@
-from .LevelEditorUIBase import *
+from .LevelEditorUIBase import LevelEditorUIBase
 
 
 class LevelEditorUI(LevelEditorUIBase):
 class LevelEditorUI(LevelEditorUIBase):
     """ Class for Panda3D LevelEditor """
     """ Class for Panda3D LevelEditor """

Some files were not shown because too many files changed in this diff