Browse Source

explicit import paths

David Rose 21 years ago
parent
commit
b1db93fb87
100 changed files with 656 additions and 286 deletions
  1. 45 0
      direct/__init__.py
  2. 5 5
      direct/src/actor/Actor.py
  3. 1 1
      direct/src/actor/DistributedActor.py
  4. 0 0
      direct/src/actor/__init__.py
  5. 4 4
      direct/src/cluster/ClusterClient.py
  6. 1 1
      direct/src/cluster/ClusterConfig.py
  7. 3 3
      direct/src/cluster/ClusterMsgs.py
  8. 5 5
      direct/src/cluster/ClusterServer.py
  9. 0 0
      direct/src/cluster/__init__.py
  10. 0 1
      direct/src/dcparser/dcField.cxx
  11. 22 4
      direct/src/dcparser/dcParser.yxx
  12. 1 1
      direct/src/directbase/DirectStart.py
  13. 0 0
      direct/src/directbase/__init__.py
  14. 2 2
      direct/src/directdevices/DirectDeviceManager.py
  15. 2 2
      direct/src/directdevices/DirectFastrak.py
  16. 4 4
      direct/src/directdevices/DirectJoybox.py
  17. 2 2
      direct/src/directdevices/DirectRadamec.py
  18. 0 0
      direct/src/directdevices/__init__.py
  19. 1 1
      direct/src/directnotify/DirectNotify.py
  20. 4 4
      direct/src/directnotify/Notifier.py
  21. 0 0
      direct/src/directnotify/__init__.py
  22. 0 0
      direct/src/directscripts/__init__.py
  23. 2 2
      direct/src/directtools/DirectCameraControl.py
  24. 2 2
      direct/src/directtools/DirectGeometry.py
  25. 1 1
      direct/src/directtools/DirectGlobals.py
  26. 1 1
      direct/src/directtools/DirectGrid.py
  27. 1 1
      direct/src/directtools/DirectLights.py
  28. 2 2
      direct/src/directtools/DirectManipulation.py
  29. 1 1
      direct/src/directtools/DirectSelection.py
  30. 14 14
      direct/src/directtools/DirectSession.py
  31. 1 1
      direct/src/directtools/DirectUtil.py
  32. 0 0
      direct/src/directtools/__init__.py
  33. 2 2
      direct/src/directutil/DistributedLargeBlobSender.py
  34. 2 2
      direct/src/directutil/DistributedLargeBlobSenderAI.py
  35. 3 3
      direct/src/directutil/Mopath.py
  36. 0 0
      direct/src/directutil/__init__.py
  37. 2 2
      direct/src/distributed/CRCache.py
  38. 4 4
      direct/src/distributed/ClientRepository.py
  39. 3 3
      direct/src/distributed/ClockDelta.py
  40. 62 43
      direct/src/distributed/ConnectionRepository.py
  41. 3 3
      direct/src/distributed/DistributedNode.py
  42. 3 3
      direct/src/distributed/DistributedNodeAI.py
  43. 2 2
      direct/src/distributed/DistributedObject.py
  44. 272 0
      direct/src/distributed/DistributedObjectAI.py
  45. 2 2
      direct/src/distributed/DistributedSmoothNode.py
  46. 1 1
      direct/src/distributed/DistributedSmoothNodeAI.py
  47. 1 1
      direct/src/distributed/DistributedSmoothNodeBase.py
  48. 1 1
      direct/src/distributed/ParentMgr.py
  49. 2 2
      direct/src/distributed/PyDatagram.py
  50. 2 2
      direct/src/distributed/PyDatagramIterator.py
  51. 3 3
      direct/src/distributed/RelatedObjectMgr.py
  52. 0 0
      direct/src/distributed/__init__.py
  53. 16 6
      direct/src/distributed/cConnectionRepository.cxx
  54. 1 1
      direct/src/distributed/cConnectionRepository.h
  55. 3 3
      direct/src/extensions/CInterval-extensions.py
  56. 2 2
      direct/src/extensions/HTTPChannel-extensions.py
  57. 1 1
      direct/src/extensions/MouseWatcherRegion-extensions.py
  58. 45 45
      direct/src/extensions/NodePath-extensions.py
  59. 1 1
      direct/src/extensions/NodePathCollection-extensions.py
  60. 0 0
      direct/src/extensions/__init__.py
  61. 1 1
      direct/src/ffi/FFIConstants.py
  62. 3 3
      direct/src/ffi/FFIExternalObject.py
  63. 8 2
      direct/src/ffi/FFIInterrogateDatabase.py
  64. 1 1
      direct/src/ffi/FFIOverload.py
  65. 1 1
      direct/src/ffi/FFISpecs.py
  66. 2 2
      direct/src/ffi/FFITypes.py
  67. 0 0
      direct/src/ffi/__init__.py
  68. 5 4
      direct/src/ffi/genPyCode
  69. 2 2
      direct/src/ffi/generatePythonCode
  70. 2 2
      direct/src/fsm/ClassicFSM.py
  71. 2 2
      direct/src/fsm/FSM.py
  72. 2 2
      direct/src/fsm/FourState.py
  73. 2 2
      direct/src/fsm/FourStateAI.py
  74. 2 2
      direct/src/fsm/SampleFSM.py
  75. 1 1
      direct/src/fsm/State.py
  76. 2 2
      direct/src/fsm/StateData.py
  77. 0 0
      direct/src/fsm/__init__.py
  78. 4 4
      direct/src/gui/DirectGuiBase.py
  79. 1 1
      direct/src/gui/DirectGuiGlobals.py
  80. 1 1
      direct/src/gui/DirectGuiTest.py
  81. 1 1
      direct/src/gui/DirectScrolledList.py
  82. 1 1
      direct/src/gui/OnscreenGeom.py
  83. 1 1
      direct/src/gui/OnscreenImage.py
  84. 1 1
      direct/src/gui/OnscreenText.py
  85. 0 0
      direct/src/gui/__init__.py
  86. 3 3
      direct/src/interval/ActorInterval.py
  87. 4 4
      direct/src/interval/FunctionInterval.py
  88. 3 3
      direct/src/interval/IndirectInterval.py
  89. 8 8
      direct/src/interval/Interval.py
  90. 1 1
      direct/src/interval/IntervalGlobal.py
  91. 3 3
      direct/src/interval/IntervalManager.py
  92. 4 4
      direct/src/interval/IntervalTest.py
  93. 3 3
      direct/src/interval/LerpInterval.py
  94. 3 3
      direct/src/interval/MetaInterval.py
  95. 2 2
      direct/src/interval/MopathInterval.py
  96. 3 3
      direct/src/interval/ParticleInterval.py
  97. 4 4
      direct/src/interval/ProjectileInterval.py
  98. 2 2
      direct/src/interval/SoundInterval.py
  99. 0 0
      direct/src/interval/__init__.py
  100. 1 1
      direct/src/level/AmbientSound.py

+ 45 - 0
direct/__init__.py

@@ -0,0 +1,45 @@
+"""This file defines the path to the Python files within this package.
+There are two cases:
+
+(1) This is a source tree being run interactively by a developer, in
+    which case the Python files are found in package/src/*/*.py.  This
+    case also breaks down into two sub-cases: (1a) we are using the
+    ctattach tools, in which case we should look for the files in the
+    actual source directory according to the ctattach variables, or
+    (1b) we are not using the ctattach tools, in which case the files
+    are right where we expect them to be.
+
+(2) This is an installed tree being run by an end-user, in which case
+    the Python files are found in package/*/*.py.  In this case, this
+    file doesn't really need to be installed; an empty __init__.py
+    file to define the package would serve just as well.  But the file
+    is crafted so that it will do no harm if it is installed.
+"""
+
+package = 'DIRECT'
+
+import os
+
+if os.getenv('CTPROJS'):
+    # Ok, this is case (1a): we are using the ctattach tools, are
+    # therefore will expect to find the source files in
+    # $(package)/src/*/*.py.  Completely replace the search path with
+    # this path.
+    tree = os.getenv(package)
+
+    if not tree:
+        raise StandardError, 'CTPROJS is defined, but $%s is not defined!' % (package)
+    __path__[0] = os.path.join(tree, 'src')
+
+else:
+    # We are not using the ctattach tools.
+    srcDir = os.path.join(__path__[0], 'src')
+    if os.path.isdir(srcDir):
+        # The source directory exists; therefore, we are in case (1b).
+        __path__[0] = srcDir
+
+    else:
+        # The source directory does not exist, so we must be in case
+        # (2).  Leave well enough alone.
+        pass
+    

+ 5 - 5
direct/src/actor/Actor.py

@@ -1,7 +1,7 @@
 """Actor module: contains the Actor class"""
 """Actor module: contains the Actor class"""
 
 
-from PandaObject import *
-import LODNode
+from direct.showbase.PandaObject import *
+from pandac import LODNode
 import types
 import types
 
 
 class Actor(PandaObject, NodePath):
 class Actor(PandaObject, NodePath):
@@ -935,8 +935,8 @@ class Actor(PandaObject, NodePath):
 
 
     # actions
     # actions
     def animPanel(self):
     def animPanel(self):
-        import TkGlobal
-        import AnimPanel
+        from direct.showbase import TkGlobal
+        from direct.tkpanels import AnimPanel
         return AnimPanel.AnimPanel(self)
         return AnimPanel.AnimPanel(self)
     
     
     def stop(self, animName=None, partName=None):
     def stop(self, animName=None, partName=None):
@@ -1369,6 +1369,6 @@ class Actor(PandaObject, NodePath):
                         [other.__animControlDict[lodName][partName][animName][0], None]
                         [other.__animControlDict[lodName][partName][animName][0], None]
 
 
     def actorInterval(self, *args, **kw):
     def actorInterval(self, *args, **kw):
-        import ActorInterval
+        from direct.interval import ActorInterval
         return ActorInterval.ActorInterval(self, *args, **kw)
         return ActorInterval.ActorInterval(self, *args, **kw)
 
 

+ 1 - 1
direct/src/actor/DistributedActor.py

@@ -1,6 +1,6 @@
 """DistributedActor module: contains the DistributedActor class"""
 """DistributedActor module: contains the DistributedActor class"""
 
 
-import DistributedNode
+from direct.distributed import DistributedNode
 import Actor
 import Actor
 
 
 class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
 class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):

+ 0 - 0
direct/src/actor/__init__.py


+ 4 - 4
direct/src/cluster/ClusterClient.py

@@ -1,11 +1,11 @@
 """ClusterClient: Master for mutli-piping or PC clusters.  """
 """ClusterClient: Master for mutli-piping or PC clusters.  """
 
 
-from PandaModules import *
+from pandac.PandaModules import *
 from ClusterMsgs import *
 from ClusterMsgs import *
 from ClusterConfig import *
 from ClusterConfig import *
-import DirectNotifyGlobal
-import DirectObject
-import Task
+from direct.directnotify import DirectNotifyGlobal
+from direct.showbase import DirectObject
+from direct.task import Task
 import os
 import os
 
 
 class ClusterClient(DirectObject.DirectObject):
 class ClusterClient(DirectObject.DirectObject):

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

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from ClusterClient import *
 from ClusterClient import *
 import string
 import string
 
 

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

@@ -3,9 +3,9 @@
 # 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 PandaModules import *
-from PyDatagram import PyDatagram
-from PyDatagramIterator import PyDatagramIterator
+from pandac.PandaModules import *
+from direct.distributed.PyDatagram import PyDatagram
+from direct.distributed.PyDatagramIterator import PyDatagramIterator
 import time
 import time
 
 
 #these are the types of messages that are currently supported.
 #these are the types of messages that are currently supported.

+ 5 - 5
direct/src/cluster/ClusterServer.py

@@ -1,9 +1,9 @@
-from PandaModules import *
+from pandac.PandaModules import *
 from ClusterMsgs import *
 from ClusterMsgs import *
-from MsgTypes import *
-import DirectNotifyGlobal
-import DirectObject
-import Task
+from direct.distributed.MsgTypes import *
+from direct.directnotify import DirectNotifyGlobal
+from direct.showbase import DirectObject
+from direct.task import Task
 
 
 # NOTE: This assumes the following variables are set via bootstrap command line
 # NOTE: This assumes the following variables are set via bootstrap command line
 # arguments on server startup:
 # arguments on server startup:

+ 0 - 0
direct/src/cluster/__init__.py


+ 0 - 1
direct/src/dcparser/dcField.cxx

@@ -19,7 +19,6 @@
 #include "dcField.h"
 #include "dcField.h"
 #include "hashGenerator.h"
 #include "hashGenerator.h"
 #include "dcmsgtypes.h"
 #include "dcmsgtypes.h"
-#include "notify.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: DCField::get_number
 //     Function: DCField::get_number

+ 22 - 4
direct/src/dcparser/dcParser.yxx

@@ -85,6 +85,8 @@ dc_cleanup_parser() {
 %type <u.dclass> dclass_name
 %type <u.dclass> dclass_name
 %type <u.atomic> atomic_name
 %type <u.atomic> atomic_name
 %type <u.subatomic> type_token
 %type <u.subatomic> type_token
+%type <str> import_identifier
+%type <str> slash_identifier
 
 
 %%
 %%
 
 
@@ -120,12 +122,28 @@ dclass_name:
 }
 }
 	;
 	;
 
 
+slash_identifier:
+        IDENTIFIER
+	| slash_identifier '/' IDENTIFIER
+{
+  $$ = $1 + string("/") + $3;
+}
+	;
+
+import_identifier:
+        slash_identifier
+	| import_identifier '.' slash_identifier
+{
+  $$ = $1 + string(".") + $3;
+}
+	;
+
 import:
 import:
-	KW_IMPORT IDENTIFIER
+	KW_IMPORT import_identifier
 {
 {
   dc_file->add_import_module($2);
   dc_file->add_import_module($2);
 }
 }
-	| KW_FROM IDENTIFIER KW_IMPORT 
+	| KW_FROM import_identifier KW_IMPORT 
 {
 {
   dc_file->add_import_module($2);
   dc_file->add_import_module($2);
 }
 }
@@ -141,11 +159,11 @@ import_symbol_list_or_star:
 	;
 	;
 
 
 import_symbol_list:
 import_symbol_list:
-	IDENTIFIER
+	slash_identifier
 {
 {
   dc_file->add_import_symbol($1);
   dc_file->add_import_symbol($1);
 }
 }
-	| import_symbol_list ',' IDENTIFIER
+	| import_symbol_list ',' slash_identifier
 {
 {
   dc_file->add_import_symbol($3);
   dc_file->add_import_symbol($3);
 }
 }

+ 1 - 1
direct/src/directbase/DirectStart.py

@@ -1,4 +1,4 @@
 print 'DirectStart: Starting the game.'
 print 'DirectStart: Starting the game.'
 
 
-import ShowBase
+from direct.showbase import ShowBase
 ShowBase.ShowBase()
 ShowBase.ShowBase()

+ 0 - 0
direct/src/directbase/__init__.py


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

@@ -1,7 +1,7 @@
 """ Class used to create and control vrpn devices """
 """ Class used to create and control vrpn devices """
 
 
-from DirectObject import *
-from PandaModules import *
+from direct.showbase.DirectObject import *
+from pandac.PandaModules import *
 
 
 ANALOG_MIN = -0.95
 ANALOG_MIN = -0.95
 ANALOG_MAX = 0.95
 ANALOG_MAX = 0.95

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

@@ -1,9 +1,9 @@
 """ Class used to create and control radamec device """
 """ Class used to create and control radamec device """
 from math import *
 from math import *
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectDeviceManager import *
 from DirectDeviceManager import *
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 
 
 """
 """
 TODO:
 TODO:

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

@@ -1,9 +1,9 @@
 """ Class used to create and control joybox device """
 """ Class used to create and control joybox device """
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectDeviceManager import *
 from DirectDeviceManager import *
-from DirectUtil import *
-import OnscreenText
-import Task
+from direct.directtools.DirectUtil import *
+from direct.gui import OnscreenText
+from direct.task import Task
 
 
 """
 """
 TODO:
 TODO:

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

@@ -1,9 +1,9 @@
 """ Class used to create and control radamec device """
 """ Class used to create and control radamec device """
 from math import *
 from math import *
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectDeviceManager import *
 from DirectDeviceManager import *
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 
 
 
 
 """
 """

+ 0 - 0
direct/src/directdevices/__init__.py


+ 1 - 1
direct/src/directnotify/DirectNotify.py

@@ -102,5 +102,5 @@ class DirectNotify:
             self.setDconfigLevel(categoryName)
             self.setDconfigLevel(categoryName)
 
 
     def popupControls(self, tl = None):
     def popupControls(self, tl = None):
-        import NotifyPanel
+        from direct.tkpanels import NotifyPanel
         NotifyPanel.NotifyPanel(self, tl)
         NotifyPanel.NotifyPanel(self, tl)

+ 4 - 4
direct/src/directnotify/Notifier.py

@@ -2,7 +2,7 @@
    for the programmer/user"""
    for the programmer/user"""
 
 
 from LoggerGlobal import *
 from LoggerGlobal import *
-import PythonUtil
+from direct.showbase import PythonUtil
 import time
 import time
 
 
 class Notifier:
 class Notifier:
@@ -41,7 +41,7 @@ class Notifier:
         delta = int(round(delta))
         delta = int(round(delta))
         Notifier.serverDelta = delta + time.timezone - timezone
         Notifier.serverDelta = delta + time.timezone - timezone
 
 
-        import NotifyCategory
+        from pandac import NotifyCategory
         NotifyCategory.NotifyCategory.setServerDelta(self.serverDelta)
         NotifyCategory.NotifyCategory.setServerDelta(self.serverDelta)
             
             
         self.info("Notify clock adjusted by %s (and timezone adjusted by %s hours) to synchronize with server." % (PythonUtil.formatElapsedSeconds(delta), (time.timezone - timezone) / 3600))
         self.info("Notify clock adjusted by %s (and timezone adjusted by %s hours) to synchronize with server." % (PythonUtil.formatElapsedSeconds(delta), (time.timezone - timezone) / 3600))
@@ -71,7 +71,7 @@ class Notifier:
 
 
     # Severity funcs
     # Severity funcs
     def setSeverity(self, severity):
     def setSeverity(self, severity):
-        import NotifySeverity
+        from pandac import NotifySeverity
         if severity >= NotifySeverity.NSError:
         if severity >= NotifySeverity.NSError:
             self.setWarning(0)
             self.setWarning(0)
             self.setInfo(0)
             self.setInfo(0)
@@ -90,7 +90,7 @@ class Notifier:
             self.setDebug(1)
             self.setDebug(1)
 
 
     def getSeverity(self):
     def getSeverity(self):
-        import NotifySeverity
+        from pandac import NotifySeverity
         if self.getDebug():
         if self.getDebug():
             return NotifySeverity.NSDebug
             return NotifySeverity.NSDebug
         elif self.getInfo():
         elif self.getInfo():

+ 0 - 0
direct/src/directnotify/__init__.py


+ 0 - 0
direct/src/directscripts/__init__.py


+ 2 - 2
direct/src/directtools/DirectCameraControl.py

@@ -1,8 +1,8 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectUtil import *
 from DirectUtil import *
 from DirectGeometry import *
 from DirectGeometry import *
 from DirectGlobals import *
 from DirectGlobals import *
-import Task
+from direct.task import Task
 
 
 CAM_MOVE_DURATION = 1.2
 CAM_MOVE_DURATION = 1.2
 COA_MARKER_SF = 0.0075
 COA_MARKER_SF = 0.0075

+ 2 - 2
direct/src/directtools/DirectGeometry.py

@@ -1,5 +1,5 @@
-from PandaModules import *
-from PandaObject import *
+from pandac.PandaModules import *
+from direct.showbase.PandaObject import *
 from DirectGlobals import *
 from DirectGlobals import *
 from DirectUtil import *
 from DirectUtil import *
 import math
 import math

+ 1 - 1
direct/src/directtools/DirectGlobals.py

@@ -1,4 +1,4 @@
-from PandaModules import Vec3, Point3
+from pandac.PandaModules import Vec3, Point3
 
 
 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible',
 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible',
               'GridBack', 'unpickable']
               'GridBack', 'unpickable']

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

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectUtil import *
 from DirectUtil import *
 from DirectGeometry import *
 from DirectGeometry import *
 
 

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

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from string import lower
 from string import lower
 
 
 class DirectLight(NodePath):
 class DirectLight(NodePath):

+ 2 - 2
direct/src/directtools/DirectManipulation.py

@@ -1,8 +1,8 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectGlobals import *
 from DirectGlobals import *
 from DirectUtil import *
 from DirectUtil import *
 from DirectGeometry import *
 from DirectGeometry import *
-import Task
+from direct.task import Task
 
 
 class DirectManipulationControl(PandaObject):
 class DirectManipulationControl(PandaObject):
     def __init__(self):
     def __init__(self):

+ 1 - 1
direct/src/directtools/DirectSelection.py

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectGlobals import *
 from DirectGlobals import *
 from DirectUtil import *
 from DirectUtil import *
 from DirectGeometry import *
 from DirectGeometry import *

+ 14 - 14
direct/src/directtools/DirectSession.py

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectGlobals import *
 from DirectGlobals import *
 from DirectUtil import*
 from DirectUtil import*
 from DirectCameraControl import *
 from DirectCameraControl import *
@@ -7,15 +7,15 @@ from DirectSelection import *
 from DirectGrid import *
 from DirectGrid import *
 from DirectGeometry import *
 from DirectGeometry import *
 from DirectLights import *
 from DirectLights import *
-from ClusterClient import *
-from ClusterServer import *
-import Placer
-import Slider
-import SceneGraphExplorer
-import OnscreenText
+from direct.cluster.ClusterClient import *
+from direct.cluster.ClusterServer import *
+from direct.tkpanels import Placer
+from direct.tkwidgets import Slider
+from direct.tkwidgets import SceneGraphExplorer
+from direct.gui import OnscreenText
 import types
 import types
 import string
 import string
-import Loader
+from direct.showbase import Loader
 
 
 class DirectSession(PandaObject):
 class DirectSession(PandaObject):
 
 
@@ -84,20 +84,20 @@ class DirectSession(PandaObject):
         self.radamec = None
         self.radamec = None
         self.fastrak = []
         self.fastrak = []
         if base.config.GetBool('want-vrpn', 0):
         if base.config.GetBool('want-vrpn', 0):
-            import DirectDeviceManager
+            from direct.directdevices import DirectDeviceManager
             self.deviceManager = DirectDeviceManager.DirectDeviceManager()
             self.deviceManager = DirectDeviceManager.DirectDeviceManager()
             # Automatically create any devices specified in config file
             # Automatically create any devices specified in config file
             joybox = base.config.GetString('vrpn-joybox-device', '')
             joybox = base.config.GetString('vrpn-joybox-device', '')
             radamec = base.config.GetString('vrpn-radamec-device', '')
             radamec = base.config.GetString('vrpn-radamec-device', '')
             fastrak = base.config.GetString('vrpn-fastrak-device', '')
             fastrak = base.config.GetString('vrpn-fastrak-device', '')
             if joybox:
             if joybox:
-                import DirectJoybox
+                from direct.directdevices import DirectJoybox
                 self.joybox = DirectJoybox.DirectJoybox(joybox)
                 self.joybox = DirectJoybox.DirectJoybox(joybox)
             if radamec:
             if radamec:
-                import DirectRadamec
+                from direct.directdevices import DirectRadamec
                 self.radamec = DirectRadamec.DirectRadamec(radamec)
                 self.radamec = DirectRadamec.DirectRadamec(radamec)
             if fastrak:
             if fastrak:
-                import DirectFastrak
+                from direct.directdevices import DirectFastrak
                 # parse string into format device:N where N is the sensor name
                 # parse string into format device:N where N is the sensor name
                 fastrak = string.split(fastrak)
                 fastrak = string.split(fastrak)
                 for i in range(len(fastrak))[1:]:
                 for i in range(len(fastrak))[1:]:
@@ -170,8 +170,8 @@ class DirectSession(PandaObject):
                             ]
                             ]
 
 
         if base.wantTk:
         if base.wantTk:
-            import TkGlobal
-            import DirectSessionPanel
+            from direct.showbase import TkGlobal
+            from direct.tkpanels import DirectSessionPanel
             self.panel = DirectSessionPanel.DirectSessionPanel(parent = tkroot)
             self.panel = DirectSessionPanel.DirectSessionPanel(parent = tkroot)
         try:
         try:
             # Has the clusterMode been set externally (i.e. via the
             # Has the clusterMode been set externally (i.e. via the

+ 1 - 1
direct/src/directtools/DirectUtil.py

@@ -1,4 +1,4 @@
-from PandaObject import *
+from direct.showbase.PandaObject import *
 from DirectGlobals import *
 from DirectGlobals import *
 
 
 # Routines to adjust values
 # Routines to adjust values

+ 0 - 0
direct/src/directtools/__init__.py


+ 2 - 2
direct/src/directutil/DistributedLargeBlobSender.py

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

+ 2 - 2
direct/src/directutil/DistributedLargeBlobSenderAI.py

@@ -1,7 +1,7 @@
 """DistributedLargeBlobSenderAI module: contains the DistributedLargeBlobSenderAI class"""
 """DistributedLargeBlobSenderAI module: contains the DistributedLargeBlobSenderAI class"""
 
 
-import DistributedObjectAI
-import DirectNotifyGlobal
+from direct.distributed import DistributedObjectAI
+from direct.directnotify import DirectNotifyGlobal
 import LargeBlobSenderConsts
 import LargeBlobSenderConsts
 
 
 class DistributedLargeBlobSenderAI(DistributedObjectAI.DistributedObjectAI):
 class DistributedLargeBlobSenderAI(DistributedObjectAI.DistributedObjectAI):

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

@@ -1,7 +1,7 @@
-from PandaObject import *
-from DirectGeometry import *
+from direct.showbase.PandaObject import *
+from direct.directtools.DirectGeometry import *
 
 
-import NodePath
+from pandac import NodePath
 
 
 class Mopath(PandaObject):
 class Mopath(PandaObject):
 
 

+ 0 - 0
direct/src/directutil/__init__.py


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

@@ -1,6 +1,6 @@
 """CRCache module: contains the CRCache class"""
 """CRCache module: contains the CRCache class"""
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 import DistributedObject
 import DistributedObject
 
 
 class CRCache:
 class CRCache:
@@ -86,7 +86,7 @@ class CRCache:
     def checkCache(self):
     def checkCache(self):
         # For debugging; this verifies that the cache is sensible and
         # For debugging; this verifies that the cache is sensible and
         # returns true if so.
         # returns true if so.
-        from PandaModules import NodePath
+        from pandac.PandaModules import NodePath
         for obj in self.dict.values():
         for obj in self.dict.values():
             if isinstance(obj, NodePath):
             if isinstance(obj, NodePath):
                 assert(not obj.isEmpty() and obj.getTopNode() != render.node())
                 assert(not obj.isEmpty() and obj.getTopNode() != render.node())

+ 4 - 4
direct/src/distributed/ClientRepository.py

@@ -1,12 +1,12 @@
 """ClientRepository module: contains the ClientRepository class"""
 """ClientRepository module: contains the ClientRepository class"""
 
 
-from PandaModules import *
+from pandac.PandaModules import *
 from MsgTypes import *
 from MsgTypes import *
-import Task
-import DirectNotifyGlobal
+from direct.task import Task
+from direct.directnotify import DirectNotifyGlobal
 import CRCache
 import CRCache
 import ConnectionRepository
 import ConnectionRepository
-import PythonUtil
+from direct.showbase import PythonUtil
 import ParentMgr
 import ParentMgr
 import RelatedObjectMgr
 import RelatedObjectMgr
 import time
 import time

+ 3 - 3
direct/src/distributed/ClockDelta.py

@@ -1,9 +1,9 @@
 # ClockDelta provides the ability to use clock synchronization for
 # ClockDelta provides the ability to use clock synchronization for
 # distributed objects
 # distributed objects
 
 
-from PandaModules import *
-import DirectNotifyGlobal
-import DirectObject
+from pandac.PandaModules import *
+from direct.directnotify import DirectNotifyGlobal
+from direct.showbase import DirectObject
 import math
 import math
 
 
 # The following two parameters, NetworkTimeBits and
 # The following two parameters, NetworkTimeBits and

+ 62 - 43
direct/src/distributed/ConnectionRepository.py

@@ -1,11 +1,12 @@
-from PandaModules import *
-import Task
-import DirectNotifyGlobal
-import DirectObject
+from pandac.PandaModules import *
+from direct.task import Task
+from direct.directnotify import DirectNotifyGlobal
+from direct.showbase import DirectObject
 from PyDatagram import PyDatagram
 from PyDatagram import PyDatagram
 from PyDatagramIterator import PyDatagramIterator
 from PyDatagramIterator import PyDatagramIterator
 
 
 import types
 import types
+import imp
 
 
 class ConnectionRepository(DirectObject.DirectObject, CConnectionRepository):
 class ConnectionRepository(DirectObject.DirectObject, CConnectionRepository):
     """
     """
@@ -52,6 +53,10 @@ class ConnectionRepository(DirectObject.DirectObject, CConnectionRepository):
 
 
         self.recorder = None
         self.recorder = None
 
 
+        # This is the string that is appended to symbols read from the
+        # DC file.  The AIRepository will redefine this to 'AI'.
+        self.dcSuffix = ''
+
     def readDCFile(self, dcFileNames = None):
     def readDCFile(self, dcFileNames = None):
 
 
         """ Reads in the dc files listed in dcFileNames, or if
         """ Reads in the dc files listed in dcFileNames, or if
@@ -79,43 +84,33 @@ class ConnectionRepository(DirectObject.DirectObject, CConnectionRepository):
         # Now import all of the modules required by the DC file.
         # Now import all of the modules required by the DC file.
         for n in range(dcFile.getNumImportModules()):
         for n in range(dcFile.getNumImportModules()):
             moduleName = dcFile.getImportModule(n)
             moduleName = dcFile.getImportModule(n)
-            moduleName = self.mangleDCName(moduleName)
-
-            module = __import__(moduleName, globals(), locals())
-
-            if dcFile.getNumImportSymbols(n) > 0:
-                # "from moduleName import symbolName, symbolName, ..."
-                # Copy just the named symbols into the dictionary.
-                for i in range(dcFile.getNumImportSymbols(n)):
-                    symbolName = dcFile.getImportSymbol(n, i)
-                    if symbolName == '*':
-                        # Get all symbols.
-                        dcImports.update(module.__dict__)
-                    else:
-                        mangledName = self.mangleName(symbolName)
-                        gotAny = 0
-                        if hasattr(module, symbolName):
-                            dcImports[symbolName] = getattr(module, symbolName)
-                            gotAny = 1
-                        if hasattr(module, mangledName): 
-                            dcImports[mangledName] = getattr(module, mangledName)
-                            gotAny = 1
-                            
-                        if not gotAny:
-                            self.notify.error("Symbol %s not found in module %s." % (
-                                symbolName, moduleName))
-            else:
-                # "import moduleName"
-                # Copy the module itself into the dictionary.
-                dcImports[moduleName] = module
+
+            # Maybe the module name is represented as "moduleName/AI".
+            suffix = moduleName.split('/')
+            moduleName = suffix[0]
+            if self.dcSuffix and self.dcSuffix in suffix[1:]:
+                moduleName += self.dcSuffix
+
+            importSymbols = []
+            for i in range(dcFile.getNumImportSymbols(n)):
+                symbolName = dcFile.getImportSymbol(n, i)
+
+                # Maybe the symbol name is represented as "symbolName/AI".
+                suffix = symbolName.split('/')
+                symbolName = suffix[0]
+                if self.dcSuffix and self.dcSuffix in suffix[1:]:
+                    symbolName += self.dcSuffix
+
+                importSymbols.append(symbolName)
+                
+            self.importModule(dcImports, moduleName, importSymbols)
 
 
         # Now get the class definition for the classes named in the DC
         # Now get the class definition for the classes named in the DC
         # file.
         # file.
         for i in range(dcFile.getNumClasses()):
         for i in range(dcFile.getNumClasses()):
             dclass = dcFile.getClass(i)
             dclass = dcFile.getClass(i)
             number = dclass.getNumber()
             number = dclass.getNumber()
-            className = dclass.getName()
-            className = self.mangleDCName(className)
+            className = dclass.getName() + self.dcSuffix
 
 
             # Does the class have a definition defined in the newly
             # Does the class have a definition defined in the newly
             # imported namespace?
             # imported namespace?
@@ -136,14 +131,38 @@ class ConnectionRepository(DirectObject.DirectObject, CConnectionRepository):
             self.dclassesByName[className] = dclass
             self.dclassesByName[className] = dclass
             self.dclassesByNumber[number] = dclass
             self.dclassesByNumber[number] = dclass
 
 
-    def mangleDCName(self, name):
-        """ This is provided as a hook so that derived classes
-        (e.g. the AIRepository) can rename symbols from the .dc file
-        according to the conventions associated with this particular
-        repository (e.g., an AIRepository appends 'AI' to class and
-        module names)."""
-        
-        return name
+    def importModule(self, dcImports, moduleName, importSymbols):
+        """ Imports the indicated moduleName and all of its symbols
+        into the current namespace.  This more-or-less reimplements
+        the Python import command. """
+
+        module = __import__(moduleName, globals(), locals(), importSymbols)
+
+        if importSymbols:
+            # "from moduleName import symbolName, symbolName, ..."
+            # Copy just the named symbols into the dictionary.
+            if importSymbols == ['*']:
+                # "from moduleName import *"
+                if hasattr(module, "__all__"):
+                    importSymbols = module.__all__
+                else:
+                    importSymbols = module.__dict__.keys()
+            
+            for symbolName in importSymbols:
+                if hasattr(module, symbolName):
+                    dcImports[symbolName] = getattr(module, symbolName)
+
+                else:
+                    raise StandardError, 'Symbol %s not defined in module %s.' % (symbolName, moduleName)
+
+        else:
+            # "import moduleName"
+
+            # Copy the root module name into the dictionary.
+
+            # Follow the dotted chain down to the actual module.
+            components = moduleName.split('.')
+            dcImports[components[0]] = module
 
 
     def connect(self, serverList, 
     def connect(self, serverList, 
                 successCallback = None, successArgs = [],
                 successCallback = None, successArgs = [],

+ 3 - 3
direct/src/distributed/DistributedNode.py

@@ -1,9 +1,9 @@
 """DistributedNode module: contains the DistributedNode class"""
 """DistributedNode module: contains the DistributedNode class"""
 
 
-from ShowBaseGlobal import *
-from PandaModules import NodePath
+from direct.showbase.ShowBaseGlobal import *
+from pandac.PandaModules import NodePath
 import DistributedObject
 import DistributedObject
-import Task
+from direct.task import Task
 import types
 import types
 
 
 class DistributedNode(DistributedObject.DistributedObject, NodePath):
 class DistributedNode(DistributedObject.DistributedObject, NodePath):

+ 3 - 3
direct/src/distributed/DistributedNodeAI.py

@@ -1,6 +1,6 @@
-from AIBaseGlobal import *
-from PandaModules import NodePath
-import DistributedObjectAI
+from otp.ai.AIBaseGlobal import *
+from pandac.PandaModules import NodePath
+from direct.distributed import DistributedObjectAI
 
 
 class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI, NodePath):
 class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI, NodePath):
     def __init__(self, air, name=None):
     def __init__(self, air, name=None):

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

@@ -1,7 +1,7 @@
 """DistributedObject module: contains the DistributedObject class"""
 """DistributedObject module: contains the DistributedObject class"""
 
 
-from PandaObject import *
-from DirectNotifyGlobal import *
+from direct.showbase.PandaObject import *
+from direct.directnotify.DirectNotifyGlobal import *
 from PyDatagram import PyDatagram
 from PyDatagram import PyDatagram
 from PyDatagramIterator import PyDatagramIterator
 from PyDatagramIterator import PyDatagramIterator
 
 

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

@@ -0,0 +1,272 @@
+"""DistributedObjectAI module: contains the DistributedObjectAI class"""
+
+from direct.directnotify.DirectNotifyGlobal import *
+from direct.showbase import PythonUtil
+from direct.showbase import DirectObject
+from pandac.PandaModules import *
+from PyDatagram import PyDatagram
+from PyDatagramIterator import PyDatagramIterator
+
+class DistributedObjectAI(DirectObject.DirectObject):
+    """Distributed Object class:"""
+    
+    notify = directNotify.newCategory("DistributedObjectAI")
+    
+    def __init__(self, air):
+        try:
+            self.DistributedObjectAI_initialized
+        except:
+            self.DistributedObjectAI_initialized = 1
+            # Record the repository
+            self.air = air
+            # Record our distributed class
+            className = self.__class__.__name__
+            self.dclass = self.air.dclassesByName[className]
+            # init doId pre-allocated flag
+            self.__preallocDoId = 0
+
+            # These are used to implement beginBarrier().
+            self.__nextBarrierContext = 0
+            self.__barriers = {}
+
+    # Uncomment if you want to debug DO leaks
+    #def __del__(self):
+    #    """
+    #    For debugging purposes, this just prints out what got deleted
+    #    """
+    #    print ("Destructing: " + self.__class__.__name__)
+
+    def delete(self):
+        """
+        Inheritors should redefine this to take appropriate action on delete
+        Note that this may be called multiple times if a class inherits
+        from DistributedObjectAI more than once.
+        """
+        # prevent this code from executing multiple times
+        if self.air is not None:
+            # self.doId may not exist.  The __dict__ syntax works around that.
+            assert(self.notify.debug('delete(): %s' % (self.__dict__.get("doId"))))
+            # Clean up all the pending barriers.
+            for barrier in self.__barriers.values():
+                barrier.cleanup()
+            self.__barriers = {}
+
+            if not hasattr(self, "doNotDeallocateChannel"):
+                if self.air:
+                    self.air.deallocateChannel(self.doId)
+            self.air = None
+            del self.zoneId
+
+    def isDeleted(self):
+        """
+        Returns true if the object has been deleted,
+        or if it is brand new and hasn't yet been generated.
+        """
+        return (self.air == None)
+
+    def isGenerated(self):
+        """
+        Returns true if the object has been generated
+        """
+        return hasattr(self, 'zoneId')
+    
+    def getDoId(self):
+        """
+        Return the distributed object id
+        """
+        return self.doId
+
+    def preAllocateDoId(self):
+        """
+        objects that need to have a doId before they are generated
+        can call this to pre-allocate a doId for the object
+        """
+        assert not self.__preallocDoId
+        self.doId = self.air.allocateChannel()
+        self.__preallocDoId = 1
+    
+    def updateRequiredFields(self, dclass, di):
+        dclass.receiveUpdateBroadcastRequired(self, di)
+    
+    def updateAllRequiredFields(self, dclass, di):
+        dclass.receiveUpdateAllRequired(self, di)
+
+    def updateRequiredOtherFields(self, dclass, di):
+        dclass.receiveUpdateBroadcastRequired(self, di)
+        dclass.receiveUpdateOther(self, di)
+
+    def updateAllRequiredOtherFields(self, dclass, di):
+        dclass.receiveUpdateAllRequired(self, di)
+        dclass.receiveUpdateOther(self, di)
+
+    def getZoneChangeEvent(self):
+        return 'DOChangeZone-%s' % self.doId
+    
+    def handleZoneChange(self, newZoneId, oldZoneId):
+        assert oldZoneId == self.zoneId
+        self.zoneId = newZoneId
+        self.air.changeDOZoneInTables(self, newZoneId, oldZoneId)
+        messenger.send(self.getZoneChangeEvent(), [newZoneId, oldZoneId])
+
+    def sendUpdate(self, fieldName, args = []):
+        if self.air:
+            self.air.sendUpdate(self, fieldName, args)
+
+    def sendUpdateToAvatarId(self, avId, fieldName, args):
+        channelId = avId + 1
+        self.sendUpdateToChannel(channelId, fieldName, args)
+
+    def sendUpdateToChannel(self, channelId, fieldName, args):
+        if self.air:
+            self.air.sendUpdateToChannel(self, channelId, fieldName, args)
+
+    def generateWithRequired(self, zoneId, optionalFields=[]):
+        # have we already allocated a doId?
+        if self.__preallocDoId:
+            self.__preallocDoId = 0
+            return self.generateWithRequiredAndId(
+                self.doId, zoneId, optionalFields)
+            
+        # The repository is the one that really does the work
+        self.air.generateWithRequired(self, zoneId, optionalFields)
+        self.zoneId = zoneId
+        self.generate()
+
+    # this is a special generate used for estates, or anything else that
+    # needs to have a hard coded doId as assigned by the server
+    def generateWithRequiredAndId(self, doId, zoneId, optionalFields=[]):
+        # have we already allocated a doId?
+        if self.__preallocDoId:
+            self.__preallocDoId = 0
+            assert doId == self.doId
+
+        # The repository is the one that really does the work
+        self.air.generateWithRequiredAndId(self, doId, zoneId, optionalFields)
+        self.zoneId = zoneId
+        self.generate()
+
+    def generate(self):
+        # Inheritors should put functions that require self.zoneId or
+        # other networked info in this function.
+        assert(self.notify.debug('generate(): %s' % (self.doId)))
+        pass
+
+    def sendGenerateWithRequired(self, repository, zoneId, optionalFields=[]):
+        # Make the dclass do the hard work
+        dg = self.dclass.aiFormatGenerate(self, self.doId, zoneId,
+                                          repository.districtId,
+                                          repository.ourChannel,
+                                          optionalFields)
+        repository.send(dg)
+        self.zoneId = zoneId
+            
+    def initFromServerResponse(self, valDict):
+        # This is a special method used for estates, etc., which get
+        # their fields set from the database indirectly by way of the
+        # AI.  The input parameter is a dictionary of field names to
+        # datagrams that describes the initial field values from the
+        # database.
+        assert(self.notify.debug("initFromServerResponse(%s)" % (valDict.keys(),)))
+
+        dclass = self.dclass
+        for key, value in valDict.items():
+            # Update the field
+            dclass.directUpdate(self, key, value)
+
+    def requestDelete(self):
+        if not self.air:
+            doId = "none"
+            if hasattr(self, "doId"):
+                doId = self.doId
+            self.notify.warning("Tried to delete a %s (doId %s) that is already deleted" % (self.__class__, doId))
+            return
+        self.air.requestDelete(self)
+
+    def taskName(self, taskString):
+        return (taskString + "-" + str(self.getDoId()))
+
+    def uniqueName(self, idString):
+        return (idString + "-" + str(self.getDoId()))
+    
+    def validate(self, avId, bool, msg):
+        if not bool:
+            self.air.writeServerEvent('suspicious', avId, msg)
+            self.notify.warning('validate error: avId: %s -- %s' % (avId, msg))
+        return bool
+
+    def beginBarrier(self, name, avIds, timeout, callback):
+        # Begins waiting for a set of avatars.  When all avatars in
+        # the list have reported back in or the callback has expired,
+        # calls the indicated callback with the list of toons that
+        # made it through.  There may be multiple barriers waiting
+        # simultaneously on different lists of avatars, although they
+        # should have different names.
+        
+        from toontown.ai import ToonBarrier
+        context = self.__nextBarrierContext
+        # We assume the context number is passed as a uint16.
+        self.__nextBarrierContext = (self.__nextBarrierContext + 1) & 0xffff
+
+        assert(self.notify.debug('beginBarrier(%s, %s, %s, %s)' % (context, name, avIds, timeout)))
+
+        if avIds:
+            barrier = ToonBarrier.ToonBarrier(
+                self.uniqueName(name), avIds, timeout,
+                doneFunc = PythonUtil.Functor(self.__barrierCallback, context, callback))
+            self.__barriers[context] = barrier
+
+            # Send the context number to each involved client.
+            self.sendUpdate("setBarrierData", [self.__getBarrierData()])
+        else:
+            # No avatars; just call the callback immediately.
+            callback(avIds)
+
+        return context
+
+    def __getBarrierData(self):
+        # Returns the barrier data formatted as a blob for sending to
+        # the clients.  This lists all of the current outstanding
+        # barriers and the avIds waiting for them.
+        dg = PyDatagram()
+        for context, barrier in self.__barriers.items():
+            toons = barrier.pendingToons
+            if toons:
+                dg.addUint16(context)
+                dg.addUint16(len(toons))
+                for avId in toons:
+                    dg.addUint32(avId)
+        return dg.getMessage()
+
+    def ignoreBarrier(self, context):
+        # Aborts a previously-set barrier.  The context is the return
+        # value from the previous call to beginBarrier().
+        barrier = self.__barriers.get(context)
+        if barrier:
+            barrier.cleanup()
+            del self.__barriers[context]
+
+    def setBarrierReady(self, context):
+        # Generated by the clients to check in after a beginBarrier()
+        # call.
+        avId = self.air.msgSender
+        assert(self.notify.debug('setBarrierReady(%s, %s)' % (context, avId)))
+        barrier = self.__barriers.get(context)
+        if barrier == None:
+            # This may be None if a client was slow and missed an
+            # earlier timeout.  Too bad.
+            return
+
+        barrier.clear(avId)
+
+    def __barrierCallback(self, context, callback, avIds):
+        assert(self.notify.debug('barrierCallback(%s, %s)' % (context, avIds)))
+        # The callback that is generated when a barrier is completed.
+        barrier = self.__barriers.get(context)
+        if barrier:
+            barrier.cleanup()
+            del self.__barriers[context]
+            callback(avIds)
+        else:
+            self.notify.warning("Unexpected completion from barrier %s" % (context))
+        
+        

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

@@ -1,10 +1,10 @@
 """DistributedSmoothNode module: contains the DistributedSmoothNode class"""
 """DistributedSmoothNode module: contains the DistributedSmoothNode class"""
 
 
-from PandaModules import *
+from pandac.PandaModules import *
 from ClockDelta import *
 from ClockDelta import *
 import DistributedNode
 import DistributedNode
 import DistributedSmoothNodeBase
 import DistributedSmoothNodeBase
-import Task
+from direct.task import Task
 
 
 # This number defines our tolerance for out-of-sync telemetry packets.
 # This number defines our tolerance for out-of-sync telemetry packets.
 # If a packet appears to have originated from more than MaxFuture
 # If a packet appears to have originated from more than MaxFuture

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

@@ -1,4 +1,4 @@
-from AIBaseGlobal import *
+from otp.ai.AIBaseGlobal import *
 import DistributedNodeAI
 import DistributedNodeAI
 import DistributedSmoothNodeBase
 import DistributedSmoothNodeBase
 
 

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

@@ -1,7 +1,7 @@
 """DistributedSmoothNodeBase module: contains the DistributedSmoothNodeBase class"""
 """DistributedSmoothNodeBase module: contains the DistributedSmoothNodeBase class"""
 
 
 from ClockDelta import *
 from ClockDelta import *
-import Task
+from direct.task import Task
 
 
 class DistributedSmoothNodeBase:
 class DistributedSmoothNodeBase:
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI

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

@@ -1,6 +1,6 @@
 """ParentMgr module: contains the ParentMgr class"""
 """ParentMgr module: contains the ParentMgr class"""
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 
 
 class ParentMgr:
 class ParentMgr:
     # This is now used on the AI as well.
     # This is now used on the AI as well.

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

@@ -3,9 +3,9 @@
 # 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 PandaModules import *
+from pandac.PandaModules import *
 # Import the type numbers
 # Import the type numbers
-from DCSubatomicType import *
+from pandac.DCSubatomicType import *
 
 
 class PyDatagram(Datagram):
 class PyDatagram(Datagram):
 
 

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

@@ -3,9 +3,9 @@
 # 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 PandaModules import *
+from pandac.PandaModules import *
 # Import the type numbers
 # Import the type numbers
-from DCSubatomicType import *
+from pandac.DCSubatomicType import *
 
 
 class PyDatagramIterator(DatagramIterator):
 class PyDatagramIterator(DatagramIterator):
 
 

+ 3 - 3
direct/src/distributed/RelatedObjectMgr.py

@@ -1,8 +1,8 @@
 """RelatedObjectMgr module: contains the RelatedObjectMgr class"""
 """RelatedObjectMgr module: contains the RelatedObjectMgr class"""
 
 
-from ShowBaseGlobal import *
-import DirectObject
-import DirectNotifyGlobal
+from direct.showbase.ShowBaseGlobal import *
+from direct.showbase import DirectObject
+from direct.directnotify import DirectNotifyGlobal
 
 
 class RelatedObjectMgr(DirectObject.DirectObject):
 class RelatedObjectMgr(DirectObject.DirectObject):
     """
     """

+ 0 - 0
direct/src/distributed/__init__.py


+ 16 - 6
direct/src/distributed/cConnectionRepository.cxx

@@ -153,7 +153,9 @@ check_datagram() {
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
     case CLIENT_OBJECT_UPDATE_FIELD:
     case CLIENT_OBJECT_UPDATE_FIELD:
     case STATESERVER_OBJECT_UPDATE_FIELD:
     case STATESERVER_OBJECT_UPDATE_FIELD:
-      handle_update_field();
+      if (!handle_update_field()) {
+        return false;
+      }
       break;
       break;
 #endif  // HAVE_PYTHON
 #endif  // HAVE_PYTHON
 
 
@@ -363,16 +365,18 @@ do_check_datagram() {
 //  Description: Directly handles an update message on a field.
 //  Description: Directly handles an update message on a field.
 //               Python never touches the datagram; it just gets its
 //               Python never touches the datagram; it just gets its
 //               distributed method called with the appropriate
 //               distributed method called with the appropriate
-//               parameters.
+//               parameters.  Returns true if everything is ok, false
+//               if there was an error processing the field's update
+//               method.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-void CConnectionRepository::
+bool CConnectionRepository::
 handle_update_field() {
 handle_update_field() {
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
   int do_id = _di.get_uint32();
   int do_id = _di.get_uint32();
   if (_python_repository != (PyObject *)NULL) {
   if (_python_repository != (PyObject *)NULL) {
     PyObject *doId2do =
     PyObject *doId2do =
       PyObject_GetAttrString(_python_repository, "doId2do");
       PyObject_GetAttrString(_python_repository, "doId2do");
-    nassertv(doId2do != NULL);
+    nassertr(doId2do != NULL, false);
 
 
     PyObject *doId = PyInt_FromLong(do_id);
     PyObject *doId = PyInt_FromLong(do_id);
     PyObject *distobj = PyDict_GetItem(doId2do, doId);
     PyObject *distobj = PyDict_GetItem(doId2do, doId);
@@ -381,11 +385,11 @@ handle_update_field() {
 
 
     if (distobj != NULL) {
     if (distobj != NULL) {
       PyObject *dclass_obj = PyObject_GetAttrString(distobj, "dclass");
       PyObject *dclass_obj = PyObject_GetAttrString(distobj, "dclass");
-      nassertv(dclass_obj != NULL);
+      nassertr(dclass_obj != NULL, false);
 
 
       PyObject *dclass_this = PyObject_GetAttrString(dclass_obj, "this");
       PyObject *dclass_this = PyObject_GetAttrString(dclass_obj, "this");
       Py_DECREF(dclass_obj);
       Py_DECREF(dclass_obj);
-      nassertv(dclass_this != NULL);
+      nassertr(dclass_this != NULL, false);
 
 
       DCClass *dclass = (DCClass *)PyInt_AsLong(dclass_this);
       DCClass *dclass = (DCClass *)PyInt_AsLong(dclass_this);
       Py_DECREF(dclass_this);
       Py_DECREF(dclass_this);
@@ -397,7 +401,13 @@ handle_update_field() {
       Py_INCREF(distobj);
       Py_INCREF(distobj);
       dclass->receive_update(distobj, _di); 
       dclass->receive_update(distobj, _di); 
       Py_DECREF(distobj);
       Py_DECREF(distobj);
+      
+      if (PyErr_Occurred()) {
+        return false;
+      }
     }
     }
   }
   }
 #endif  // HAVE_PYTHON  
 #endif  // HAVE_PYTHON  
+
+  return true;
 }
 }

+ 1 - 1
direct/src/distributed/cConnectionRepository.h

@@ -97,7 +97,7 @@ PUBLISHED:
 
 
 private:
 private:
   bool do_check_datagram();
   bool do_check_datagram();
-  void handle_update_field();
+  bool handle_update_field();
 
 
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
   PyObject *_python_repository;
   PyObject *_python_repository;

+ 3 - 3
direct/src/extensions/CInterval-extensions.py

@@ -4,7 +4,7 @@
     of the CInterval class
     of the CInterval class
     """
     """
 
 
-    from DirectNotifyGlobal import directNotify
+    from direct.directnotify.DirectNotifyGlobal import directNotify
     notify = directNotify.newCategory("Interval")
     notify = directNotify.newCategory("Interval")
 
 
     def setT(self, t):
     def setT(self, t):
@@ -41,9 +41,9 @@
         """
         """
         Popup control panel for interval.
         Popup control panel for interval.
         """
         """
-        from TkGlobal import Toplevel, Frame, Button, LEFT, X, Pmw
+        from direct.showbase.TkGlobal import Toplevel, Frame, Button, LEFT, X, Pmw
         import math
         import math
-        import EntryScale
+        from direct.tkwidgets import EntryScale
         if tl == None:
         if tl == None:
             tl = Toplevel()
             tl = Toplevel()
             tl.title('Interval Controls')
             tl.title('Interval Controls')

+ 2 - 2
direct/src/extensions/HTTPChannel-extensions.py

@@ -15,14 +15,14 @@
         """
         """
         if not name:
         if not name:
             name = self.getUrl().cStr()
             name = self.getUrl().cStr()
-        import Task
+        from direct.task import Task
         task = Task.Task(self.doTask)
         task = Task.Task(self.doTask)
         task.callback = callback
         task.callback = callback
         task.callbackArgs = extraArgs
         task.callbackArgs = extraArgs
         return taskMgr.add(task, name)    
         return taskMgr.add(task, name)    
         
         
     def doTask(self, task):
     def doTask(self, task):
-        import Task
+        from direct.task import Task
         if self.run():
         if self.run():
             return Task.cont
             return Task.cont
         if task.callback:
         if task.callback:

+ 1 - 1
direct/src/extensions/MouseWatcherRegion-extensions.py

@@ -13,7 +13,7 @@
         node parented within the render2d hierarchy.
         node parented within the render2d hierarchy.
 
 
         """
         """
-        import Point3
+        from pandac import Point3
         
         
         # Get the relative transform to the node.
         # Get the relative transform to the node.
         mat = np.getMat(render2d)
         mat = np.getMat(render2d)

+ 45 - 45
direct/src/extensions/NodePath-extensions.py

@@ -105,7 +105,7 @@
             return [self]
             return [self]
 
 
     def getTightBounds(self):
     def getTightBounds(self):
-        import Point3
+        from pandac import Point3
         v1 = Point3.Point3(0)
         v1 = Point3.Point3(0)
         v2 = Point3.Point3(0)
         v2 = Point3.Point3(0)
         self.calcTightBounds(v1,v2)
         self.calcTightBounds(v1,v2)
@@ -277,9 +277,9 @@
         # functorFunc is a function which can be called to create a functor.
         # functorFunc is a function which can be called to create a functor.
         # functor creation is defered so initial state (sampled in functorFunc)
         # functor creation is defered so initial state (sampled in functorFunc)
         # will be appropriate for the time the lerp is spawned
         # will be appropriate for the time the lerp is spawned
-        import Task
-        import LerpBlendHelpers
-        from TaskManagerGlobal import taskMgr
+        from direct.task import Task
+        from direct.showbase import LerpBlendHelpers
+        from direct.task.TaskManagerGlobal import taskMgr
         
         
         # upon death remove the functorFunc
         # upon death remove the functorFunc
         def lerpUponDeath(task):
         def lerpUponDeath(task):
@@ -295,9 +295,9 @@
         
         
         # make the task function
         # make the task function
         def lerpTaskFunc(task):
         def lerpTaskFunc(task):
-            from Lerp import Lerp
-            from ClockObject import ClockObject
-            from Task import Task, cont, done
+            from pandac.Lerp import Lerp
+            from pandac.ClockObject import ClockObject
+            from direct.task.Task import Task, cont, done
             if task.init == 1:
             if task.init == 1:
                 # make the lerp
                 # make the lerp
                 functor = task.functorFunc()
                 functor = task.functorFunc()
@@ -333,8 +333,8 @@
         """_autoLerp(self, functor, float, string, string)
         """_autoLerp(self, functor, float, string, string)
         This lerp uses C++ to handle the stepping. Bonus is
         This lerp uses C++ to handle the stepping. Bonus is
         its more efficient, trade-off is there is less control"""
         its more efficient, trade-off is there is less control"""
-        import AutonomousLerp
-        import LerpBlendHelpers
+        from pandac import AutonomousLerp
+        from direct.showbase import LerpBlendHelpers
         # make a lerp that lives in C++ land
         # make a lerp that lives in C++ land
         functor = functorFunc()
         functor = functorFunc()
         lerp = AutonomousLerp.AutonomousLerp(functor, time,
         lerp = AutonomousLerp.AutonomousLerp(functor, time,
@@ -368,7 +368,7 @@
         string="noBlend", string=none, string=none)
         string="noBlend", string=none, string=none)
         """
         """
         def functorFunc(self = self, r = r, g = g, b = b, a = a):
         def functorFunc(self = self, r = r, g = g, b = b, a = a):
-            import ColorLerpFunctor
+            from pandac import ColorLerpFunctor
             # just end rgba values, use current color rgba values for start
             # just end rgba values, use current color rgba values for start
             startColor = self.getColor()
             startColor = self.getColor()
             functor = ColorLerpFunctor.ColorLerpFunctor(
             functor = ColorLerpFunctor.ColorLerpFunctor(
@@ -392,7 +392,7 @@
         """
         """
         def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
         def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
                         er = er, eg = eg, eb = eb, ea = ea):
                         er = er, eg = eg, eb = eb, ea = ea):
-            import ColorLerpFunctor
+            from pandac import ColorLerpFunctor
             # start and end rgba values
             # start and end rgba values
             functor = ColorLerpFunctor.ColorLerpFunctor(self, sr, sg, sb, sa,
             functor = ColorLerpFunctor.ColorLerpFunctor(self, sr, sg, sb, sa,
                                                         er, eg, eb, ea)
                                                         er, eg, eb, ea)
@@ -411,7 +411,7 @@
         string=none)
         string=none)
         """
         """
         def functorFunc(self = self, endColor = endColor):
         def functorFunc(self = self, endColor = endColor):
-            import ColorLerpFunctor
+            from pandac import ColorLerpFunctor
             # just end vec4, use current color for start
             # just end vec4, use current color for start
             startColor = self.getColor()
             startColor = self.getColor()
             functor = ColorLerpFunctor.ColorLerpFunctor(
             functor = ColorLerpFunctor.ColorLerpFunctor(
@@ -432,7 +432,7 @@
         """
         """
         def functorFunc(self = self, startColor = startColor,
         def functorFunc(self = self, startColor = startColor,
                         endColor = endColor):
                         endColor = endColor):
-            import ColorLerpFunctor
+            from pandac import ColorLerpFunctor
             # start color and end vec
             # start color and end vec
             functor = ColorLerpFunctor.ColorLerpFunctor(
             functor = ColorLerpFunctor.ColorLerpFunctor(
                 self, startColor, endColor)
                 self, startColor, endColor)
@@ -471,7 +471,7 @@
         string="noBlend", string=none, string=none)
         string="noBlend", string=none, string=none)
         """
         """
         def functorFunc(self = self, r = r, g = g, b = b, a = a):
         def functorFunc(self = self, r = r, g = g, b = b, a = a):
-            import ColorScaleLerpFunctor
+            from pandac import ColorScaleLerpFunctor
             # just end rgba values, use current color rgba values for start
             # just end rgba values, use current color rgba values for start
             startColor = self.getColor()
             startColor = self.getColor()
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
@@ -495,7 +495,7 @@
         """
         """
         def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
         def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa,
                         er = er, eg = eg, eb = eb, ea = ea):
                         er = er, eg = eg, eb = eb, ea = ea):
-            import ColorScaleLerpFunctor
+            from pandac import ColorScaleLerpFunctor
             # start and end rgba values
             # start and end rgba values
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(self, sr, sg, sb, sa,
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(self, sr, sg, sb, sa,
                                                         er, eg, eb, ea)
                                                         er, eg, eb, ea)
@@ -514,7 +514,7 @@
         string=none)
         string=none)
         """
         """
         def functorFunc(self = self, endColor = endColor):
         def functorFunc(self = self, endColor = endColor):
-            import ColorScaleLerpFunctor
+            from pandac import ColorScaleLerpFunctor
             # just end vec4, use current color for start
             # just end vec4, use current color for start
             startColor = self.getColor()
             startColor = self.getColor()
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
@@ -535,7 +535,7 @@
         """
         """
         def functorFunc(self = self, startColor = startColor,
         def functorFunc(self = self, startColor = startColor,
                         endColor = endColor):
                         endColor = endColor):
-            import ColorScaleLerpFunctor
+            from pandac import ColorScaleLerpFunctor
             # start color and end vec
             # start color and end vec
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
             functor = ColorScaleLerpFunctor.ColorScaleLerpFunctor(
                 self, startColor, endColor)
                 self, startColor, endColor)
@@ -573,7 +573,7 @@
         """
         """
         def functorFunc(self = self, h = h, p = p, r = r,
         def functorFunc(self = self, h = h, p = p, r = r,
                         other = other, shortest=shortest):
                         other = other, shortest=shortest):
-            import HprLerpFunctor
+            from pandac import HprLerpFunctor
             # it's individual hpr components
             # it's individual hpr components
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
@@ -609,7 +609,7 @@
         """
         """
         def functorFunc(self = self, hpr = hpr,
         def functorFunc(self = self, hpr = hpr,
                         other = other, shortest=shortest):
                         other = other, shortest=shortest):
-            import HprLerpFunctor
+            from pandac import HprLerpFunctor
             # it's a vbase3 hpr
             # it's a vbase3 hpr
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
@@ -654,7 +654,7 @@
         Perform a pos lerp with three floats as the end point
         Perform a pos lerp with three floats as the end point
         """
         """
         def functorFunc(self = self, x = x, y = y, z = z, other = other):
         def functorFunc(self = self, x = x, y = y, z = z, other = other):
-            import PosLerpFunctor
+            from pandac import PosLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 startPos = self.getPos(other)
                 startPos = self.getPos(other)
@@ -681,7 +681,7 @@
         Perform a pos lerp with a Point3 as the end point
         Perform a pos lerp with a Point3 as the end point
         """
         """
         def functorFunc(self = self, pos = pos, other = other):
         def functorFunc(self = self, pos = pos, other = other):
-            import PosLerpFunctor
+            from pandac import PosLerpFunctor
             if (other != None):
             if (other != None):
                 #lerp wrt other
                 #lerp wrt other
                 functor = PosLerpFunctor.PosLerpFunctor(
                 functor = PosLerpFunctor.PosLerpFunctor(
@@ -721,7 +721,7 @@
         """
         """
         def functorFunc(self = self, pos = pos, hpr = hpr,
         def functorFunc(self = self, pos = pos, hpr = hpr,
                         other = other, shortest=shortest):
                         other = other, shortest=shortest):
-            import PosHprLerpFunctor
+            from pandac import PosHprLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 startPos = self.getPos(other)
                 startPos = self.getPos(other)
@@ -755,7 +755,7 @@
         """
         """
         def functorFunc(self = self, x = x, y = y, z = z,
         def functorFunc(self = self, x = x, y = y, z = z,
                         h = h, p = p, r = r, other = other, shortest=shortest):
                         h = h, p = p, r = r, other = other, shortest=shortest):
-            import PosHprLerpFunctor
+            from pandac import PosHprLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 startPos = self.getPos(other)
                 startPos = self.getPos(other)
@@ -797,7 +797,7 @@
         """
         """
         def functorFunc(self = self, pos = pos, hpr = hpr,
         def functorFunc(self = self, pos = pos, hpr = hpr,
                         scale = scale, other = other, shortest=shortest):
                         scale = scale, other = other, shortest=shortest):
-            import PosHprScaleLerpFunctor
+            from pandac import PosHprScaleLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 startPos = self.getPos(other)
                 startPos = self.getPos(other)
@@ -850,7 +850,7 @@
         string=none, NodePath=None)
         string=none, NodePath=None)
         """
         """
         def functorFunc(self = self, scale = scale, other = other):
         def functorFunc(self = self, scale = scale, other = other):
-            import ScaleLerpFunctor
+            from pandac import ScaleLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 functor = ScaleLerpFunctor.ScaleLerpFunctor(self,
                 functor = ScaleLerpFunctor.ScaleLerpFunctor(self,
@@ -875,7 +875,7 @@
         string=none, string=none, NodePath=None)
         string=none, string=none, NodePath=None)
         """
         """
         def functorFunc(self = self, sx = sx, sy = sy, sz = sz, other = other):
         def functorFunc(self = self, sx = sx, sy = sy, sz = sz, other = other):
-            import ScaleLerpFunctor
+            from pandac import ScaleLerpFunctor
             if (other != None):
             if (other != None):
                 # lerp wrt other
                 # lerp wrt other
                 startScale = self.getScale(other)
                 startScale = self.getScale(other)
@@ -901,17 +901,17 @@
             
             
     def place(self):
     def place(self):
         base.startDirect(fWantTk = 1)
         base.startDirect(fWantTk = 1)
-        import Placer
+        from direct.tkpanels import Placer
         return Placer.place(self)
         return Placer.place(self)
 
 
     def explore(self):
     def explore(self):
         base.startDirect(fWantTk = 1)
         base.startDirect(fWantTk = 1)
-        import SceneGraphExplorer
+        from direct.tkwidgets import SceneGraphExplorer
         return SceneGraphExplorer.explore(self)
         return SceneGraphExplorer.explore(self)
 
 
     def rgbPanel(self, cb = None):
     def rgbPanel(self, cb = None):
         base.startTk()
         base.startTk()
-        import Slider
+        from direct.tkwidgets import Slider
         return Slider.rgbPanel(self, cb)
         return Slider.rgbPanel(self, cb)
 
 
     def select(self):
     def select(self):
@@ -949,48 +949,48 @@
                 np.hide()
                 np.hide()
 
 
     def posInterval(self, *args, **kw):
     def posInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpPosInterval(self, *args, **kw)
         return LerpInterval.LerpPosInterval(self, *args, **kw)
     
     
     def hprInterval(self, *args, **kw):
     def hprInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpHprInterval(self, *args, **kw)
         return LerpInterval.LerpHprInterval(self, *args, **kw)
 
 
     def scaleInterval(self, *args, **kw):
     def scaleInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpScaleInterval(self, *args, **kw)
         return LerpInterval.LerpScaleInterval(self, *args, **kw)
 
 
     def shearInterval(self, *args, **kw):
     def shearInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpShearInterval(self, *args, **kw)
         return LerpInterval.LerpShearInterval(self, *args, **kw)
 
 
     def posHprInterval(self, *args, **kw):
     def posHprInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprInterval(self, *args, **kw)
 
 
     def hprScaleInterval(self, *args, **kw):
     def hprScaleInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpHprScaleInterval(self, *args, **kw)
         return LerpInterval.LerpHprScaleInterval(self, *args, **kw)
 
 
     def posHprScaleInterval(self, *args, **kw):
     def posHprScaleInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprScaleInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprScaleInterval(self, *args, **kw)
 
 
     def posHprScaleShearInterval(self, *args, **kw):
     def posHprScaleShearInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpPosHprScaleShearInterval(self, *args, **kw)
         return LerpInterval.LerpPosHprScaleShearInterval(self, *args, **kw)
 
 
     def colorInterval(self, *args, **kw):
     def colorInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpColorInterval(self, *args, **kw)
         return LerpInterval.LerpColorInterval(self, *args, **kw)
 
 
     def colorScaleInterval(self, *args, **kw):
     def colorScaleInterval(self, *args, **kw):
-        import LerpInterval
+        from direct.interval import LerpInterval
         return LerpInterval.LerpColorScaleInterval(self, *args, **kw)
         return LerpInterval.LerpColorScaleInterval(self, *args, **kw)
 
 
     def attachCollisionSphere(self, name, cx,cy,cz,r, fromCollide, intoCollide):
     def attachCollisionSphere(self, name, cx,cy,cz,r, fromCollide, intoCollide):
-        import CollisionSphere
-        import CollisionNode
+        from pandac import CollisionSphere
+        from pandac import CollisionNode
         coll = CollisionSphere.CollisionSphere(cx,cy,cz,r)
         coll = CollisionSphere.CollisionSphere(cx,cy,cz,r)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
@@ -1000,8 +1000,8 @@
         return collNodePath
         return collNodePath
 
 
     def attachCollisionSegment(self, name, ax,ay,az, bx,by,bz, fromCollide, intoCollide):
     def attachCollisionSegment(self, name, ax,ay,az, bx,by,bz, fromCollide, intoCollide):
-        import CollisionSegment
-        import CollisionNode
+        from pandac import CollisionSegment
+        from pandac import CollisionNode
         coll = CollisionSegment.CollisionSegment(ax,ay,az, bx,by,bz)
         coll = CollisionSegment.CollisionSegment(ax,ay,az, bx,by,bz)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)
@@ -1011,8 +1011,8 @@
         return collNodePath
         return collNodePath
 
 
     def attachCollisionRay(self, name, ox,oy,oz, dx,dy,dz, fromCollide, intoCollide):
     def attachCollisionRay(self, name, ox,oy,oz, dx,dy,dz, fromCollide, intoCollide):
-        import CollisionRay
-        import CollisionNode
+        from pandac import CollisionRay
+        from pandac import CollisionNode
         coll = CollisionRay.CollisionRay(ox,oy,oz, dx,dy,dz)
         coll = CollisionRay.CollisionRay(ox,oy,oz, dx,dy,dz)
         collNode = CollisionNode.CollisionNode(name)
         collNode = CollisionNode.CollisionNode(name)
         collNode.addSolid(coll)
         collNode.addSolid(coll)

+ 1 - 1
direct/src/extensions/NodePathCollection-extensions.py

@@ -16,7 +16,7 @@
             return npList
             return npList
 
 
     def getTightBounds(self):
     def getTightBounds(self):
-        import Point3
+        from pandac import Point3
         
         
         if self.getNumPaths() == 0:
         if self.getNumPaths() == 0:
             return (Point3.Point3(0), Point3.Point3(0))
             return (Point3.Point3(0), Point3.Point3(0))

+ 0 - 0
direct/src/extensions/__init__.py


+ 1 - 1
direct/src/ffi/FFIConstants.py

@@ -1,6 +1,6 @@
 
 
 # create a DirectNotify category for FFI modules
 # create a DirectNotify category for FFI modules
-from  DirectNotifyGlobal import *
+from direct.directnotify.DirectNotifyGlobal import *
 notify = directNotify.newCategory("FFI")
 notify = directNotify.newCategory("FFI")
 
 
 # This is the name of the file that the importing code will be stored
 # This is the name of the file that the importing code will be stored

+ 3 - 3
direct/src/ffi/FFIExternalObject.py

@@ -19,7 +19,7 @@ DowncastMap = {}
 # The type map is used for upcasting and downcasting through
 # The type map is used for upcasting and downcasting through
 # the panda inheritance chain
 # the panda inheritance chain
 def registerInTypeMap(pythonClass):
 def registerInTypeMap(pythonClass):
-    import TypedObject
+    from pandac import TypedObject
     if issubclass(pythonClass, TypedObject.TypedObject):
     if issubclass(pythonClass, TypedObject.TypedObject):
         typeIndex = pythonClass.getClassType().getIndex()
         typeIndex = pythonClass.getClassType().getIndex()
         WrapperClassMap[typeIndex] = pythonClass
         WrapperClassMap[typeIndex] = pythonClass
@@ -191,7 +191,7 @@ class FFIExternalObject:
         # We create a LineStream for the output function to write to, then we extract
         # We create a LineStream for the output function to write to, then we extract
         # the string out of it and return it as our str
         # the string out of it and return it as our str
         try:
         try:
-            import LineStream
+            from pandac import LineStream
             lineStream = LineStream.LineStream()
             lineStream = LineStream.LineStream()
             self.output(lineStream)
             self.output(lineStream)
             baseRepr = lineStream.getLine()
             baseRepr = lineStream.getLine()
@@ -210,7 +210,7 @@ class FFIExternalObject:
         # Lots of Panda classes have an write or output function defined that takes an Ostream
         # Lots of Panda classes have an write or output function defined that takes an Ostream
         # We create a LineStream for the write or output function to write to, then we extract
         # We create a LineStream for the write or output function to write to, then we extract
         # the string out of it and return it as our repr
         # the string out of it and return it as our repr
-        import LineStream
+        from pandac import LineStream
         lineStream = LineStream.LineStream()
         lineStream = LineStream.LineStream()
         try:
         try:
             # First try the write function, that is the better one
             # First try the write function, that is the better one

+ 8 - 2
direct/src/ffi/FFIInterrogateDatabase.py

@@ -13,7 +13,7 @@ import FFISpecs
 import FFIRename
 import FFIRename
 import FFIConstants
 import FFIConstants
 import FFIOverload
 import FFIOverload
-from PythonUtil import *
+from direct.showbase.PythonUtil import *
 
 
 # FFIConstants.notify.setDebug(1)
 # FFIConstants.notify.setDebug(1)
 FFIConstants.notify.info('Importing interrogate library: ' + FFIConstants.InterrogateModuleName)
 FFIConstants.notify.info('Importing interrogate library: ' + FFIConstants.InterrogateModuleName)
@@ -155,7 +155,7 @@ def outputImportFileImports(file, typeList, CModuleName):
     file.write('\n')
     file.write('\n')
 
 
     file.write('# Put the classes in the wrapper class map\n')
     file.write('# Put the classes in the wrapper class map\n')
-    file.write('from FFIExternalObject import registerInTypeMap\n')
+    file.write('from direct.ffi.FFIExternalObject import registerInTypeMap\n')
     file.write('\n')
     file.write('\n')
     for moduleName in moduleList:
     for moduleName in moduleList:
         file.write('registerInTypeMap(' + moduleName + ')\n')
         file.write('registerInTypeMap(' + moduleName + ')\n')
@@ -718,6 +718,12 @@ class FFIInterrogateDatabase:
             file.write('from ' + CModuleName + 'Modules import *\n')
             file.write('from ' + CModuleName + 'Modules import *\n')
         file.close()
         file.close()
 
 
+        # Generate an empty __init__.py to make the directory a Python
+        # package.
+        init = os.path.join(codeDir, '__init__.py')
+        file = open(init, 'w')
+        file.close()
+
         # Commented out based upon assumption that squeeze will do the compile
         # Commented out based upon assumption that squeeze will do the compile
         #FFIConstants.notify.info( 'Compiling code...')
         #FFIConstants.notify.info( 'Compiling code...')
         #compileall.compile_dir(codeDir)
         #compileall.compile_dir(codeDir)

+ 1 - 1
direct/src/ffi/FFIOverload.py

@@ -1,4 +1,4 @@
-from PythonUtil import *    
+from direct.showbase.PythonUtil import *    
 from types import *
 from types import *
 import string
 import string
 import FFIConstants
 import FFIConstants

+ 1 - 1
direct/src/ffi/FFISpecs.py

@@ -4,7 +4,7 @@ import FFITypes
 import FFIOverload
 import FFIOverload
 import string
 import string
 
 
-from PythonUtil import *
+from direct.showbase.PythonUtil import *
 
 
 augmentedAssignments = ['__iadd__', '__isub__', '__imul__', '__idiv__',
 augmentedAssignments = ['__iadd__', '__isub__', '__imul__', '__idiv__',
                         '__ior__', '__iand__', '__ixor__',
                         '__ior__', '__iand__', '__ixor__',

+ 2 - 2
direct/src/ffi/FFITypes.py

@@ -15,7 +15,7 @@ import FFIConstants
 import FFIOverload
 import FFIOverload
 
 
 
 
-from PythonUtil import *
+from direct.showbase.PythonUtil import *
 
 
 TypedObjectDescriptor = None
 TypedObjectDescriptor = None
 
 
@@ -639,7 +639,7 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
                 indent(file, 0, 'import ' + moduleName + '\n')            
                 indent(file, 0, 'import ' + moduleName + '\n')            
                 indent(file, 0, 'import ' + moduleName + 'Downcasts\n')
                 indent(file, 0, 'import ' + moduleName + 'Downcasts\n')
         indent(file, 0, '\n')
         indent(file, 0, '\n')
-        indent(file, 0, 'import FFIExternalObject\n')
+        indent(file, 0, 'from direct.ffi import FFIExternalObject\n')
 
 
 
 
     def outputImportsRecursively(self, parent, file, nesting):
     def outputImportsRecursively(self, parent, file, nesting):

+ 0 - 0
direct/src/ffi/__init__.py


+ 5 - 4
direct/src/ffi/genPyCode

@@ -57,7 +57,7 @@ if [ "$DIRECT" == "" ]; then
   fi
   fi
 fi
 fi
 
 
-pyDir=$DIRECT/lib/py
+pyDir=$DIRECT/lib/pandac
 extDir=$DIRECT/src/extensions
 extDir=$DIRECT/src/extensions
 pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
 pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
 
 
@@ -90,13 +90,13 @@ elif [ "$buildType" = "win-publish" ]; then
 
 
 elif [ "$buildType" = "install" ]; then
 elif [ "$buildType" = "install" ]; then
     # Use relative paths; as installed on a machine without ctattach etc.
     # Use relative paths; as installed on a machine without ctattach etc.
-    pyDir=$install_dir/lib/py
+    pyDir=$install_dir/pandac
     ppython=$install_dir/bin/ppython
     ppython=$install_dir/bin/ppython
     pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
     pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
     $ppython -d $install_dir/bin/generatePythonCode -O -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
     $ppython -d $install_dir/bin/generatePythonCode -O -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
 elif [ "$buildType" = "release" ]; then
 elif [ "$buildType" = "release" ]; then
     # Use relative paths; as installed on a machine without ctattach etc.
     # Use relative paths; as installed on a machine without ctattach etc.
-    pyDir=$install_dir/lib/py
+    pyDir=$install_dir/pandac
     ppython=$install_dir/bin/ppython
     ppython=$install_dir/bin/ppython
     pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
     pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
     $ppython $install_dir/bin/generatePythonCode -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
     $ppython $install_dir/bin/generatePythonCode -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
@@ -107,8 +107,9 @@ fi
 
 
 if [ "$fSqueeze" = "squeezeMe" ]; then
 if [ "$fSqueeze" = "squeezeMe" ]; then
     echo SQUEEZING PandaModules
     echo SQUEEZING PandaModules
-    rm -f $pyDir/PandaModules.py* || exit
+    rm -f $pyDir/PandaModules.py* $pyDir/__init__.py || exit
     $ppython $ppythonOptimizeFlag $pSqueezer $optimizeFlag -d $pyDir || exit
     $ppython $ppythonOptimizeFlag $pSqueezer $optimizeFlag -d $pyDir || exit
+    touch $pyDir/__init__.py || exit
 else
 else
     # renaming PandaModulesUnsqueezed.py to PandaModules.py
     # renaming PandaModulesUnsqueezed.py to PandaModules.py
     cd $pyDir              || exit
     cd $pyDir              || exit

+ 2 - 2
direct/src/ffi/generatePythonCode

@@ -4,7 +4,7 @@
 import getopt
 import getopt
 import sys
 import sys
 import os
 import os
-import FFIConstants
+from direct.ffi import FFIConstants
 
 
 # Define a help string for the user
 # Define a help string for the user
 helpString ="""
 helpString ="""
@@ -117,7 +117,7 @@ else:
     FFIConstants.CodeModuleNameList = codeLibs
     FFIConstants.CodeModuleNameList = codeLibs
 
 
 # Ok, now we can start generating code
 # Ok, now we can start generating code
-import FFIInterrogateDatabase
+from direct.ffi import FFIInterrogateDatabase
 db = FFIInterrogateDatabase.FFIInterrogateDatabase()
 db = FFIInterrogateDatabase.FFIInterrogateDatabase()
 db.generateCode(outputDir, extensionsDir)
 db.generateCode(outputDir, extensionsDir)
 
 

+ 2 - 2
direct/src/fsm/ClassicFSM.py

@@ -5,7 +5,7 @@ existing code.  New code should use the FSM module instead.
 
 
 """
 """
 
 
-from DirectObject import *
+from direct.showbase.DirectObject import *
 import types
 import types
 
 
 class ClassicFSM(DirectObject):
 class ClassicFSM(DirectObject):
@@ -348,7 +348,7 @@ class ClassicFSM(DirectObject):
             return 0
             return 0
 
 
     def view(self):
     def view(self):
-        import FSMInspector
+        from direct.tkpanels import FSMInspector
         FSMInspector.FSMInspector(self)
         FSMInspector.FSMInspector(self)
 
 
 
 

+ 2 - 2
direct/src/fsm/FSM.py

@@ -2,8 +2,8 @@
 previously called FSM.py (now called ClassicFSM.py).
 previously called FSM.py (now called ClassicFSM.py).
 """
 """
 
 
-import DirectObject
-import DirectNotifyGlobal
+from direct.showbase import DirectObject
+from direct.directnotify import DirectNotifyGlobal
 import types
 import types
 import string
 import string
 
 

+ 2 - 2
direct/src/fsm/FourState.py

@@ -1,10 +1,10 @@
 
 
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 #import DistributedObject
 #import DistributedObject
 import ClassicFSM
 import ClassicFSM
 import State
 import State
-import Task
+from direct.task import Task
 
 
 
 
 class FourState:
 class FourState:

+ 2 - 2
direct/src/fsm/FourStateAI.py

@@ -1,10 +1,10 @@
 
 
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 #import DistributedObjectAI
 #import DistributedObjectAI
 import ClassicFSM
 import ClassicFSM
 import State
 import State
-import Task
+from direct.task import Task
 
 
 
 
 class FourStateAI:
 class FourStateAI:

+ 2 - 2
direct/src/fsm/SampleFSM.py

@@ -1,6 +1,6 @@
 import FSM
 import FSM
-from PandaModules import *
-import Task
+from pandac.PandaModules import *
+from direct.task import Task
 import string
 import string
 
 
 
 

+ 1 - 1
direct/src/fsm/State.py

@@ -1,7 +1,7 @@
 
 
 """State module: contains State class"""
 """State module: contains State class"""
 
 
-from DirectObject import *
+from direct.showbase.DirectObject import *
 import types
 import types
 
 
 # This gets set by a dconfig variable in ShowBase.py
 # This gets set by a dconfig variable in ShowBase.py

+ 2 - 2
direct/src/fsm/StateData.py

@@ -1,9 +1,9 @@
 
 
 """StateData module: contains StateData class"""
 """StateData module: contains StateData class"""
 
 
-from DirectObject import *
+from direct.showbase.DirectObject import *
 
 
-import DirectNotifyGlobal
+from direct.directnotify import DirectNotifyGlobal
 
 
 class StateData(DirectObject):
 class StateData(DirectObject):
     """
     """

+ 0 - 0
direct/src/fsm/__init__.py


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

@@ -2,11 +2,11 @@ from DirectGuiGlobals import *
 from OnscreenText import *
 from OnscreenText import *
 from OnscreenGeom import *
 from OnscreenGeom import *
 from OnscreenImage import *
 from OnscreenImage import *
-from DirectUtil import ROUND_TO
-import PandaObject
-import Task
+from direct.directtools.DirectUtil import ROUND_TO
+from direct.showbase import PandaObject
+from direct.task import Task
 import string
 import string
-import ShowBase
+from direct.showbase import ShowBase
 
 
 """
 """
 Base class for all Direct Gui items.  Handles composite widgets and
 Base class for all Direct Gui items.  Handles composite widgets and

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

@@ -2,7 +2,7 @@
 Global definitions used by Direct Gui Classes and handy constants
 Global definitions used by Direct Gui Classes and handy constants
 that can be used during widget construction
 that can be used during widget construction
 """
 """
-from PandaModules import *
+from pandac.PandaModules import *
 
 
 # USEFUL GUI CONSTANTS
 # USEFUL GUI CONSTANTS
 # Constant used to indicate that an option can only be set by a call
 # Constant used to indicate that an option can only be set by a call

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

@@ -1,4 +1,4 @@
-from ShowBaseGlobal import *
+from direct.showbase.ShowBaseGlobal import *
 from DirectGui import *
 from DirectGui import *
 from whrandom import *
 from whrandom import *
 
 

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

@@ -1,6 +1,6 @@
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
-import Task
+from direct.task import Task
 import types
 import types
 
 
 class DirectScrolledList(DirectFrame):
 class DirectScrolledList(DirectFrame):

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

@@ -1,6 +1,6 @@
 """OnscreenGeom module: contains the OnscreenGeom class"""
 """OnscreenGeom module: contains the OnscreenGeom class"""
 
 
-from PandaObject import *
+from direct.showbase.PandaObject import *
 import types
 import types
 
 
 class OnscreenGeom(PandaObject, NodePath):
 class OnscreenGeom(PandaObject, NodePath):

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

@@ -1,6 +1,6 @@
 """OnscreenImage module: contains the OnscreenImage class"""
 """OnscreenImage module: contains the OnscreenImage class"""
 
 
-from PandaObject import *
+from direct.showbase.PandaObject import *
 import types
 import types
 
 
 class OnscreenImage(PandaObject, NodePath):
 class OnscreenImage(PandaObject, NodePath):

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

@@ -1,6 +1,6 @@
 """OnscreenText module: contains the OnscreenText class"""
 """OnscreenText module: contains the OnscreenText class"""
 
 
-from PandaObject import *
+from direct.showbase.PandaObject import *
 import DirectGuiGlobals
 import DirectGuiGlobals
 import types
 import types
 
 

+ 0 - 0
direct/src/gui/__init__.py


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

@@ -1,10 +1,10 @@
 """ActorInterval module: contains the ActorInterval class"""
 """ActorInterval module: contains the ActorInterval class"""
 
 
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
 import math
 import math
-import LerpBlendHelpers
+from direct.showbase import LerpBlendHelpers
 
 
 class ActorInterval(Interval.Interval):
 class ActorInterval(Interval.Interval):
 
 

+ 4 - 4
direct/src/interval/FunctionInterval.py

@@ -1,8 +1,8 @@
 """FunctionInterval module: contains the FunctionInterval class"""
 """FunctionInterval module: contains the FunctionInterval class"""
 
 
-from PandaModules import *
-from MessengerGlobal import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.showbase.MessengerGlobal import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
 import types
 import types
 
 
@@ -381,7 +381,7 @@ t2.play()
 
 
 smiley = loader.loadModel('models/misc/smiley')
 smiley = loader.loadModel('models/misc/smiley')
 
 
-import Actor
+from direct.actor import Actor
 donald = Actor.Actor()
 donald = Actor.Actor()
 donald.loadModel("phase_6/models/char/donald-wheel-1000")
 donald.loadModel("phase_6/models/char/donald-wheel-1000")
 donald.loadAnims({"steer":"phase_6/models/char/donald-wheel-wheel"})
 donald.loadAnims({"steer":"phase_6/models/char/donald-wheel-wheel"})

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

@@ -1,9 +1,9 @@
 """IndirectInterval module: contains the IndirectInterval class"""
 """IndirectInterval module: contains the IndirectInterval class"""
 
 
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
-import LerpBlendHelpers
+from direct.showbase import LerpBlendHelpers
 
 
 class IndirectInterval(Interval.Interval):
 class IndirectInterval(Interval.Interval):
     """
     """

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

@@ -1,9 +1,9 @@
 """Interval module: contains the Interval class"""
 """Interval module: contains the Interval class"""
 
 
-from DirectObject import *
-from PandaModules import *
-import Task
-import PythonUtil
+from direct.showbase.DirectObject import *
+from pandac.PandaModules import *
+from direct.task import Task
+from direct.showbase import PythonUtil
 import math
 import math
 
 
 class Interval(DirectObject):
 class Interval(DirectObject):
@@ -342,7 +342,7 @@ class Interval(DirectObject):
 
 
     def __spawnTask(self):
     def __spawnTask(self):
         # Spawn task
         # Spawn task
-        import Task
+        from direct.task import Task
         self.__removeTask()
         self.__removeTask()
         taskName = self.getName() + '-play'
         taskName = self.getName() + '-play'
         task = Task.Task(self.__playTask)
         task = Task.Task(self.__playTask)
@@ -360,7 +360,7 @@ class Interval(DirectObject):
                 taskMgr.remove(task)
                 taskMgr.remove(task)
 
 
     def __playTask(self, task):
     def __playTask(self, task):
-        import Task
+        from direct.task import Task
         again = self.stepPlay()
         again = self.stepPlay()
         self.privPostEvent()
         self.privPostEvent()
         if again:
         if again:
@@ -372,12 +372,12 @@ class Interval(DirectObject):
         """
         """
         Popup control panel for interval.
         Popup control panel for interval.
         """
         """
-        import TkGlobal
+        from direct.showbase import TkGlobal
         import math
         import math
         # I moved this here because Toontown does not ship Tk
         # I moved this here because Toontown does not ship Tk
         from Tkinter import Toplevel, Frame, Button, LEFT, X
         from Tkinter import Toplevel, Frame, Button, LEFT, X
         import Pmw
         import Pmw
-        import EntryScale
+        from direct.tkwidgets import EntryScale
         if tl == None:
         if tl == None:
             tl = Toplevel()
             tl = Toplevel()
             tl.title('Interval Controls')
             tl.title('Interval Controls')

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

@@ -9,7 +9,7 @@ from IndirectInterval import *
 from MopathInterval import *
 from MopathInterval import *
 from ParticleInterval import *
 from ParticleInterval import *
 from SoundInterval import *
 from SoundInterval import *
-from WaitInterval import *
+from pandac.WaitInterval import *
 from ProjectileInterval import *
 from ProjectileInterval import *
 from MetaInterval import *
 from MetaInterval import *
 from IntervalManager import *
 from IntervalManager import *

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

@@ -1,6 +1,6 @@
-from PandaModules import *
-from DirectNotifyGlobal import *
-import EventManager
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
+from direct.showbase import EventManager
 import Interval
 import Interval
 import types
 import types
 import fnmatch
 import fnmatch

+ 4 - 4
direct/src/interval/IntervalTest.py

@@ -1,9 +1,9 @@
-from PandaModules import *
-from ShowBaseGlobal import *
+from pandac.PandaModules import *
+from direct.showbase.ShowBaseGlobal import *
 from IntervalGlobal import *
 from IntervalGlobal import *
-from Actor import *
+from direct.actor.Actor import *
 
 
-import Mopath
+from direct.directutil import Mopath
 
 
 boat = loader.loadModel('models/misc/smiley')
 boat = loader.loadModel('models/misc/smiley')
 boat.reparentTo(render)
 boat.reparentTo(render)

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

@@ -1,9 +1,9 @@
 """LerpInterval module: contains the LerpInterval class"""
 """LerpInterval module: contains the LerpInterval class"""
 
 
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
-import LerpBlendHelpers
+from direct.showbase import LerpBlendHelpers
 
 
 #
 #
 # Most of the intervals defined in this module--the group up here at
 # Most of the intervals defined in this module--the group up here at

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

@@ -1,8 +1,8 @@
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 from IntervalManager import ivalMgr
 from IntervalManager import ivalMgr
 import Interval
 import Interval
-import Task
+from direct.task import Task
 import types
 import types
 
 
 PREVIOUS_END = CMetaInterval.RSPreviousEnd
 PREVIOUS_END = CMetaInterval.RSPreviousEnd

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

@@ -1,8 +1,8 @@
 """MopathInterval module: contains the MopathInterval class"""
 """MopathInterval module: contains the MopathInterval class"""
 
 
 import LerpInterval
 import LerpInterval
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 
 
 # import Mopath
 # import Mopath
 
 

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

@@ -1,10 +1,10 @@
 """ParticleInterval module: contains the ParticleInterval class"""
 """ParticleInterval module: contains the ParticleInterval class"""
 
 
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
 
 
-import ParticleEffect
+from direct.particles import ParticleEffect
 
 
 class ParticleInterval(Interval.Interval):
 class ParticleInterval(Interval.Interval):
     # Name counter
     # Name counter

+ 4 - 4
direct/src/interval/ProjectileInterval.py

@@ -1,10 +1,10 @@
 """ProjectileInterval module: contains the ProjectileInterval class"""
 """ProjectileInterval module: contains the ProjectileInterval class"""
 
 
-from DirectObject import *
-from PandaModules import *
+from direct.showbase.DirectObject import *
+from pandac.PandaModules import *
 from Interval import Interval
 from Interval import Interval
-from PythonUtil import lerp
-import PythonUtil
+from direct.showbase.PythonUtil import lerp
+from direct.showbase import PythonUtil
 
 
 class ProjectileInterval(Interval):
 class ProjectileInterval(Interval):
     """ProjectileInterval class: moves a nodepath through the trajectory
     """ProjectileInterval class: moves a nodepath through the trajectory

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

@@ -1,7 +1,7 @@
 """SoundInterval module: contains the SoundInterval class"""
 """SoundInterval module: contains the SoundInterval class"""
 
 
-from PandaModules import *
-from DirectNotifyGlobal import *
+from pandac.PandaModules import *
+from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval
 
 
 class SoundInterval(Interval.Interval):
 class SoundInterval(Interval.Interval):

+ 0 - 0
direct/src/interval/__init__.py


+ 1 - 1
direct/src/level/AmbientSound.py

@@ -1,4 +1,4 @@
-from IntervalGlobal import *
+from direct.interval.IntervalGlobal import *
 import BasicEntities
 import BasicEntities
 import random
 import random
 
 

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