2
0
Эх сурвалжийг харах

Cleanup trailing whitespace

mfwass 10 жил өмнө
parent
commit
f8837999ed
100 өөрчлөгдсөн 1179 нэмэгдсэн , 1179 устгасан
  1. 61 61
      contrib/src/panda3dtoolsgui/Panda3DToolsGUI.py
  2. 13 13
      contrib/src/sceneeditor/AlignTool.py
  3. 6 6
      contrib/src/sceneeditor/MetadataPanel.py
  4. 11 11
      contrib/src/sceneeditor/SideWindow.py
  5. 22 22
      contrib/src/sceneeditor/collisionWindow.py
  6. 13 13
      contrib/src/sceneeditor/controllerWindow.py
  7. 30 30
      contrib/src/sceneeditor/dataHolder.py
  8. 8 8
      contrib/src/sceneeditor/duplicateWindow.py
  9. 19 19
      contrib/src/sceneeditor/lightingPanel.py
  10. 74 74
      contrib/src/sceneeditor/propertyWindow.py
  11. 46 46
      contrib/src/sceneeditor/quad.py
  12. 64 64
      contrib/src/sceneeditor/sceneEditor.py
  13. 14 14
      contrib/src/sceneeditor/seAnimPanel.py
  14. 16 16
      contrib/src/sceneeditor/seBlendAnimPanel.py
  15. 13 13
      contrib/src/sceneeditor/seCameraControl.py
  16. 86 86
      contrib/src/sceneeditor/seFileSaver.py
  17. 2 2
      contrib/src/sceneeditor/seForceGroup.py
  18. 4 4
      contrib/src/sceneeditor/seGeometry.py
  19. 4 4
      contrib/src/sceneeditor/seGrid.py
  20. 19 19
      contrib/src/sceneeditor/seLights.py
  21. 10 10
      contrib/src/sceneeditor/seManipulation.py
  22. 37 37
      contrib/src/sceneeditor/seMopathRecorder.py
  23. 4 4
      contrib/src/sceneeditor/seParticleEffect.py
  24. 3 3
      contrib/src/sceneeditor/seParticlePanel.py
  25. 1 1
      contrib/src/sceneeditor/seParticles.py
  26. 19 19
      contrib/src/sceneeditor/sePlacer.py
  27. 9 9
      contrib/src/sceneeditor/seSceneGraphExplorer.py
  28. 24 24
      contrib/src/sceneeditor/seSelection.py
  29. 20 20
      contrib/src/sceneeditor/seSession.py
  30. 3 3
      contrib/src/sceneeditor/seTree.py
  31. 53 53
      direct/src/actor/Actor.py
  32. 5 5
      direct/src/actor/DistributedActor.py
  33. 12 12
      direct/src/cluster/ClusterClient.py
  34. 4 4
      direct/src/cluster/ClusterMsgs.py
  35. 5 5
      direct/src/cluster/ClusterServer.py
  36. 3 3
      direct/src/controls/BattleWalker.py
  37. 20 20
      direct/src/controls/ControlManager.py
  38. 2 2
      direct/src/controls/DevWalker.py
  39. 5 5
      direct/src/controls/NonPhysicsWalker.py
  40. 2 2
      direct/src/controls/PhysicsWalker.py
  41. 1 1
      direct/src/controls/SwimWalker.py
  42. 6 6
      direct/src/controls/TwoDWalker.py
  43. 6 6
      direct/src/directdevices/DirectJoybox.py
  44. 1 1
      direct/src/directnotify/DirectNotify.py
  45. 14 14
      direct/src/directscripts/extract_docs.py
  46. 6 6
      direct/src/directscripts/packpanda.py
  47. 15 15
      direct/src/directtools/DirectCameraControl.py
  48. 1 1
      direct/src/directtools/DirectGlobals.py
  49. 1 1
      direct/src/directtools/DirectGrid.py
  50. 1 1
      direct/src/directtools/DirectLights.py
  51. 52 52
      direct/src/directtools/DirectManipulation.py
  52. 1 1
      direct/src/directtools/DirectSelection.py
  53. 14 14
      direct/src/directtools/DirectSession.py
  54. 2 2
      direct/src/directutil/DirectMySQLdbConnection.py
  55. 2 2
      direct/src/directutil/Mopath.py
  56. 1 1
      direct/src/distributed/CRDataCache.py
  57. 1 1
      direct/src/distributed/CachedDOData.py
  58. 1 1
      direct/src/distributed/CartesianGridBase.py
  59. 6 6
      direct/src/distributed/ClientRepository.py
  60. 14 14
      direct/src/distributed/ClientRepositoryBase.py
  61. 1 1
      direct/src/distributed/ClockDelta.py
  62. 5 5
      direct/src/distributed/ConnectionRepository.py
  63. 20 20
      direct/src/distributed/DistributedCamera.py
  64. 6 6
      direct/src/distributed/DistributedCameraOV.py
  65. 11 11
      direct/src/distributed/DistributedCartesianGrid.py
  66. 2 2
      direct/src/distributed/DistributedCartesianGridAI.py
  67. 4 4
      direct/src/distributed/DistributedObject.py
  68. 8 8
      direct/src/distributed/DistributedObjectAI.py
  69. 5 5
      direct/src/distributed/DistributedObjectGlobalAI.py
  70. 3 3
      direct/src/distributed/DistributedObjectGlobalUD.py
  71. 1 1
      direct/src/distributed/DistributedObjectOV.py
  72. 4 4
      direct/src/distributed/DistributedObjectUD.py
  73. 6 6
      direct/src/distributed/DistributedSmoothNode.py
  74. 3 3
      direct/src/distributed/DistributedSmoothNodeBase.py
  75. 7 7
      direct/src/distributed/DoCollectionManager.py
  76. 9 9
      direct/src/distributed/DoInterestManager.py
  77. 5 5
      direct/src/distributed/GridChild.py
  78. 2 2
      direct/src/distributed/InterestWatcher.py
  79. 7 7
      direct/src/distributed/MsgTypes.py
  80. 1 1
      direct/src/distributed/MsgTypesCMU.py
  81. 1 1
      direct/src/distributed/ParentMgr.py
  82. 7 7
      direct/src/distributed/PyDatagram.py
  83. 2 2
      direct/src/distributed/PyDatagramIterator.py
  84. 12 12
      direct/src/distributed/RelatedObjectMgr.py
  85. 19 19
      direct/src/distributed/ServerRepository.py
  86. 7 7
      direct/src/distributed/StagedObject.py
  87. 6 6
      direct/src/distributed/TimeManager.py
  88. 2 2
      direct/src/extensions_native/HTTPChannel_extensions.py
  89. 2 2
      direct/src/extensions_native/Mat3_extensions.py
  90. 6 6
      direct/src/filter/CommonFilters.py
  91. 6 6
      direct/src/filter/FilterManager.py
  92. 1 1
      direct/src/fsm/ClassicFSM.py
  93. 2 2
      direct/src/fsm/FSM.py
  94. 36 36
      direct/src/fsm/FourState.py
  95. 36 36
      direct/src/fsm/FourStateAI.py
  96. 3 3
      direct/src/fsm/SampleFSM.py
  97. 2 2
      direct/src/fsm/State.py
  98. 1 1
      direct/src/fsm/StateData.py
  99. 3 3
      direct/src/fsm/StatePush.py
  100. 3 3
      direct/src/gui/DirectButton.py

+ 61 - 61
contrib/src/panda3dtoolsgui/Panda3DToolsGUI.py

@@ -62,7 +62,7 @@ UNIT_TYPES = ["mm",
               "cm",
               "cm",
               "m",
               "m",
               "in",
               "in",
-              "ft", 
+              "ft",
               "yd"]
               "yd"]
 
 
 
 
@@ -229,7 +229,7 @@ class OutputDialogPaths(wx.Dialog):
 
 
         self.Bind(wx.EVT_BUTTON, self.RunPaths, self.paths_done)
         self.Bind(wx.EVT_BUTTON, self.RunPaths, self.paths_done)
         # end wxGlade
         # end wxGlade
-        
+
     def setCallback(self, callback):
     def setCallback(self, callback):
         self.callback = callback
         self.callback = callback
 
 
@@ -286,7 +286,7 @@ class main(wx.Frame):
         self._setupUI()
         self._setupUI()
         #Show the welcome message and the initial panda path
         #Show the welcome message and the initial panda path
         #NOTE this shoudl eventually check for an install of Panda somewhere
         #NOTE this shoudl eventually check for an install of Panda somewhere
-        
+
         self.ShowInitialEnv()
         self.ShowInitialEnv()
 
 
     def _setupUI(self):
     def _setupUI(self):
@@ -379,7 +379,7 @@ class main(wx.Frame):
         self.pandaPathTxt = wx.TextCtrl(self.console_panel, -1, "", style=wx.TE_READONLY)
         self.pandaPathTxt = wx.TextCtrl(self.console_panel, -1, "", style=wx.TE_READONLY)
         self.loadPandaPathBtn = wx.Button(self.console_panel, ID_CHOOSEPANDA, "Choose..")
         self.loadPandaPathBtn = wx.Button(self.console_panel, ID_CHOOSEPANDA, "Choose..")
         self.ignoreModDates = wx.CheckBox(self.console_panel, -1, "Override export changed maya scene files")
         self.ignoreModDates = wx.CheckBox(self.console_panel, -1, "Override export changed maya scene files")
-        
+
 
 
         # Maya2Egg Tool
         # Maya2Egg Tool
         self.maya2egg_panel = wx.Panel(self.tool_options_panel, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
         self.maya2egg_panel = wx.Panel(self.tool_options_panel, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
@@ -694,7 +694,7 @@ class main(wx.Frame):
         self.m2e_exportDestBtn.SetMinSize((-1, 23))
         self.m2e_exportDestBtn.SetMinSize((-1, 23))
         self.m2e_copyTexPathBtn.SetMinSize((-1, 23))
         self.m2e_copyTexPathBtn.SetMinSize((-1, 23))
         self.m2e_pathReplaceBtn.SetMinSize((-1, 23))
         self.m2e_pathReplaceBtn.SetMinSize((-1, 23))
-        
+
         self.m2e_startFrameSpin.SetMinSize((-1, 21))
         self.m2e_startFrameSpin.SetMinSize((-1, 21))
         self.m2e_endFrameSpin.SetMinSize((-1, 21))
         self.m2e_endFrameSpin.SetMinSize((-1, 21))
         self.m2e_frameRateInSpin.SetMinSize((-1, 21))
         self.m2e_frameRateInSpin.SetMinSize((-1, 21))
@@ -745,7 +745,7 @@ class main(wx.Frame):
         self.e2b_eggFileTxt.SetMinSize((230, 21))
         self.e2b_eggFileTxt.SetMinSize((230, 21))
         self.e2b_exportDestTxt.SetMinSize((230, 21))
         self.e2b_exportDestTxt.SetMinSize((230, 21))
         self.egg2bam_panel.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
         self.egg2bam_panel.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
-        
+
         self.e2b_eggFileBtn.SetMinSize((-1, 23))
         self.e2b_eggFileBtn.SetMinSize((-1, 23))
         self.e2b_exportDestBtn.SetMinSize((-1, 23))
         self.e2b_exportDestBtn.SetMinSize((-1, 23))
         self.e2b_bamBatchOutputBtn.SetMinSize((-1, 23))
         self.e2b_bamBatchOutputBtn.SetMinSize((-1, 23))
@@ -771,7 +771,7 @@ class main(wx.Frame):
         self.rename_exportDirTxt.SetMinSize((230, 21))
         self.rename_exportDirTxt.SetMinSize((230, 21))
         self.rename_exportFileTxt.SetMinSize((230, 21))
         self.rename_exportFileTxt.SetMinSize((230, 21))
         self.rename_stripPrefixTxt.SetMinSize((260, 21))
         self.rename_stripPrefixTxt.SetMinSize((260, 21))
-        
+
         self.rename_addEggBtn.SetMinSize((-1, 23))
         self.rename_addEggBtn.SetMinSize((-1, 23))
         self.rename_addFromBatchBtn.SetMinSize((-1, 23))
         self.rename_addFromBatchBtn.SetMinSize((-1, 23))
         self.rename_removeEggBtn.SetMinSize((-1, 23))
         self.rename_removeEggBtn.SetMinSize((-1, 23))
@@ -791,7 +791,7 @@ class main(wx.Frame):
         self.optchar_dropJointsTxt.SetMinSize((245, 21))
         self.optchar_dropJointsTxt.SetMinSize((245, 21))
         self.optchar_exposeJointsTxt.SetMinSize((245, 21))
         self.optchar_exposeJointsTxt.SetMinSize((245, 21))
         self.optchar_flagGeometryTxt.SetMinSize((245, 21))
         self.optchar_flagGeometryTxt.SetMinSize((245, 21))
-        
+
         self.optchar_addEggBtn.SetMinSize((-1, 23))
         self.optchar_addEggBtn.SetMinSize((-1, 23))
         self.optchar_addFromBatchBtn.SetMinSize((-1, 23))
         self.optchar_addFromBatchBtn.SetMinSize((-1, 23))
         self.optchar_removeEggBtn.SetMinSize((-1, 23))
         self.optchar_removeEggBtn.SetMinSize((-1, 23))
@@ -1394,7 +1394,7 @@ class main(wx.Frame):
 
 
     # Simple Export Panel Functions
     # Simple Export Panel Functions
     ################################
     ################################
-        
+
     def OnSimpleExport(self,e):
     def OnSimpleExport(self,e):
         #This is essentially the same behavior as a batch export
         #This is essentially the same behavior as a batch export
         #build up the dictionary that gets passed to Run Export
         #build up the dictionary that gets passed to Run Export
@@ -1441,7 +1441,7 @@ class main(wx.Frame):
 
 
     # Maya2Egg Panel Functions
     # Maya2Egg Panel Functions
     ###########################
     ###########################
-    
+
     def OnMaya2EggMayaFile(self, event):
     def OnMaya2EggMayaFile(self, event):
         #choose input maya scene for maya2egg
         #choose input maya scene for maya2egg
         filename = ''
         filename = ''
@@ -1458,7 +1458,7 @@ class main(wx.Frame):
             self.m2e_mayaFileTxt.SetValue(os.path.join(self.srcProjectFolder + os.sep , filename)) #this is for a text control
             self.m2e_mayaFileTxt.SetValue(os.path.join(self.srcProjectFolder + os.sep , filename)) #this is for a text control
         dlg.Destroy() #otherwise just kill the file dialog
         dlg.Destroy() #otherwise just kill the file dialog
         self.statusBar.SetStatusText("Current Scene File is: " + self.srcProjectFolder + os.sep + filename)
         self.statusBar.SetStatusText("Current Scene File is: " + self.srcProjectFolder + os.sep + filename)
-    
+
     def OnMaya2EggExportDest(self, event):
     def OnMaya2EggExportDest(self, event):
         #choose output egg for maya2egg
         #choose output egg for maya2egg
         filename = ''
         filename = ''
@@ -1501,7 +1501,7 @@ class main(wx.Frame):
             self.m2e_copyTexPathTxt.SetValue(dlg.GetPath())
             self.m2e_copyTexPathTxt.SetValue(dlg.GetPath())
         dlg.Destroy() #otherwise just kill the file dialog
         dlg.Destroy() #otherwise just kill the file dialog
         #self.statusBar.SetStatusText("Current Egg File is: " + dirname + '\\' + filename)
         #self.statusBar.SetStatusText("Current Egg File is: " + dirname + '\\' + filename)
-        
+
     def OnMaya2EggPathReplace(self,event):
     def OnMaya2EggPathReplace(self,event):
         batchList = self.GetSelectedBatchList()
         batchList = self.GetSelectedBatchList()
         for batchItem in batchList:
         for batchItem in batchList:
@@ -1533,7 +1533,7 @@ class main(wx.Frame):
         dlg = wx.FileDialog(self, "Choose an Egg file to load", dirname, "", "*.bam", wx.SAVE)
         dlg = wx.FileDialog(self, "Choose an Egg file to load", dirname, "", "*.bam", wx.SAVE)
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
             self.filename = dlg.GetFilename()
             self.filename = dlg.GetFilename()
-            dirname = dlg.GetDirectory()            
+            dirname = dlg.GetDirectory()
             self.e2b_exportDestTxt.SetValue(os.path.join(dirname + os.sep , self.filename)) #this is for a text control duh
             self.e2b_exportDestTxt.SetValue(os.path.join(dirname + os.sep , self.filename)) #this is for a text control duh
         dlg.Destroy() #otherwise just kill the file dialog
         dlg.Destroy() #otherwise just kill the file dialog
 
 
@@ -1545,7 +1545,7 @@ class main(wx.Frame):
         else:
         else:
             self.e2b_eggFileTxt.Disable()
             self.e2b_eggFileTxt.Disable()
             self.e2b_eggFileBtn.Disable()
             self.e2b_eggFileBtn.Disable()
-    
+
     def OnEgg2BamBatchOutput(self, event):
     def OnEgg2BamBatchOutput(self, event):
         for eggInfo in self.GetOutputFromBatch():
         for eggInfo in self.GetOutputFromBatch():
             batchItemInfo = {}
             batchItemInfo = {}
@@ -1622,7 +1622,7 @@ class main(wx.Frame):
             self.rename_eggFilesTree.AppendItem(self.rename_eggFilesRoot, str(index) + ' ' + str(treeitem))
             self.rename_eggFilesTree.AppendItem(self.rename_eggFilesRoot, str(index) + ' ' + str(treeitem))
         self.rename_eggFilesTree.ExpandAll()
         self.rename_eggFilesTree.ExpandAll()
         self.OnRenameInPlace(None)
         self.OnRenameInPlace(None)
-        
+
     def OnRenameInPlace(self, event):
     def OnRenameInPlace(self, event):
         #check if we want to use a custom egg file or not for egg-rename panel
         #check if we want to use a custom egg file or not for egg-rename panel
         if (self.rename_exportInPlaceChk.GetValue()):
         if (self.rename_exportInPlaceChk.GetValue()):
@@ -1671,7 +1671,7 @@ class main(wx.Frame):
         dlg.Destroy()
         dlg.Destroy()
 
 
 
 
-            
+
     # Egg-Optchar Panel Functions
     # Egg-Optchar Panel Functions
     ##############################
     ##############################
 
 
@@ -1692,7 +1692,7 @@ class main(wx.Frame):
         dlg.Destroy() #otherwise just kill the file dialog
         dlg.Destroy() #otherwise just kill the file dialog
         self.statusBar.SetStatusText("The input egg File is: " + dirname + os.sep + filename)
         self.statusBar.SetStatusText("The input egg File is: " + dirname + os.sep + filename)
         self.OnOptcharInPlace(None)
         self.OnOptcharInPlace(None)
-        
+
     def OnOptcharAddFromBatch(self, event):
     def OnOptcharAddFromBatch(self, event):
         for eggInfo in self.GetOutputFromBatch():
         for eggInfo in self.GetOutputFromBatch():
             self.optchar_eggList.append(eggInfo)
             self.optchar_eggList.append(eggInfo)
@@ -1710,7 +1710,7 @@ class main(wx.Frame):
             self.optchar_eggFilesTree.Delete(item)
             self.optchar_eggFilesTree.Delete(item)
             self.UpdateEggOptcharDisplay()
             self.UpdateEggOptcharDisplay()
         self.OnOptcharInPlace(None)
         self.OnOptcharInPlace(None)
-            
+
     def OnOptcharRemoveAllEggs(self, event):
     def OnOptcharRemoveAllEggs(self, event):
         #remove all input egg files from eggs list in egg-optchar panel
         #remove all input egg files from eggs list in egg-optchar panel
         self.optchar_eggFilesTree.DeleteAllItems()
         self.optchar_eggFilesTree.DeleteAllItems()
@@ -1768,7 +1768,7 @@ class main(wx.Frame):
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
             self.optchar_exportDirTxt.SetValue(dlg.GetPath())
             self.optchar_exportDirTxt.SetValue(dlg.GetPath())
         dlg.Destroy()
         dlg.Destroy()
-      
+
 
 
     # Egg-Palettize Panel Functions
     # Egg-Palettize Panel Functions
     ################################
     ################################
@@ -1789,14 +1789,14 @@ class main(wx.Frame):
 
 
         dlg.Destroy() #otherwise just kill the file dialog
         dlg.Destroy() #otherwise just kill the file dialog
         self.OnPalettizeInPlace(None)
         self.OnPalettizeInPlace(None)
-        
+
     def OnPalettizeAddFromBatch(self, event):
     def OnPalettizeAddFromBatch(self, event):
         for eggInfo in self.GetOutputFromBatch():
         for eggInfo in self.GetOutputFromBatch():
             self.palettize_eggList.append(eggInfo)
             self.palettize_eggList.append(eggInfo)
             self.palettize_eggFilesTree.AppendItem(self.palettize_eggFilesRoot, str(len(self.palettize_eggList)) + ' ' + eggInfo)
             self.palettize_eggFilesTree.AppendItem(self.palettize_eggFilesRoot, str(len(self.palettize_eggList)) + ' ' + eggInfo)
             self.palettize_eggFilesTree.ExpandAll()
             self.palettize_eggFilesTree.ExpandAll()
         self.OnPalettizeInPlace(None)
         self.OnPalettizeInPlace(None)
-        
+
     def OnPalettizeRemoveEgg(self,e):
     def OnPalettizeRemoveEgg(self,e):
         #remove selected input egg file from multiple eggs panel in egg-palettize panel
         #remove selected input egg file from multiple eggs panel in egg-palettize panel
         item = self.palettize_eggFilesTree.GetSelection()
         item = self.palettize_eggFilesTree.GetSelection()
@@ -1872,7 +1872,7 @@ class main(wx.Frame):
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
         if dlg.ShowModal() == wx.ID_OK: #if the user clicked ok then we grabbed a file so load it
             self.palettize_exportTexTxt.SetValue(dlg.GetPath())
             self.palettize_exportTexTxt.SetValue(dlg.GetPath())
         dlg.Destroy()
         dlg.Destroy()
-        
+
     def OnPalettizeLoadTxa(self, event):
     def OnPalettizeLoadTxa(self, event):
         dirname = ''
         dirname = ''
         dlg = wx.FileDialog(self, "Choose a .txa file to use", dirname, "", "*.txa", wx.OPEN)
         dlg = wx.FileDialog(self, "Choose a .txa file to use", dirname, "", "*.txa", wx.OPEN)
@@ -1954,7 +1954,7 @@ class main(wx.Frame):
 
 
     # Batch Related Functions
     # Batch Related Functions
     ##########################
     ##########################
-    
+
     def GetSelectedBatchList(self):
     def GetSelectedBatchList(self):
         batchList = []
         batchList = []
         selectedItems = self.batchTree.GetSelections()
         selectedItems = self.batchTree.GetSelections()
@@ -1963,7 +1963,7 @@ class main(wx.Frame):
             batchList.append(self.batchList[selectedItemIndex])
             batchList.append(self.batchList[selectedItemIndex])
         if not len(batchList):
         if not len(batchList):
             batchList = self.batchList
             batchList = self.batchList
-            
+
         return batchList
         return batchList
 
 
     def GetOutputFromBatch(self, index=-1):
     def GetOutputFromBatch(self, index=-1):
@@ -2226,7 +2226,7 @@ class main(wx.Frame):
         return args
         return args
 
 
     def BuildEgg2BamArgs(self):
     def BuildEgg2BamArgs(self):
-        #Build up all the command line arguments present in the egg2bam panel 
+        #Build up all the command line arguments present in the egg2bam panel
         args = {}
         args = {}
 
 
         if (self.e2b_flattenChk.GetValue()):
         if (self.e2b_flattenChk.GetValue()):
@@ -2271,7 +2271,7 @@ class main(wx.Frame):
         args['dart'] = self.optchar_dartChoice.GetStringSelection()
         args['dart'] = self.optchar_dartChoice.GetStringSelection()
 
 
         return args
         return args
-        
+
     def BuildEggPalettizeArgs(self):
     def BuildEggPalettizeArgs(self):
         args = {}
         args = {}
 
 
@@ -2355,7 +2355,7 @@ class main(wx.Frame):
 
 
     def UpdateBatchDisplay(self):
     def UpdateBatchDisplay(self):
         #update the display of the batch list
         #update the display of the batch list
-        
+
         #For now just re calculate the entire list order
         #For now just re calculate the entire list order
         self.batchTree.DeleteAllItems()
         self.batchTree.DeleteAllItems()
         self.treeRoot = self.batchTree.AddRoot('Batch Files')
         self.treeRoot = self.batchTree.AddRoot('Batch Files')
@@ -2372,21 +2372,21 @@ class main(wx.Frame):
         if self.batchList != []:
         if self.batchList != []:
             self.batchList = []
             self.batchList = []
         self.treeRoot = self.batchTree.AddRoot('Batch Files') #rather than loop through it re-add the root
         self.treeRoot = self.batchTree.AddRoot('Batch Files') #rather than loop through it re-add the root
-        
+
     def OnClearOutput(self, event):
     def OnClearOutput(self, event):
         #clear the console output content
         #clear the console output content
         self.consoleOutputTxt.Clear()
         self.consoleOutputTxt.Clear()
-        
+
     def OnExit(self, e):
     def OnExit(self, e):
         #exit the GUI
         #exit the GUI
         self.Close(True)
         self.Close(True)
-        
+
     def OnLoadPview(self, event):
     def OnLoadPview(self, event):
         #load pview
         #load pview
         path = self.pandaPathTxt.GetValue() + os.sep + 'bin' + os.sep
         path = self.pandaPathTxt.GetValue() + os.sep + 'bin' + os.sep
         self.outpview = OutputDialogpview(self)
         self.outpview = OutputDialogpview(self)
         self.outpview.Show()
         self.outpview.Show()
-        
+
     def OnSortBatch(self, event):
     def OnSortBatch(self, event):
         maya2eggCommands = []
         maya2eggCommands = []
         egg2bamCommands = []
         egg2bamCommands = []
@@ -2435,9 +2435,9 @@ class main(wx.Frame):
             if batchItem['finput'].count(inPrefix):
             if batchItem['finput'].count(inPrefix):
                 pass
                 pass
 
 
-        
+
     def OnSaveBatch(self,event):
     def OnSaveBatch(self,event):
-        #save current batch list       
+        #save current batch list
         newdoc = Document()
         newdoc = Document()
         top_element = newdoc.createElement('batch')
         top_element = newdoc.createElement('batch')
         newdoc.appendChild(top_element)
         newdoc.appendChild(top_element)
@@ -2795,7 +2795,7 @@ class main(wx.Frame):
                 self.optchar_flagGeometryChk.SetValue(batchItem['args'].has_key('flag'))
                 self.optchar_flagGeometryChk.SetValue(batchItem['args'].has_key('flag'))
                 self.optchar_flagGeometryTxt.SetValue('' if not batchItem['args'].has_key('flag') else batchItem['args']['flag'])
                 self.optchar_flagGeometryTxt.SetValue('' if not batchItem['args'].has_key('flag') else batchItem['args']['flag'])
                 self.optchar_dartChoice.SetStringSelection(batchItem['args']['dart'])
                 self.optchar_dartChoice.SetStringSelection(batchItem['args']['dart'])
-                
+
             elif (batchItem['cmd'].count('egg-palettize')):
             elif (batchItem['cmd'].count('egg-palettize')):
                 self.toolComboBox.SetStringSelection('egg-palettize')
                 self.toolComboBox.SetStringSelection('egg-palettize')
                 self.OnTool(None)
                 self.OnTool(None)
@@ -2891,7 +2891,7 @@ class main(wx.Frame):
         top_element.appendChild(texitem)
         top_element.appendChild(texitem)
         top_element.appendChild(overitem)
         top_element.appendChild(overitem)
         top_element.appendChild(attributeitem)
         top_element.appendChild(attributeitem)
-        
+
         pandadir = newdoc.createTextNode(str(self.pandaPathTxt.GetValue()))
         pandadir = newdoc.createTextNode(str(self.pandaPathTxt.GetValue()))
         mayaver = newdoc.createTextNode(str(self.m2e_mayaVerComboBox.GetSelection()))
         mayaver = newdoc.createTextNode(str(self.m2e_mayaVerComboBox.GetSelection()))
         pandadirElem = newdoc.createElement('pandadir')
         pandadirElem = newdoc.createElement('pandadir')
@@ -2900,7 +2900,7 @@ class main(wx.Frame):
         mayaverElem.appendChild(mayaver)
         mayaverElem.appendChild(mayaver)
         envitem.appendChild(pandadirElem)
         envitem.appendChild(pandadirElem)
         envitem.appendChild(mayaverElem)
         envitem.appendChild(mayaverElem)
-        
+
         inunits = newdoc.createTextNode(str(self.m2e_mayaUnitsComboBox.GetValue()))
         inunits = newdoc.createTextNode(str(self.m2e_mayaUnitsComboBox.GetValue()))
         outunits = newdoc.createTextNode(str(self.m2e_pandaUnitsComboBox.GetValue()))
         outunits = newdoc.createTextNode(str(self.m2e_pandaUnitsComboBox.GetValue()))
         bface = newdoc.createTextNode(str(int(self.m2e_backfaceChk.GetValue())))
         bface = newdoc.createTextNode(str(int(self.m2e_backfaceChk.GetValue())))
@@ -2909,7 +2909,7 @@ class main(wx.Frame):
         subsetsval = newdoc.createTextNode(str(self.m2e_subsetsTxt.GetValue()))
         subsetsval = newdoc.createTextNode(str(self.m2e_subsetsTxt.GetValue()))
         excludes = newdoc.createTextNode(str(int(self.m2e_excludesChk.GetValue())))
         excludes = newdoc.createTextNode(str(int(self.m2e_excludesChk.GetValue())))
         excludesval = newdoc.createTextNode(str(self.m2e_excludesTxt.GetValue()))
         excludesval = newdoc.createTextNode(str(self.m2e_excludesTxt.GetValue()))
-        
+
         inunitsElem = newdoc.createElement('inunits')
         inunitsElem = newdoc.createElement('inunits')
         outunitsElem = newdoc.createElement('outunits')
         outunitsElem = newdoc.createElement('outunits')
         bfaceElem = newdoc.createElement('bface')
         bfaceElem = newdoc.createElement('bface')
@@ -2918,7 +2918,7 @@ class main(wx.Frame):
         subnamesElem = newdoc.createElement('subnames')
         subnamesElem = newdoc.createElement('subnames')
         excludesElem = newdoc.createElement('excludes')
         excludesElem = newdoc.createElement('excludes')
         exnamesElem = newdoc.createElement('excludesval')
         exnamesElem = newdoc.createElement('excludesval')
-        
+
         inunitsElem.appendChild(inunits)
         inunitsElem.appendChild(inunits)
         outunitsElem.appendChild(outunits)
         outunitsElem.appendChild(outunits)
         bfaceElem.appendChild(bface)
         bfaceElem.appendChild(bface)
@@ -2927,7 +2927,7 @@ class main(wx.Frame):
         subnamesElem.appendChild(subsetsval)
         subnamesElem.appendChild(subsetsval)
         excludesElem.appendChild(excludes)
         excludesElem.appendChild(excludes)
         exnamesElem.appendChild(exnamesElem)
         exnamesElem.appendChild(exnamesElem)
-        
+
         genitem.appendChild(inunitsElem)
         genitem.appendChild(inunitsElem)
         genitem.appendChild(outunitsElem)
         genitem.appendChild(outunitsElem)
         genitem.appendChild(bfaceElem)
         genitem.appendChild(bfaceElem)
@@ -2937,7 +2937,7 @@ class main(wx.Frame):
         genitem.appendChild(excludesElem)
         genitem.appendChild(excludesElem)
         genitem.appendChild(exnamesElem)
         genitem.appendChild(exnamesElem)
 
 
-        
+
         modeloptsElem = newdoc.createElement('modelopts')
         modeloptsElem = newdoc.createElement('modelopts')
         cnElem = newdoc.createElement('cn')
         cnElem = newdoc.createElement('cn')
         charnameElem = newdoc.createElement('charname')
         charnameElem = newdoc.createElement('charname')
@@ -2960,7 +2960,7 @@ class main(wx.Frame):
         framerangeElem.appendChild(frivalElem)
         framerangeElem.appendChild(frivalElem)
         framerangeElem.appendChild(froElem)
         framerangeElem.appendChild(froElem)
         framerangeElem.appendChild(frovalElem)
         framerangeElem.appendChild(frovalElem)
-        
+
         modelopts = newdoc.createTextNode(str(self.m2e_animOptChoice.GetSelection()))
         modelopts = newdoc.createTextNode(str(self.m2e_animOptChoice.GetSelection()))
         cn = newdoc.createTextNode(str(int(self.m2e_charNameChk.GetValue())))
         cn = newdoc.createTextNode(str(int(self.m2e_charNameChk.GetValue())))
         charname = newdoc.createTextNode(str(self.m2e_charNameTxt.GetValue()))
         charname = newdoc.createTextNode(str(self.m2e_charNameTxt.GetValue()))
@@ -2968,7 +2968,7 @@ class main(wx.Frame):
         modeloptsElem.appendChild(modelopts)
         modeloptsElem.appendChild(modelopts)
         cnElem.appendChild(cn)
         cnElem.appendChild(cn)
         charnameElem.appendChild(charname)
         charnameElem.appendChild(charname)
-        
+
         sf = newdoc.createTextNode(str(int(self.m2e_startFrameChk.GetValue())))
         sf = newdoc.createTextNode(str(int(self.m2e_startFrameChk.GetValue())))
         sfval = newdoc.createTextNode(str(self.m2e_startFrameSpin.GetValue()))
         sfval = newdoc.createTextNode(str(self.m2e_startFrameSpin.GetValue()))
         ef = newdoc.createTextNode(str(int(self.m2e_endFrameChk.GetValue())))
         ef = newdoc.createTextNode(str(int(self.m2e_endFrameChk.GetValue())))
@@ -2977,7 +2977,7 @@ class main(wx.Frame):
         frival = newdoc.createTextNode(str(self.m2e_frameRateInSpin.GetValue()))
         frival = newdoc.createTextNode(str(self.m2e_frameRateInSpin.GetValue()))
         fro = newdoc.createTextNode(str(int(self.m2e_frameRateOutChk.GetValue())))
         fro = newdoc.createTextNode(str(int(self.m2e_frameRateOutChk.GetValue())))
         froval = newdoc.createTextNode(str(self.m2e_frameRateOutSpin.GetValue()))
         froval = newdoc.createTextNode(str(self.m2e_frameRateOutSpin.GetValue()))
-        
+
         sfElem.appendChild(sf)
         sfElem.appendChild(sf)
         sfvalElem.appendChild(sfval)
         sfvalElem.appendChild(sfval)
         efElem.appendChild(ef)
         efElem.appendChild(ef)
@@ -2986,30 +2986,30 @@ class main(wx.Frame):
         frivalElem.appendChild(frival)
         frivalElem.appendChild(frival)
         froElem.appendChild(fro)
         froElem.appendChild(fro)
         frovalElem.appendChild(froval)
         frovalElem.appendChild(froval)
-        
+
         subroots = newdoc.createTextNode(str(int(self.m2e_subrootsChk.GetValue())))
         subroots = newdoc.createTextNode(str(int(self.m2e_subrootsChk.GetValue())))
         subrnames = newdoc.createTextNode(str(self.m2e_subrootsTxt.GetValue()))
         subrnames = newdoc.createTextNode(str(self.m2e_subrootsTxt.GetValue()))
         subrootsElem.appendChild(subroots)
         subrootsElem.appendChild(subroots)
         subrnamesElem.appendChild(subrnames)
         subrnamesElem.appendChild(subrnames)
-        
+
         animitem.appendChild(modeloptsElem)
         animitem.appendChild(modeloptsElem)
         animitem.appendChild(cnElem)
         animitem.appendChild(cnElem)
         animitem.appendChild(charnameElem)
         animitem.appendChild(charnameElem)
         animitem.appendChild(framerangeElem)
         animitem.appendChild(framerangeElem)
         animitem.appendChild(subrootsElem)
         animitem.appendChild(subrootsElem)
         animitem.appendChild(subrnamesElem)
         animitem.appendChild(subrnamesElem)
-        
+
         legacy_shaderElem = newdoc.createElement('legacy-shader')
         legacy_shaderElem = newdoc.createElement('legacy-shader')
         copytexElem = newdoc.createElement('copytex')
         copytexElem = newdoc.createElement('copytex')
         destpathElem = newdoc.createElement('path')
         destpathElem = newdoc.createElement('path')
         legacy_shader = newdoc.createTextNode(str(int(self.m2e_legacyShaderChk.GetValue())))
         legacy_shader = newdoc.createTextNode(str(int(self.m2e_legacyShaderChk.GetValue())))
         copytex = newdoc.createTextNode(str(int(self.m2e_copyTexChk.GetValue())))
         copytex = newdoc.createTextNode(str(int(self.m2e_copyTexChk.GetValue())))
         destpath = newdoc.createTextNode(str(self.m2e_copyTexPathTxt.GetValue()))
         destpath = newdoc.createTextNode(str(self.m2e_copyTexPathTxt.GetValue()))
-        
+
         legacy_shaderElem.appendChild(legacy_shader)
         legacy_shaderElem.appendChild(legacy_shader)
         copytexElem.appendChild(copytex)
         copytexElem.appendChild(copytex)
         destpathElem.appendChild(destpath)
         destpathElem.appendChild(destpath)
-        
+
         texitem.appendChild(legacy_shaderElem)
         texitem.appendChild(legacy_shaderElem)
         texitem.appendChild(copytexElem)
         texitem.appendChild(copytexElem)
         texitem.appendChild(destpathElem)
         texitem.appendChild(destpathElem)
@@ -3033,7 +3033,7 @@ class main(wx.Frame):
         AElem = newdoc.createElement('A')
         AElem = newdoc.createElement('A')
         marginElem = newdoc.createElement('margin')
         marginElem = newdoc.createElement('margin')
         coverageElem = newdoc.createElement('coverage')
         coverageElem = newdoc.createElement('coverage')
-        
+
         imagetypeElem.appendChild(imagetype)
         imagetypeElem.appendChild(imagetype)
         powertwoElem.appendChild(powertwo)
         powertwoElem.appendChild(powertwo)
         RElem.appendChild(R)
         RElem.appendChild(R)
@@ -3042,7 +3042,7 @@ class main(wx.Frame):
         AElem.appendChild(A)
         AElem.appendChild(A)
         marginElem.appendChild(margin)
         marginElem.appendChild(margin)
         coverageElem.appendChild(coverage)
         coverageElem.appendChild(coverage)
-        
+
         attributeitem.appendChild(imagetypeElem)
         attributeitem.appendChild(imagetypeElem)
         attributeitem.appendChild(powertwoElem)
         attributeitem.appendChild(powertwoElem)
         attributeitem.appendChild(RElem)
         attributeitem.appendChild(RElem)
@@ -3051,7 +3051,7 @@ class main(wx.Frame):
         attributeitem.appendChild(AElem)
         attributeitem.appendChild(AElem)
         attributeitem.appendChild(marginElem)
         attributeitem.appendChild(marginElem)
         attributeitem.appendChild(coverageElem)
         attributeitem.appendChild(coverageElem)
-        
+
         filename = ''
         filename = ''
         dirname = ''
         dirname = ''
         dlg = wx.FileDialog(self, "Choose a location and filename", dirname, "", "*.xml", wx.SAVE)
         dlg = wx.FileDialog(self, "Choose a location and filename", dirname, "", "*.xml", wx.SAVE)
@@ -3065,7 +3065,7 @@ class main(wx.Frame):
             for line in out:
             for line in out:
                 f.writelines(line)
                 f.writelines(line)
             f.close()
             f.close()
-            
+
     def OnLoadPrefs(self, event): # wxGlade: main.<event_handler>
     def OnLoadPrefs(self, event): # wxGlade: main.<event_handler>
         #load preferences
         #load preferences
         dirname = ''
         dirname = ''
@@ -3083,14 +3083,14 @@ class main(wx.Frame):
         #parse the file of preferences
         #parse the file of preferences
         prefsDict = {}
         prefsDict = {}
         for list in doc.getElementsByTagName('preferences'):
         for list in doc.getElementsByTagName('preferences'):
-            
+
             envlist = list.getElementsByTagName('environment')
             envlist = list.getElementsByTagName('environment')
             genlist = list.getElementsByTagName('genoptions')
             genlist = list.getElementsByTagName('genoptions')
             animlist = list.getElementsByTagName('animoptions')
             animlist = list.getElementsByTagName('animoptions')
             texlist = list.getElementsByTagName('textureoptions')
             texlist = list.getElementsByTagName('textureoptions')
             overlist = list.getElementsByTagName('overridemod')
             overlist = list.getElementsByTagName('overridemod')
             attributelist = list.getElementsByTagName('attribute')
             attributelist = list.getElementsByTagName('attribute')
-            
+
             for elem in envlist:
             for elem in envlist:
                 for nodes in elem.childNodes:
                 for nodes in elem.childNodes:
                     for val in nodes.childNodes:
                     for val in nodes.childNodes:
@@ -3112,7 +3112,7 @@ class main(wx.Frame):
             for elem in animlist:
             for elem in animlist:
                 for elem2 in elem.childNodes:
                 for elem2 in elem.childNodes:
                     for elem3 in elem2.childNodes:
                     for elem3 in elem2.childNodes:
-                        data = elem3                       
+                        data = elem3
                         parent =  str(elem3.parentNode.nodeName)
                         parent =  str(elem3.parentNode.nodeName)
                         if parent == 'framerange':
                         if parent == 'framerange':
                             list = data.childNodes
                             list = data.childNodes
@@ -3134,15 +3134,15 @@ class main(wx.Frame):
                     for val in nodes.childNodes:
                     for val in nodes.childNodes:
                         key = val.parentNode.nodeName
                         key = val.parentNode.nodeName
                         data =  str(val.data)
                         data =  str(val.data)
-                        prefsDict[str(key)] = data.strip()  
-                        
+                        prefsDict[str(key)] = data.strip()
+
         return prefsDict
         return prefsDict
-    
+
     def updateOptions(self,prefs):
     def updateOptions(self,prefs):
         #lots of type conversions since I think XML only stores strings
         #lots of type conversions since I think XML only stores strings
         #I'm not sure I have to cast the ints to bools
         #I'm not sure I have to cast the ints to bools
-        #but I don't want to chance it with wxPython 
-        #other than that all we're doing here is 
+        #but I don't want to chance it with wxPython
+        #other than that all we're doing here is
         #setting all the options to the saved ones in the dictionary
         #setting all the options to the saved ones in the dictionary
         self.pandaPathTxt.SetValue(prefs['pandadir'])
         self.pandaPathTxt.SetValue(prefs['pandadir'])
         self.m2e_mayaVerComboBox.SetSelection(int(prefs['mayaver']))
         self.m2e_mayaVerComboBox.SetSelection(int(prefs['mayaver']))
@@ -3180,7 +3180,7 @@ class main(wx.Frame):
         self.palettize_marginTxt.SetValue(int(prefs['margin']))
         self.palettize_marginTxt.SetValue(int(prefs['margin']))
         self.palettize_coverageTxt.SetValue(prefs['coverage'])
         self.palettize_coverageTxt.SetValue(prefs['coverage'])
 
 
-        
+
 if __name__ == "__main__":
 if __name__ == "__main__":
     app = wx.App(0)
     app = wx.App(0)
     wx.InitAllImageHandlers()
     wx.InitAllImageHandlers()

+ 13 - 13
contrib/src/sceneeditor/AlignTool.py

@@ -19,7 +19,7 @@ class AlignTool(AppShell):
     padx            = 0
     padx            = 0
     pady            = 0
     pady            = 0
 
 
-    
+
     def __init__(self, list = [], parent = None, nodePath = None, **kw):
     def __init__(self, list = [], parent = None, nodePath = None, **kw):
         # Keep nodePath Data
         # Keep nodePath Data
         self.nodePath = nodePath
         self.nodePath = nodePath
@@ -36,14 +36,14 @@ class AlignTool(AppShell):
             self.parent = Toplevel()
             self.parent = Toplevel()
         AppShell.__init__(self, self.parent)
         AppShell.__init__(self, self.parent)
         self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
         self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
-        
+
         self.initialiseoptions(AlignTool)
         self.initialiseoptions(AlignTool)
-        
+
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
-        
+
     def appInit(self):
     def appInit(self):
         return
         return
-        
+
     def createInterface(self):
     def createInterface(self):
         # The interior of the toplevel panel
         # The interior of the toplevel panel
         interior = self.interior()
         interior = self.interior()
@@ -77,14 +77,14 @@ class AlignTool(AppShell):
             variable = self.alignHVar)
             variable = self.alignHVar)
         self.alignHButton.pack(side=RIGHT, expand=False)
         self.alignHButton.pack(side=RIGHT, expand=False)
         frame.pack(side=TOP, fill = X, expand = 1,pady=5)
         frame.pack(side=TOP, fill = X, expand = 1,pady=5)
-        
+
         groupFrame.pack(side=TOP, fill = 'both', expand = 1,padx=5,pady=5)
         groupFrame.pack(side=TOP, fill = 'both', expand = 1,padx=5,pady=5)
-        
+
         frame = Frame(mainFrame)
         frame = Frame(mainFrame)
         Button(frame, text='Align', width = 13, command=self.Align_press).pack(side=LEFT)
         Button(frame, text='Align', width = 13, command=self.Align_press).pack(side=LEFT)
         Button(frame, text='OK', width = 13, command=self.ok_press).pack(side=RIGHT)
         Button(frame, text='OK', width = 13, command=self.ok_press).pack(side=RIGHT)
         frame.pack(side=BOTTOM, fill = X, expand = 1,pady=5)
         frame.pack(side=BOTTOM, fill = X, expand = 1,pady=5)
-        
+
         # Y and P checkbox
         # Y and P checkbox
         frame = Frame(groupFrame)
         frame = Frame(groupFrame)
         self.alignYVar = IntVar()
         self.alignYVar = IntVar()
@@ -149,14 +149,14 @@ class AlignTool(AppShell):
             variable = self.alignSZVar)
             variable = self.alignSZVar)
         self.alignSZButton.pack(side=LEFT, expand=False)
         self.alignSZButton.pack(side=LEFT, expand=False)
         frame.pack(side=TOP, fill = X, expand = 1,pady=5)
         frame.pack(side=TOP, fill = X, expand = 1,pady=5)
-        
-        
+
+
         mainFrame.pack(fill = 'both', expand = 1,padx=7,pady=7)
         mainFrame.pack(fill = 'both', expand = 1,padx=7,pady=7)
 
 
-    
+
     def createMenuBar(self):
     def createMenuBar(self):
         self.menuBar.destroy()
         self.menuBar.destroy()
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         messenger.send('ALW_close', [self.nodePath.getName()])
         messenger.send('ALW_close', [self.nodePath.getName()])
         '''
         '''
@@ -165,7 +165,7 @@ class AlignTool(AppShell):
         pass
         pass
 
 
     ###############################
     ###############################
-    
+
     def ok_press(self):
     def ok_press(self):
         #################################################################
         #################################################################
         # ok_press(self)
         # ok_press(self)

+ 6 - 6
contrib/src/sceneeditor/MetadataPanel.py

@@ -12,13 +12,13 @@ class MetadataPanel(AppShell,Pmw.MegaWidget):
     usecommandarea  = 0
     usecommandarea  = 0
     usestatusarea   = 0
     usestatusarea   = 0
     Metatag=""
     Metatag=""
-    Metanode=None 
+    Metanode=None
     tag_text=None
     tag_text=None
     def __init__(self,nodePath,parent=None,**kw):
     def __init__(self,nodePath,parent=None,**kw):
 
 
         # Initialise superclass
         # Initialise superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
-        
+
         # Define the megawidget options.
         # Define the megawidget options.
         optiondefs = (
         optiondefs = (
             ('title',       self.appname,       None),
             ('title',       self.appname,       None),
@@ -31,10 +31,10 @@ class MetadataPanel(AppShell,Pmw.MegaWidget):
         if parent == None:
         if parent == None:
             self.parent = Toplevel()
             self.parent = Toplevel()
         AppShell.__init__(self, self.parent)
         AppShell.__init__(self, self.parent)
-        
+
         self.parent.resizable(False,False)
         self.parent.resizable(False,False)
 
 
-    
+
     def appInit(self):
     def appInit(self):
         print "Metadata Panel"
         print "Metadata Panel"
 
 
@@ -55,5 +55,5 @@ class MetadataPanel(AppShell,Pmw.MegaWidget):
 
 
     def SetIt(self):
     def SetIt(self):
         self.Metanode.setTag("Metadata",self.tag_text.get())
         self.Metanode.setTag("Metadata",self.tag_text.get())
-        
-        
+
+

+ 11 - 11
contrib/src/sceneeditor/SideWindow.py

@@ -31,9 +31,9 @@ class sideWindow(AppShell):
     backface = 0
     backface = 0
     texture = 1
     texture = 1
     wireframe = 0
     wireframe = 0
-    
+
     enableBaseUseDrive = 0
     enableBaseUseDrive = 0
-    
+
     def __init__(self, worldColor,lightEnable,ParticleEnable, basedriveEnable,collision,
     def __init__(self, worldColor,lightEnable,ParticleEnable, basedriveEnable,collision,
                  backface, texture, wireframe, grid, widgetVis, enableAutoCamera, parent = None, nodePath = render, **kw):
                  backface, texture, wireframe, grid, widgetVis, enableAutoCamera, parent = None, nodePath = render, **kw):
         self.worldColor = worldColor
         self.worldColor = worldColor
@@ -58,15 +58,15 @@ class sideWindow(AppShell):
             self.parent = Toplevel()
             self.parent = Toplevel()
         else:
         else:
             self.parent = parent
             self.parent = parent
-        
+
         AppShell.__init__(self, self.parent)
         AppShell.__init__(self, self.parent)
         self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
         self.parent.geometry('%dx%d+%d+%d' % (self.frameWidth, self.frameHeight,self.frameIniPosX,self.frameIniPosY))
 
 
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
-                
+
     def appInit(self):
     def appInit(self):
         print '----SideWindow is Initialized!!'
         print '----SideWindow is Initialized!!'
-        
+
     def createInterface(self):
     def createInterface(self):
         # The interior of the toplevel panel
         # The interior of the toplevel panel
         interior = self.interior()
         interior = self.interior()
@@ -212,11 +212,11 @@ class sideWindow(AppShell):
         self.notebookFrame.setnaturalsize()
         self.notebookFrame.setnaturalsize()
         mainFrame.pack(fill = 'both', expand = 1)
         mainFrame.pack(fill = 'both', expand = 1)
 
 
-    
+
     def createMenuBar(self):
     def createMenuBar(self):
         # We don't need menu bar here.
         # We don't need menu bar here.
         self.menuBar.destroy()
         self.menuBar.destroy()
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         #################################################################
         #################################################################
         # onDestroy(self, event)
         # onDestroy(self, event)
@@ -352,7 +352,7 @@ class sideWindow(AppShell):
         self.backface = (self.backface+1)%2
         self.backface = (self.backface+1)%2
         self.backfaceButton.toggle()
         self.backfaceButton.toggle()
         return
         return
-    
+
     def toggleTexture(self):
     def toggleTexture(self):
         #################################################################
         #################################################################
         # toggleTexture(self)
         # toggleTexture(self)
@@ -361,7 +361,7 @@ class sideWindow(AppShell):
         base.toggleTexture()
         base.toggleTexture()
         self.texture = (self.texture+1)%2
         self.texture = (self.texture+1)%2
         return
         return
-    
+
     def toggleTextureFromMainW(self):
     def toggleTextureFromMainW(self):
         #################################################################
         #################################################################
         # toggleTextureFromMainW(self)
         # toggleTextureFromMainW(self)
@@ -373,7 +373,7 @@ class sideWindow(AppShell):
         self.texture = (self.texture+1)%2
         self.texture = (self.texture+1)%2
         self.textureButton.toggle()
         self.textureButton.toggle()
         return
         return
-    
+
     def toggleWireframe(self):
     def toggleWireframe(self):
         #################################################################
         #################################################################
         # toggleWireframe(self)
         # toggleWireframe(self)
@@ -428,7 +428,7 @@ class sideWindow(AppShell):
         self.widgetVis = (self.widgetVis+1)%2
         self.widgetVis = (self.widgetVis+1)%2
         self.widgetVisButton.toggle()
         self.widgetVisButton.toggle()
         return
         return
-        
+
     def setBackgroundColorVec(self,color):
     def setBackgroundColorVec(self,color):
         #################################################################
         #################################################################
         # setBackgroundColorVec(self,color)
         # setBackgroundColorVec(self,color)

+ 22 - 22
contrib/src/sceneeditor/collisionWindow.py

@@ -32,12 +32,12 @@ class collisionWindow(AppShell):
                      'collisionSphere',
                      'collisionSphere',
                      'collisionSegment',
                      'collisionSegment',
                      'collisionRay']
                      'collisionRay']
-    
+
     def __init__(self, nodePath, parent = None, **kw):
     def __init__(self, nodePath, parent = None, **kw):
-        
+
         self.nodePath = nodePath
         self.nodePath = nodePath
         self.objType = 'collisionSphere' # set default type to Collision Sphere
         self.objType = 'collisionSphere' # set default type to Collision Sphere
-        
+
         INITOPT = Pmw.INITOPT
         INITOPT = Pmw.INITOPT
         optiondefs = (
         optiondefs = (
             ('title',               self.appname,       None),
             ('title',               self.appname,       None),
@@ -77,7 +77,7 @@ class collisionWindow(AppShell):
 
 
         frame.pack(side=TOP, fill=X, expand=True, padx=3)
         frame.pack(side=TOP, fill=X, expand=True, padx=3)
         self.collisionTypeEntry.selectitem('collisionSphere', setentry=True)
         self.collisionTypeEntry.selectitem('collisionSphere', setentry=True)
-        
+
         self.inputZone = Pmw.Group(mainFrame, tag_pyclass = None)
         self.inputZone = Pmw.Group(mainFrame, tag_pyclass = None)
         self.inputZone.pack(fill='both',expand=1)
         self.inputZone.pack(fill='both',expand=1)
         settingFrame = self.inputZone.interior()
         settingFrame = self.inputZone.interior()
@@ -101,7 +101,7 @@ class collisionWindow(AppShell):
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         Interior.pack(side=TOP, expand=0,fill=X)
         Interior.pack(side=TOP, expand=0,fill=X)
-        
+
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point A')
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point A')
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point B')
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point B')
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point C')
         self.createPosEntry(PolygonPage, catagory='Polygon', id='Point C')
@@ -112,7 +112,7 @@ class collisionWindow(AppShell):
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         Interior.pack(side=TOP, expand=0,fill=X)
         Interior.pack(side=TOP, expand=0,fill=X)
-        
+
         self.createPosEntry(SpherePage, catagory='Sphere', id='Center Point')
         self.createPosEntry(SpherePage, catagory='Sphere', id='Center Point')
 
 
         self.createEntryField(SpherePage,catagory='Sphere', id='Size',
         self.createEntryField(SpherePage,catagory='Sphere', id='Size',
@@ -127,7 +127,7 @@ class collisionWindow(AppShell):
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         Interior.pack(side=TOP, expand=0,fill=X)
         Interior.pack(side=TOP, expand=0,fill=X)
-        
+
         self.createPosEntry(SegmentPage, catagory='Segment', id='Point A')
         self.createPosEntry(SegmentPage, catagory='Segment', id='Point A')
         self.createPosEntry(SegmentPage, catagory='Segment', id='Point B')
         self.createPosEntry(SegmentPage, catagory='Segment', id='Point B')
 
 
@@ -137,12 +137,12 @@ class collisionWindow(AppShell):
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label = Label(Interior, text='Attention! All Coordinates Are Related To Its Parent Node!')
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         label.pack(side=LEFT,expand=0,fill=X, padx=1)
         Interior.pack(side=TOP, expand=0,fill=X)
         Interior.pack(side=TOP, expand=0,fill=X)
-        
+
         self.createPosEntry(RayPage, catagory='Ray', id='Origin')
         self.createPosEntry(RayPage, catagory='Ray', id='Origin')
         self.createPosEntry(RayPage, catagory='Ray', id='Direction')
         self.createPosEntry(RayPage, catagory='Ray', id='Direction')
 
 
 
 
-           
+
         self.objNotebook.setnaturalsize()
         self.objNotebook.setnaturalsize()
         self.objNotebook.pack(expand = 1, fill = BOTH)
         self.objNotebook.pack(expand = 1, fill = BOTH)
 
 
@@ -175,7 +175,7 @@ class collisionWindow(AppShell):
             self.objNotebook.selectpage('Segment')
             self.objNotebook.selectpage('Segment')
         elif self.objType=='collisionRay':
         elif self.objType=='collisionRay':
             self.objNotebook.selectpage('Ray')
             self.objNotebook.selectpage('Ray')
-            
+
         return
         return
 
 
     def updateObjInfo(self, page=None):
     def updateObjInfo(self, page=None):
@@ -207,13 +207,13 @@ class collisionWindow(AppShell):
                              float(self.widgetDict['PolygonPoint C'][1]._entry.get()),
                              float(self.widgetDict['PolygonPoint C'][1]._entry.get()),
                              float(self.widgetDict['PolygonPoint C'][2]._entry.get()))
                              float(self.widgetDict['PolygonPoint C'][2]._entry.get()))
             collisionObject = CollisionPolygon(pointA, pointB, pointC)
             collisionObject = CollisionPolygon(pointA, pointB, pointC)
-            
+
         elif self.objType=='collisionSphere':
         elif self.objType=='collisionSphere':
             collisionObject = CollisionSphere(float(self.widgetDict['SphereCenter Point'][0]._entry.get()),
             collisionObject = CollisionSphere(float(self.widgetDict['SphereCenter Point'][0]._entry.get()),
                                               float(self.widgetDict['SphereCenter Point'][1]._entry.get()),
                                               float(self.widgetDict['SphereCenter Point'][1]._entry.get()),
                                               float(self.widgetDict['SphereCenter Point'][2]._entry.get()),
                                               float(self.widgetDict['SphereCenter Point'][2]._entry.get()),
                                               float(self.widgetDict['SphereSize'].getvalue()))
                                               float(self.widgetDict['SphereSize'].getvalue()))
-        
+
         elif self.objType=='collisionSegment':
         elif self.objType=='collisionSegment':
             pointA =  Point3(float(self.widgetDict['SegmentPoint A'][0]._entry.get()),
             pointA =  Point3(float(self.widgetDict['SegmentPoint A'][0]._entry.get()),
                              float(self.widgetDict['SegmentPoint A'][1]._entry.get()),
                              float(self.widgetDict['SegmentPoint A'][1]._entry.get()),
@@ -221,35 +221,35 @@ class collisionWindow(AppShell):
             pointB =  Point3(float(self.widgetDict['SegmentPoint B'][0]._entry.get()),
             pointB =  Point3(float(self.widgetDict['SegmentPoint B'][0]._entry.get()),
                              float(self.widgetDict['SegmentPoint B'][1]._entry.get()),
                              float(self.widgetDict['SegmentPoint B'][1]._entry.get()),
                              float(self.widgetDict['SegmentPoint B'][2]._entry.get()))
                              float(self.widgetDict['SegmentPoint B'][2]._entry.get()))
-            
+
             collisionObject = CollisionSegment()
             collisionObject = CollisionSegment()
             collisionObject.setPointA(pointA)
             collisionObject.setPointA(pointA)
             collisionObject.setFromLens(base.cam.node(), Point2( -1, 1 ))  ## You must set up the camera lensNode before you set point B....
             collisionObject.setFromLens(base.cam.node(), Point2( -1, 1 ))  ## You must set up the camera lensNode before you set point B....
             collisionObject.setPointB(pointB)
             collisionObject.setPointB(pointB)
-        
+
         elif self.objType=='collisionRay':
         elif self.objType=='collisionRay':
             point =  Point3(float(self.widgetDict['RayOrigin'][0]._entry.get()),
             point =  Point3(float(self.widgetDict['RayOrigin'][0]._entry.get()),
                             float(self.widgetDict['RayOrigin'][1]._entry.get()),
                             float(self.widgetDict['RayOrigin'][1]._entry.get()),
                             float(self.widgetDict['RayOrigin'][2]._entry.get()))
                             float(self.widgetDict['RayOrigin'][2]._entry.get()))
-            
+
             vector =  Vec3(float(self.widgetDict['RayDirection'][0]._entry.get()),
             vector =  Vec3(float(self.widgetDict['RayDirection'][0]._entry.get()),
                            float(self.widgetDict['RayDirection'][1]._entry.get()),
                            float(self.widgetDict['RayDirection'][1]._entry.get()),
                            float(self.widgetDict['RayDirection'][2]._entry.get()))
                            float(self.widgetDict['RayDirection'][2]._entry.get()))
 
 
             print vector, point
             print vector, point
-            
+
             collisionObject = CollisionRay()
             collisionObject = CollisionRay()
             collisionObject.setOrigin(point)
             collisionObject.setOrigin(point)
             collisionObject.setDirection(vector)
             collisionObject.setDirection(vector)
             #collisionObject.setFromLens(base.cam.node(), Point2( -1, 1 ))  ## You must set up the camera lensNode before you set up others...
             #collisionObject.setFromLens(base.cam.node(), Point2( -1, 1 ))  ## You must set up the camera lensNode before you set up others...
-            
+
         if self.objType=='collisionPolygon':
         if self.objType=='collisionPolygon':
             messenger.send('CW_addCollisionObj', [collisionObject, self.nodePath, pointA, pointB, pointC])
             messenger.send('CW_addCollisionObj', [collisionObject, self.nodePath, pointA, pointB, pointC])
         else:
         else:
             messenger.send('CW_addCollisionObj', [collisionObject, self.nodePath])
             messenger.send('CW_addCollisionObj', [collisionObject, self.nodePath])
 
 
         self.quit()
         self.quit()
-        
+
         return
         return
 
 
     def createPosEntry(self, contentFrame, catagory, id):
     def createPosEntry(self, contentFrame, catagory, id):
@@ -261,16 +261,16 @@ class collisionWindow(AppShell):
                                          text = 'X', relief = FLAT,
                                          text = 'X', relief = FLAT,
                                          value = 0.0,
                                          value = 0.0,
                                          entry_width = 6)
                                          entry_width = 6)
-        
+
         self.posX.pack(side=LEFT,expand=0,fill=X, padx=1)
         self.posX.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
         self.posY = self.createcomponent('posY'+catagory+id, (), None,
         self.posY = self.createcomponent('posY'+catagory+id, (), None,
                                          Floater.Floater, (posInterior,),
                                          Floater.Floater, (posInterior,),
                                          text = 'Y', relief = FLAT,
                                          text = 'Y', relief = FLAT,
                                          value = 0.0,
                                          value = 0.0,
                                          entry_width = 6)
                                          entry_width = 6)
         self.posY.pack(side=LEFT, expand=0,fill=X, padx=1)
         self.posY.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
         self.posZ = self.createcomponent('posZ'+catagory+id, (), None,
         self.posZ = self.createcomponent('posZ'+catagory+id, (), None,
                                          Floater.Floater, (posInterior,),
                                          Floater.Floater, (posInterior,),
                                          text = 'Z', relief = FLAT,
                                          text = 'Z', relief = FLAT,
@@ -298,5 +298,5 @@ class collisionWindow(AppShell):
             widget = Button(frame, text=buttonText, font=('MSSansSerif', 10), command = defaultFunction)
             widget = Button(frame, text=buttonText, font=('MSSansSerif', 10), command = defaultFunction)
             widget.pack(side=LEFT, padx=3)
             widget.pack(side=LEFT, padx=3)
             self.widgetDict[catagory+id+'-'+'DefaultButton']=widget
             self.widgetDict[catagory+id+'-'+'DefaultButton']=widget
-            
+
         frame.pack(side = side, fill = fill, expand = expand,pady=3)
         frame.pack(side = side, fill = fill, expand = expand,pady=3)

+ 13 - 13
contrib/src/sceneeditor/controllerWindow.py

@@ -16,7 +16,7 @@ class controllerWindow(AppShell):
     # This will open a talk window for user to set the control mechanism
     # This will open a talk window for user to set the control mechanism
     # In here, user can choose to control what object by keyboard or other inputs.
     # In here, user can choose to control what object by keyboard or other inputs.
     #################################################################
     #################################################################
-    
+
     # Override class variables
     # Override class variables
     appname = 'Controller Panel'
     appname = 'Controller Panel'
     frameWidth  = 500
     frameWidth  = 500
@@ -27,11 +27,11 @@ class controllerWindow(AppShell):
     # setup the type of controller we handle here.
     # setup the type of controller we handle here.
     controllerList = ['Keyboard',
     controllerList = ['Keyboard',
                       'Tracker']
                       'Tracker']
-    
+
     # Default Keyboard setting
     # Default Keyboard setting
     keyboardMapDict = {}
     keyboardMapDict = {}
     keyboardSpeedDict = {}
     keyboardSpeedDict = {}
-    
+
     def __init__(self, listOfObj, controlType , dataList, parent = None, **kw):
     def __init__(self, listOfObj, controlType , dataList, parent = None, **kw):
         if controlType == 'Keyboard':
         if controlType == 'Keyboard':
             self.nodePath = dataList[0] # Default setting -> mainly used for Keyboard control now.
             self.nodePath = dataList[0] # Default setting -> mainly used for Keyboard control now.
@@ -41,10 +41,10 @@ class controllerWindow(AppShell):
             self.keyboardMapDict = dataList[1]
             self.keyboardMapDict = dataList[1]
             self.keyboardSpeedDict.clear()
             self.keyboardSpeedDict.clear()
             self.keyboardSpeedDict = dataList[2]
             self.keyboardSpeedDict = dataList[2]
-            
+
         self.listOfObj = listOfObj
         self.listOfObj = listOfObj
         self.keepControl = False
         self.keepControl = False
-        
+
         INITOPT = Pmw.INITOPT
         INITOPT = Pmw.INITOPT
         optiondefs = (
         optiondefs = (
             ('title',               self.appname,       None),
             ('title',               self.appname,       None),
@@ -63,9 +63,9 @@ class controllerWindow(AppShell):
         # Handle to the toplevels interior
         # Handle to the toplevels interior
         interior = self.interior()
         interior = self.interior()
         menuBar = self.menuBar
         menuBar = self.menuBar
-        
+
         # We don't need menu bar here
         # We don't need menu bar here
-        self.menuBar.destroy() 
+        self.menuBar.destroy()
 
 
         # Create a frame to hold all stuff
         # Create a frame to hold all stuff
         mainFrame = Frame(interior)
         mainFrame = Frame(interior)
@@ -81,7 +81,7 @@ class controllerWindow(AppShell):
         self.cotrollerTypeEntry.pack(side=Tkinter.LEFT)
         self.cotrollerTypeEntry.pack(side=Tkinter.LEFT)
         frame.pack(side=Tkinter.TOP, fill=Tkinter.X, expand=False, pady = 3)
         frame.pack(side=Tkinter.TOP, fill=Tkinter.X, expand=False, pady = 3)
         self.cotrollerTypeEntry.selectitem('Keyboard', setentry=True)
         self.cotrollerTypeEntry.selectitem('Keyboard', setentry=True)
-        
+
         self.inputZone = Pmw.Group(mainFrame, tag_pyclass = None)
         self.inputZone = Pmw.Group(mainFrame, tag_pyclass = None)
         self.inputZone.pack(fill='both',expand=1)
         self.inputZone.pack(fill='both',expand=1)
         settingFrame = self.inputZone.interior()
         settingFrame = self.inputZone.interior()
@@ -124,11 +124,11 @@ class controllerWindow(AppShell):
         inputZone = Pmw.Group(assignFrame, tag_pyclass = None)
         inputZone = Pmw.Group(assignFrame, tag_pyclass = None)
         inputZone.pack(fill='both',expand=1)
         inputZone.pack(fill='both',expand=1)
         settingFrame = inputZone.interior()
         settingFrame = inputZone.interior()
-        
+
         Interior = Frame(settingFrame)
         Interior = Frame(settingFrame)
         widget = Label(Interior, text = 'Assign a Key For:').pack(side=Tkinter.LEFT, expand = False)
         widget = Label(Interior, text = 'Assign a Key For:').pack(side=Tkinter.LEFT, expand = False)
         Interior.pack(side=Tkinter.TOP, fill=Tkinter.X, expand=True,pady = 6 )
         Interior.pack(side=Tkinter.TOP, fill=Tkinter.X, expand=True,pady = 6 )
-        
+
         Interior = Frame(settingFrame)
         Interior = Frame(settingFrame)
         widget = Label(Interior, text = 'Forward   :', width = 20, anchor = Tkinter.W).pack(side=Tkinter.LEFT, expand = False)
         widget = Label(Interior, text = 'Forward   :', width = 20, anchor = Tkinter.W).pack(side=Tkinter.LEFT, expand = False)
         widget = self.createcomponent(
         widget = self.createcomponent(
@@ -531,7 +531,7 @@ class controllerWindow(AppShell):
 
 
         assignFrame.pack(side=Tkinter.TOP, expand=True, fill = Tkinter.X)
         assignFrame.pack(side=Tkinter.TOP, expand=True, fill = Tkinter.X)
         keyboardPage.pack(side=Tkinter.TOP, expand=True, fill = Tkinter.X)
         keyboardPage.pack(side=Tkinter.TOP, expand=True, fill = Tkinter.X)
-        
+
         ####################################################################
         ####################################################################
         ####################################################################
         ####################################################################
         # End of Keyboard control page
         # End of Keyboard control page
@@ -613,7 +613,7 @@ class controllerWindow(AppShell):
             self.objNotebook.selectpage('Keyboard')
             self.objNotebook.selectpage('Keyboard')
         elif self.controllType=='Tracker':
         elif self.controllType=='Tracker':
             self.objNotebook.selectpage('Tracker')
             self.objNotebook.selectpage('Tracker')
-            
+
         return
         return
 
 
     def updateControlInfo(self, page=None):
     def updateControlInfo(self, page=None):
@@ -692,4 +692,4 @@ class controllerWindow(AppShell):
             messenger.send('ControlW_saveSetting', ['Keyboard', [self.nodePath, self.keyboardMapDict, self.keyboardSpeedDict]])
             messenger.send('ControlW_saveSetting', ['Keyboard', [self.nodePath, self.keyboardMapDict, self.keyboardSpeedDict]])
         return
         return
 
 
-    
+

+ 30 - 30
contrib/src/sceneeditor/dataHolder.py

@@ -117,10 +117,10 @@ class dataHolder:
         # Initialize the basic message formate from CollisionHandler
         # Initialize the basic message formate from CollisionHandler
         self.CollisionHandler.setInPattern("%fnenter%in")
         self.CollisionHandler.setInPattern("%fnenter%in")
         self.CollisionHandler.setOutPattern("%fnexit%in")
         self.CollisionHandler.setOutPattern("%fnexit%in")
- 
+
         pass
         pass
 
 
-    
+
     def resetAll(self):
     def resetAll(self):
         #################################################################
         #################################################################
         # resetAll(self)
         # resetAll(self)
@@ -149,7 +149,7 @@ class dataHolder:
         self.blendAnimDict.clear()
         self.blendAnimDict.clear()
         self.particleDict.clear()
         self.particleDict.clear()
         self.particleNodes.clear()
         self.particleNodes.clear()
-        
+
         self.ModelNum=0
         self.ModelNum=0
         self.ActorNum=0
         self.ActorNum=0
         self.theScene=None
         self.theScene=None
@@ -167,8 +167,8 @@ class dataHolder:
 
 
         ## Check if there is any child node, if so, remove it.
         ## Check if there is any child node, if so, remove it.
         childrenList = nodePath.getChildren()
         childrenList = nodePath.getChildren()
-        
-                
+
+
         if self.ModelDic.has_key(name):
         if self.ModelDic.has_key(name):
             del self.ModelDic[name]
             del self.ModelDic[name]
             del self.ModelRefDic[name]
             del self.ModelRefDic[name]
@@ -214,7 +214,7 @@ class dataHolder:
         else:
         else:
             print 'You cannot remove this NodePath'
             print 'You cannot remove this NodePath'
             return
             return
-        
+
         messenger.send('SGE_Update Explorer',[render])
         messenger.send('SGE_Update Explorer',[render])
         return
         return
 
 
@@ -247,11 +247,11 @@ class dataHolder:
         else:
         else:
             print '---- DataHolder: Target Obj is not a legal object could be duplicate!'
             print '---- DataHolder: Target Obj is not a legal object could be duplicate!'
             return
             return
-            
+
         FilePath = holderRef[name]
         FilePath = holderRef[name]
         oPos = holder[name].getPos()+cPos
         oPos = holder[name].getPos()+cPos
         oHpr = holder[name].getHpr()+cHpr
         oHpr = holder[name].getHpr()+cHpr
-        
+
         for i in range(num):
         for i in range(num):
             if isModel:
             if isModel:
                 ### copy model node from modelpool
                 ### copy model node from modelpool
@@ -268,7 +268,7 @@ class dataHolder:
                 holder[newName].setName(newName)
                 holder[newName].setName(newName)
                 oPos = oPos + cPos
                 oPos = oPos + cPos
                 oHpr = oHpr + cHpr
                 oHpr = oHpr + cHpr
-                
+
             else:
             else:
                 ### copy the actor- not includ its animations
                 ### copy the actor- not includ its animations
                 '''
                 '''
@@ -289,7 +289,7 @@ class dataHolder:
                 holder[newName].setName(newName)
                 holder[newName].setName(newName)
                 oPos = oPos + cPos
                 oPos = oPos + cPos
                 oHpr = oHpr + cHpr
                 oHpr = oHpr + cHpr
-            
+
         messenger.send('SGE_Update Explorer',[render])
         messenger.send('SGE_Update Explorer',[render])
         return
         return
 
 
@@ -434,7 +434,7 @@ class dataHolder:
         ###########################################################################
         ###########################################################################
         self.lightManager.toggle()
         self.lightManager.toggle()
         return
         return
-        
+
     def isLight(self,name):
     def isLight(self,name):
         ###########################################################################
         ###########################################################################
         # isLight(self, name)
         # isLight(self, name)
@@ -519,10 +519,10 @@ class dataHolder:
         if oName == nName:
         if oName == nName:
             # If the new name is the same with old name, do nothing.
             # If the new name is the same with old name, do nothing.
             return
             return
-        
+
         while self.isInScene(nName):
         while self.isInScene(nName):
             nName = nName + '_1'
             nName = nName + '_1'
-       
+
         if self.isActor(oName):
         if self.isActor(oName):
             self.ActorDic[nName]= self.ActorDic[oName]
             self.ActorDic[nName]= self.ActorDic[oName]
             self.ActorRefDic[nName]= self.ActorRefDic[oName]
             self.ActorRefDic[nName]= self.ActorRefDic[oName]
@@ -548,7 +548,7 @@ class dataHolder:
             self.collisionDict[nName]= self.collisionDict[oName]
             self.collisionDict[nName]= self.collisionDict[oName]
             self.collisionDict[nName].setName(nName)
             self.collisionDict[nName].setName(nName)
             del self.collisionDict[oName]
             del self.collisionDict[oName]
-            
+
         elif self.particleNodes.has_key(oName):
         elif self.particleNodes.has_key(oName):
             self.particleNodes[nName]= self.particleNodes[oName]
             self.particleNodes[nName]= self.particleNodes[oName]
             self.particleDict[nName]= self.particleDict[oName]
             self.particleDict[nName]= self.particleDict[oName]
@@ -588,7 +588,7 @@ class dataHolder:
             return True
             return True
 
 
         return False
         return False
-        
+
     def bindCurveToNode(self,node,curveCollection):
     def bindCurveToNode(self,node,curveCollection):
         ###########################################################################
         ###########################################################################
         # bindCurveToNode(self,node,curveCollection)
         # bindCurveToNode(self,node,curveCollection)
@@ -664,7 +664,7 @@ class dataHolder:
             info['vFov'] = lens.getVfov()
             info['vFov'] = lens.getVfov()
             info['focalLength'] = lens.getFocalLength()
             info['focalLength'] = lens.getFocalLength()
 
 
-            
+
         elif name == 'SEditor':
         elif name == 'SEditor':
             type = 'Special'
             type = 'Special'
         elif self.isActor(name):
         elif self.isActor(name):
@@ -684,7 +684,7 @@ class dataHolder:
             info['collisionNode'] = self.collisionDict[name]
             info['collisionNode'] = self.collisionDict[name]
         if self.curveDict.has_key(name):
         if self.curveDict.has_key(name):
             info['curveList'] = self.getCurveList(nodePath)
             info['curveList'] = self.getCurveList(nodePath)
-        
+
         return type, info
         return type, info
 
 
     def getAnimationDictFromActor(self, actorName):
     def getAnimationDictFromActor(self, actorName):
@@ -754,7 +754,7 @@ class dataHolder:
         base.cTrav.addCollider( self.collisionDict[name], self.CollisionHandler)
         base.cTrav.addCollider( self.collisionDict[name], self.CollisionHandler)
 
 
         messenger.send('SGE_Update Explorer',[render])
         messenger.send('SGE_Update Explorer',[render])
-        
+
         return
         return
 
 
     def toggleCollisionVisable(self, visable):
     def toggleCollisionVisable(self, visable):
@@ -888,7 +888,7 @@ class dataHolder:
             return self.particleNodes[name]
             return self.particleNodes[name]
         elif self.lightManager.isLight(name):
         elif self.lightManager.isLight(name):
             return self.lightManager.getLightNode(name)
             return self.lightManager.getLightNode(name)
-        
+
         return None
         return None
 
 
     def getControlSetting(self):
     def getControlSetting(self):
@@ -923,7 +923,7 @@ class dataHolder:
             self.keyboardSpeedDict.clear()
             self.keyboardSpeedDict.clear()
             self.keyboardSpeedDict = data[2].copy()
             self.keyboardSpeedDict = data[2].copy()
             return
             return
-  
+
     def loadScene(self):
     def loadScene(self):
         ###########################################################################
         ###########################################################################
         # loadScene(self)
         # loadScene(self)
@@ -934,9 +934,9 @@ class dataHolder:
         # in the scene file hence reviving the state for the scene
         # in the scene file hence reviving the state for the scene
         ###########################################################################
         ###########################################################################
 
 
-        ### Ask for a filename  
+        ### Ask for a filename
         OpenFilename = tkFileDialog.askopenfilename(filetypes = [("PY","py")],title = "Load Scene")
         OpenFilename = tkFileDialog.askopenfilename(filetypes = [("PY","py")],title = "Load Scene")
-        if(not OpenFilename):   
+        if(not OpenFilename):
             return None
             return None
         f=Filename.fromOsSpecific(OpenFilename)
         f=Filename.fromOsSpecific(OpenFilename)
         fileName=f.getBasenameWoExtension()
         fileName=f.getBasenameWoExtension()
@@ -953,7 +953,7 @@ class dataHolder:
         ############################################################################
         ############################################################################
         self.theScene=__import__(fileName)
         self.theScene=__import__(fileName)
         self.Scene=self.theScene.SavedScene(0,seParticleEffect,seParticles,dirName) # Specify load mode of 0 which will allow us to pass seParticle and seParticleEffect
         self.Scene=self.theScene.SavedScene(0,seParticleEffect,seParticles,dirName) # Specify load mode of 0 which will allow us to pass seParticle and seParticleEffect
-        messenger.send('SGE_Update Explorer',[render])    
+        messenger.send('SGE_Update Explorer',[render])
 
 
 
 
         # Lets call some important initialization methods on our scene:
         # Lets call some important initialization methods on our scene:
@@ -989,7 +989,7 @@ class dataHolder:
         for light in self.Scene.LightDict:
         for light in self.Scene.LightDict:
             #print light
             #print light
             alight=self.Scene.LightDict[light]
             alight=self.Scene.LightDict[light]
-            type=self.Scene.LightTypes[light]   
+            type=self.Scene.LightTypes[light]
             thenode=self.Scene.LightNodes[light]
             thenode=self.Scene.LightNodes[light]
             #print type
             #print type
             if type == 'ambient':
             if type == 'ambient':
@@ -1032,7 +1032,7 @@ class dataHolder:
                 nodeP.removeNode()
                 nodeP.removeNode()
                 thenode=render.find("**/"+str(node))
                 thenode=render.find("**/"+str(node))
                 self.bindCurveToNode(thenode,curveColl)
                 self.bindCurveToNode(thenode,curveColl)
-        
+
         ############################################################################
         ############################################################################
         # Populate Particle related Dictionaries
         # Populate Particle related Dictionaries
         ############################################################################
         ############################################################################
@@ -1049,9 +1049,9 @@ class dataHolder:
             theeffect.enable()
             theeffect.enable()
             self.particleDict[effect]=theeffect
             self.particleDict[effect]=theeffect
             self.particleNodes[effect]=emitter
             self.particleNodes[effect]=emitter
-            
-        
- 
+
+
+
         # Clean up things added to scene graph by saved file's code execution
         # Clean up things added to scene graph by saved file's code execution
         for light in self.Scene.LightDict:
         for light in self.Scene.LightDict:
             vestige=render.find('**/'+light)
             vestige=render.find('**/'+light)
@@ -1061,11 +1061,11 @@ class dataHolder:
         ############################################################################
         ############################################################################
         # return the filename and update the scenegraph explorer window
         # return the filename and update the scenegraph explorer window
         ############################################################################
         ############################################################################
-        messenger.send('SGE_Update Explorer',[render])  
+        messenger.send('SGE_Update Explorer',[render])
         if(OpenFilename):
         if(OpenFilename):
             return OpenFilename
             return OpenFilename
         else:
         else:
             return None
             return None
 
 
     def getList(self):
     def getList(self):
-        return self.lightManager.getList()     
+        return self.lightManager.getList()

+ 8 - 8
contrib/src/sceneeditor/duplicateWindow.py

@@ -27,7 +27,7 @@ class duplicateWindow(AppShell):
     padx            = 0
     padx            = 0
     pady            = 0
     pady            = 0
 
 
-    
+
     def __init__(self, parent = None, nodePath = None, **kw):
     def __init__(self, parent = None, nodePath = None, **kw):
         # Define the megawidget options.
         # Define the megawidget options.
         optiondefs = (
         optiondefs = (
@@ -43,10 +43,10 @@ class duplicateWindow(AppShell):
         self.nodePath = nodePath
         self.nodePath = nodePath
 
 
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
-        
+
     def appInit(self):
     def appInit(self):
         print '----SideWindow is Initialized!!'
         print '----SideWindow is Initialized!!'
-        
+
     def createInterface(self):
     def createInterface(self):
         # The interior of the toplevel panel
         # The interior of the toplevel panel
         interior = self.interior()
         interior = self.interior()
@@ -90,18 +90,18 @@ class duplicateWindow(AppShell):
         self.numberOfCopy = Pmw.EntryField(settingFrame,label_text='Number of Copy :',labelpos='w',value='1', validate=Pmw.integervalidator)
         self.numberOfCopy = Pmw.EntryField(settingFrame,label_text='Number of Copy :',labelpos='w',value='1', validate=Pmw.integervalidator)
         self.numberOfCopy.component('entry').config(width=15)
         self.numberOfCopy.component('entry').config(width=15)
         self.numberOfCopy.place(anchor=NW,x=52,y=150)
         self.numberOfCopy.place(anchor=NW,x=52,y=150)
-        
+
         settingFrame.pack(fill=BOTH,expand=1,padx=7,pady=7)
         settingFrame.pack(fill=BOTH,expand=1,padx=7,pady=7)
 
 
         self.button_ok = Button(mainFrame, text="OK", command=self.ok_press,width=10)
         self.button_ok = Button(mainFrame, text="OK", command=self.ok_press,width=10)
         self.button_ok.pack(fill=BOTH,expand=0,side=RIGHT)
         self.button_ok.pack(fill=BOTH,expand=0,side=RIGHT)
-        
+
         mainFrame.pack(fill = 'both', expand = 1,padx=7,pady=7)
         mainFrame.pack(fill = 'both', expand = 1,padx=7,pady=7)
 
 
-    
+
     def createMenuBar(self):
     def createMenuBar(self):
         self.menuBar.destroy()
         self.menuBar.destroy()
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         messenger.send('DW_close')
         messenger.send('DW_close')
         '''
         '''
@@ -110,7 +110,7 @@ class duplicateWindow(AppShell):
         pass
         pass
 
 
     ###############################
     ###############################
-    
+
     def ok_press(self):
     def ok_press(self):
         #################################################################
         #################################################################
         # ok_press(self)
         # ok_press(self)

+ 19 - 19
contrib/src/sceneeditor/lightingPanel.py

@@ -22,7 +22,7 @@ class lightingPanel(AppShell):
     frameWidth  = 400
     frameWidth  = 400
     frameHeight = 400
     frameHeight = 400
     currentLight = None
     currentLight = None
-    
+
     def __init__(self, lightList, parent = None, **kw):
     def __init__(self, lightList, parent = None, **kw):
         self.lightList = lightList
         self.lightList = lightList
         self.lightColor = [0.3*255,0.3*255,0.3*255]
         self.lightColor = [0.3*255,0.3*255,0.3*255]
@@ -53,14 +53,14 @@ class lightingPanel(AppShell):
         self.listZone = Pmw.Group(mainFrame,tag_pyclass = None)
         self.listZone = Pmw.Group(mainFrame,tag_pyclass = None)
         self.listZone.pack(expand=0, fill=Tkinter.X,padx=3,pady=3)
         self.listZone.pack(expand=0, fill=Tkinter.X,padx=3,pady=3)
         listFrame = self.listZone.interior()
         listFrame = self.listZone.interior()
-        
+
         self.lightEntry = self.createcomponent(
         self.lightEntry = self.createcomponent(
             'Lights List', (), None,
             'Lights List', (), None,
             Pmw.ComboBox, (listFrame,),label_text='Light :',
             Pmw.ComboBox, (listFrame,),label_text='Light :',
             labelpos = Tkinter.W, entry_width = 25, selectioncommand = self.selectLight,
             labelpos = Tkinter.W, entry_width = 25, selectioncommand = self.selectLight,
             scrolledlist_items = self.lightList)
             scrolledlist_items = self.lightList)
         self.lightEntry.pack(side=Tkinter.LEFT)
         self.lightEntry.pack(side=Tkinter.LEFT)
-        
+
         self.renameButton = self.createcomponent(
         self.renameButton = self.createcomponent(
             'Rename Light', (), None,
             'Rename Light', (), None,
             Button, (listFrame,),
             Button, (listFrame,),
@@ -82,7 +82,7 @@ class lightingPanel(AppShell):
                             command = self.addPoint)
                             command = self.addPoint)
         lightsMenu.add_command(label = 'Add Spotlight',
         lightsMenu.add_command(label = 'Add Spotlight',
                             command = self.addSpot)
                             command = self.addSpot)
-            
+
         self.lightsButton.pack(expand=0)
         self.lightsButton.pack(expand=0)
         self.lightsButton['menu'] = lightsMenu
         self.lightsButton['menu'] = lightsMenu
 
 
@@ -155,7 +155,7 @@ class lightingPanel(AppShell):
         self.pConstantAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.pConstantAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.pConstantAttenuation,
         self.bind(self.pConstantAttenuation,
                   'Set point light constant attenuation')
                   'Set point light constant attenuation')
-           
+
         self.pLinearAttenuation = Slider(
         self.pLinearAttenuation = Slider(
             pointPage,
             pointPage,
             text = 'Linear Attenuation',
             text = 'Linear Attenuation',
@@ -166,7 +166,7 @@ class lightingPanel(AppShell):
         self.pLinearAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.pLinearAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.pLinearAttenuation,
         self.bind(self.pLinearAttenuation,
                   'Set point light linear attenuation')
                   'Set point light linear attenuation')
-           
+
         self.pQuadraticAttenuation = Slider(
         self.pQuadraticAttenuation = Slider(
             pointPage,
             pointPage,
             text = 'Quadratic Attenuation',
             text = 'Quadratic Attenuation',
@@ -177,7 +177,7 @@ class lightingPanel(AppShell):
         self.pQuadraticAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.pQuadraticAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.pQuadraticAttenuation,
         self.bind(self.pQuadraticAttenuation,
                   'Set point light quadratic attenuation')
                   'Set point light quadratic attenuation')
-           
+
         # Spot light controls
         # Spot light controls
         self.sSpecularColor = seColorEntry(
         self.sSpecularColor = seColorEntry(
             spotPage, text = 'Specular Color')
             spotPage, text = 'Specular Color')
@@ -196,7 +196,7 @@ class lightingPanel(AppShell):
         self.sConstantAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.sConstantAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.sConstantAttenuation,
         self.bind(self.sConstantAttenuation,
                   'Set spot light constant attenuation')
                   'Set spot light constant attenuation')
-           
+
         self.sLinearAttenuation = Slider(
         self.sLinearAttenuation = Slider(
             spotPage,
             spotPage,
             text = 'Linear Attenuation',
             text = 'Linear Attenuation',
@@ -207,7 +207,7 @@ class lightingPanel(AppShell):
         self.sLinearAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.sLinearAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.sLinearAttenuation,
         self.bind(self.sLinearAttenuation,
                   'Set spot light linear attenuation')
                   'Set spot light linear attenuation')
-           
+
         self.sQuadraticAttenuation = Slider(
         self.sQuadraticAttenuation = Slider(
             spotPage,
             spotPage,
             text = 'Quadratic Attenuation',
             text = 'Quadratic Attenuation',
@@ -218,7 +218,7 @@ class lightingPanel(AppShell):
         self.sQuadraticAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.sQuadraticAttenuation.pack(fill = Tkinter.X, expand = 0)
         self.bind(self.sQuadraticAttenuation,
         self.bind(self.sQuadraticAttenuation,
                   'Set spot light quadratic attenuation')
                   'Set spot light quadratic attenuation')
-           
+
         self.sExponent = Slider(
         self.sExponent = Slider(
             spotPage,
             spotPage,
             text = 'Exponent',
             text = 'Exponent',
@@ -231,7 +231,7 @@ class lightingPanel(AppShell):
                   'Set spot light exponent')
                   'Set spot light exponent')
 
 
         # MRM: Add frustum controls
         # MRM: Add frustum controls
-           
+
         self.lightNotebook.setnaturalsize()
         self.lightNotebook.setnaturalsize()
         self.lightNotebook.pack(expand = 1, fill = Tkinter.BOTH)
         self.lightNotebook.pack(expand = 1, fill = Tkinter.BOTH)
 
 
@@ -329,7 +329,7 @@ class lightingPanel(AppShell):
             self.lightColor.set([255*0.3,255*0.3,255*0.3])
             self.lightColor.set([255*0.3,255*0.3,255*0.3])
             oldType = self.type
             oldType = self.type
             self.type = 'ambient'
             self.type = 'ambient'
-            
+
         if self.type=='ambient':
         if self.type=='ambient':
             self.lightNotebook.selectpage('Ambient')
             self.lightNotebook.selectpage('Ambient')
         elif self.type =='directional':
         elif self.type =='directional':
@@ -384,7 +384,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         messenger.send('LP_addLight',['ambient'])
         messenger.send('LP_addLight',['ambient'])
         return
         return
-    
+
     def addDirectional(self):
     def addDirectional(self):
         #################################################################
         #################################################################
         # addDirectional(self)
         # addDirectional(self)
@@ -393,7 +393,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         messenger.send('LP_addLight',['directional'])
         messenger.send('LP_addLight',['directional'])
         return
         return
-    
+
     def addPoint(self):
     def addPoint(self):
         #################################################################
         #################################################################
         # addPoint(self)
         # addPoint(self)
@@ -402,7 +402,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         messenger.send('LP_addLight',['point'])
         messenger.send('LP_addLight',['point'])
         return
         return
-    
+
     def addSpot(self):
     def addSpot(self):
         #################################################################
         #################################################################
         # addSpot(self)
         # addSpot(self)
@@ -455,7 +455,7 @@ class lightingPanel(AppShell):
             return
             return
         self.currentLight.setOrientation(Vec3(orient[0],orient[1],orient[2]))
         self.currentLight.setOrientation(Vec3(orient[0],orient[1],orient[2]))
         return
         return
-    
+
     def setConstantAttenuation(self, value):
     def setConstantAttenuation(self, value):
         #################################################################
         #################################################################
         # setConstantAttenuation(self, value)
         # setConstantAttenuation(self, value)
@@ -464,7 +464,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         self.currentLight.setConstantAttenuation(value)
         self.currentLight.setConstantAttenuation(value)
         return
         return
-    
+
     def setLinearAttenuation(self, value):
     def setLinearAttenuation(self, value):
         #################################################################
         #################################################################
         # setLinearAttenuation(self, value)
         # setLinearAttenuation(self, value)
@@ -473,7 +473,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         self.currentLight.setLinearAttenuation(value)
         self.currentLight.setLinearAttenuation(value)
         return
         return
-    
+
     def setQuadraticAttenuation(self, value):
     def setQuadraticAttenuation(self, value):
         #################################################################
         #################################################################
         # setQuadraticAttenuation(self, value)
         # setQuadraticAttenuation(self, value)
@@ -482,7 +482,7 @@ class lightingPanel(AppShell):
         #################################################################
         #################################################################
         self.currentLight.setQuadraticAttenuation(value)
         self.currentLight.setQuadraticAttenuation(value)
         return
         return
-    
+
     def setExponent(self, value):
     def setExponent(self, value):
         #################################################################
         #################################################################
         # setExponent(self, value)
         # setExponent(self, value)

+ 74 - 74
contrib/src/sceneeditor/propertyWindow.py

@@ -31,17 +31,17 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
     usestatusarea   = 0
     usestatusarea   = 0
     widgetsDict = {}
     widgetsDict = {}
 
 
-    
+
     def __init__(self, target, type, info, parent = None, nodePath = render, **kw):
     def __init__(self, target, type, info, parent = None, nodePath = render, **kw):
         self.nodePath = target
         self.nodePath = target
         self.name = target.getName()
         self.name = target.getName()
         self.type = type
         self.type = type
         self.info = info
         self.info = info
-        
+
 
 
         # Initialise superclass
         # Initialise superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
-        
+
         # Define the megawidget options.
         # Define the megawidget options.
         optiondefs = (
         optiondefs = (
             ('title',       self.appname,       None),
             ('title',       self.appname,       None),
@@ -51,12 +51,12 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         if parent == None:
         if parent == None:
             self.parent = Toplevel()
             self.parent = Toplevel()
         AppShell.__init__(self, self.parent)
         AppShell.__init__(self, self.parent)
-        
+
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
-        
+
     def appInit(self):
     def appInit(self):
         return
         return
-        
+
     def createInterface(self):
     def createInterface(self):
         # The interior of the toplevel panel
         # The interior of the toplevel panel
         interior = self.interior()
         interior = self.interior()
@@ -110,15 +110,15 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         #### If nodePath has been binded with any curves
         #### If nodePath has been binded with any curves
         if self.info.has_key('curveList'):
         if self.info.has_key('curveList'):
             self.createCurveFrame(self.contentFrame)
             self.createCurveFrame(self.contentFrame)
-       
+
         ## Set all stuff done
         ## Set all stuff done
         mainFrame.pack(fill = 'both', expand = 1)
         mainFrame.pack(fill = 'both', expand = 1)
 
 
-    
+
     def createMenuBar(self):
     def createMenuBar(self):
         # we don't need menu bar here.
         # we don't need menu bar here.
         self.menuBar.destroy()
         self.menuBar.destroy()
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         self.ignore('forPorpertyWindow'+self.name)
         self.ignore('forPorpertyWindow'+self.name)
         messenger.send('PW_close', [self.name])
         messenger.send('PW_close', [self.name])
@@ -154,7 +154,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             widget = Button(frame, text=buttonText, font=('MSSansSerif', 10), command = defaultFunction)
             widget = Button(frame, text=buttonText, font=('MSSansSerif', 10), command = defaultFunction)
             widget.pack(side=LEFT, padx=3)
             widget.pack(side=LEFT, padx=3)
             self.widgetsDict[text+'-'+'DefaultButton']=widget
             self.widgetsDict[text+'-'+'DefaultButton']=widget
-            
+
         frame.pack(side = side, fill = fill, expand = expand,pady=3)
         frame.pack(side = side, fill = fill, expand = expand,pady=3)
 
 
 
 
@@ -175,7 +175,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.posX['commandData'] = ['x']
         self.posX['commandData'] = ['x']
         self.posX['command'] = self.setNodePathPosHprScale
         self.posX['command'] = self.setNodePathPosHprScale
         self.posX.pack(side=LEFT,expand=0,fill=X, padx=1)
         self.posX.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
         self.posY = self.createcomponent('posY', (), None,
         self.posY = self.createcomponent('posY', (), None,
                                          Floater.Floater, (posInterior,),
                                          Floater.Floater, (posInterior,),
                                          text = 'Y', relief = FLAT,
                                          text = 'Y', relief = FLAT,
@@ -185,7 +185,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.posY['commandData'] = ['y']
         self.posY['commandData'] = ['y']
         self.posY['command'] = self.setNodePathPosHprScale
         self.posY['command'] = self.setNodePathPosHprScale
         self.posY.pack(side=LEFT, expand=0,fill=X, padx=1)
         self.posY.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
         self.posZ = self.createcomponent('posZ', (), None,
         self.posZ = self.createcomponent('posZ', (), None,
                                          Floater.Floater, (posInterior,),
                                          Floater.Floater, (posInterior,),
                                          text = 'Z', relief = FLAT,
                                          text = 'Z', relief = FLAT,
@@ -215,7 +215,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.hprH['commandData'] = ['h']
         self.hprH['commandData'] = ['h']
         self.hprH['command'] = self.setNodePathPosHprScale
         self.hprH['command'] = self.setNodePathPosHprScale
         self.hprH.pack(side = LEFT, expand=0,fill=X)
         self.hprH.pack(side = LEFT, expand=0,fill=X)
-        
+
         self.hprP = self.createcomponent('hprP', (), None,
         self.hprP = self.createcomponent('hprP', (), None,
                                          Dial.AngleDial, (hprInterior,),
                                          Dial.AngleDial, (hprInterior,),
                                          style = 'mini',
                                          style = 'mini',
@@ -226,7 +226,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.hprP['commandData'] = ['p']
         self.hprP['commandData'] = ['p']
         self.hprP['command'] = self.setNodePathPosHprScale
         self.hprP['command'] = self.setNodePathPosHprScale
         self.hprP.pack(side = LEFT, expand=0,fill=X)
         self.hprP.pack(side = LEFT, expand=0,fill=X)
-        
+
         self.hprR = self.createcomponent('hprR', (), None,
         self.hprR = self.createcomponent('hprR', (), None,
                                          Dial.AngleDial, (hprInterior,),
                                          Dial.AngleDial, (hprInterior,),
                                          style = 'mini',
                                          style = 'mini',
@@ -249,7 +249,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         # And, it will set the call back function to setNodePathPosHprScale()
         # And, it will set the call back function to setNodePathPosHprScale()
         #################################################################
         #################################################################
         scaleInterior = Frame(contentFrame)
         scaleInterior = Frame(contentFrame)
-        
+
         self.scale = self.createcomponent('scale', (), None,
         self.scale = self.createcomponent('scale', (), None,
                                            Floater.Floater, (scaleInterior,),
                                            Floater.Floater, (scaleInterior,),
                                            text = 'Scale',
                                            text = 'Scale',
@@ -280,10 +280,10 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.nodeColor['command'] = self.setNodeColorVec
         self.nodeColor['command'] = self.setNodeColorVec
         self.nodeColor['resetValue'] = [255,255,255,255]
         self.nodeColor['resetValue'] = [255,255,255,255]
         self.nodeColor.place(anchor=NW,y=235)
         self.nodeColor.place(anchor=NW,y=235)
-        self.bind(self.nodeColor, 'Set nodePath color')        
+        self.bind(self.nodeColor, 'Set nodePath color')
         self.nodeColor.pack(side=TOP,expand=0,fill=X, padx=3, pady=3)
         self.nodeColor.pack(side=TOP,expand=0,fill=X, padx=3, pady=3)
         return
         return
-    
+
     def setNodeColorVec(self, color):
     def setNodeColorVec(self, color):
         #################################################################
         #################################################################
         # setNodeColorVec(self, color)
         # setNodeColorVec(self, color)
@@ -295,7 +295,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                                color[3]/255.0)
                                color[3]/255.0)
         return
         return
 
 
-    
+
     def setNodePathPosHprScale(self, data, axis):
     def setNodePathPosHprScale(self, data, axis):
         #################################################################
         #################################################################
         # setNodePathPosHprScale(self, data, axis)
         # setNodePathPosHprScale(self, data, axis)
@@ -345,9 +345,9 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                                       defaultFunction = lambda a = n, b = self : b.deleteCurve(a))
                                       defaultFunction = lambda a = n, b = self : b.deleteCurve(a))
             group.pack(side = TOP, fill = X, expand = 0,pady=3, padx=3)
             group.pack(side = TOP, fill = X, expand = 0,pady=3, padx=3)
             self.curveFrame.pack(side = TOP, fill = X, expand = 0,pady=3, padx=3)
             self.curveFrame.pack(side = TOP, fill = X, expand = 0,pady=3, padx=3)
-            
+
         return
         return
-    
+
     def deleteCurve(self, number = 0):
     def deleteCurve(self, number = 0):
         #################################################################
         #################################################################
         # deleteCurve(self, number = 0)
         # deleteCurve(self, number = 0)
@@ -374,7 +374,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             return
             return
         else:
         else:
             self.ignore('curveRemovedFromNode')
             self.ignore('curveRemovedFromNode')
-            
+
         if curveList!= None:
         if curveList!= None:
             del self.info['curveList']
             del self.info['curveList']
             self.info['curveList'] = curveList
             self.info['curveList'] = curveList
@@ -397,7 +397,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         # cameraInterface(self, interior, mainFrame)
         # cameraInterface(self, interior, mainFrame)
         # Create the interface for camera node.
         # Create the interface for camera node.
         #################################################################
         #################################################################
-        
+
         ## Type entry : unchageable
         ## Type entry : unchageable
         widget = self.createEntryField(contentFrame,'Type:',
         widget = self.createEntryField(contentFrame,'Type:',
                                        value = self.type,
                                        value = self.type,
@@ -423,7 +423,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createHprEntry(group.interior())
         self.createHprEntry(group.interior())
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
-        
+
         ## near entry
         ## near entry
         group = Pmw.Group(contentFrame,tag_text='Lens Property',
         group = Pmw.Group(contentFrame,tag_text='Lens Property',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
@@ -471,7 +471,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         widget = Label(frame, text = "Film Size:", font=('MSSansSerif', 10),width=12)
         widget = Label(frame, text = "Film Size:", font=('MSSansSerif', 10),width=12)
         widget.pack(side=LEFT)
         widget.pack(side=LEFT)
         frame.pack(side = TOP, fill = X, expand = 0, pady=3)
         frame.pack(side = TOP, fill = X, expand = 0, pady=3)
-            
+
         frame = Frame(lensFrame)
         frame = Frame(lensFrame)
         widget = Pmw.EntryField(frame, labelpos='w', label_text = '                        ',
         widget = Pmw.EntryField(frame, labelpos='w', label_text = '                        ',
                                 value = self.info['FilmSize'].getX(),
                                 value = self.info['FilmSize'].getX(),
@@ -490,7 +490,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         widget.pack(side=LEFT, padx=3)
         widget.pack(side=LEFT, padx=3)
         widget = Button(frame, text='Default', font=('MSSansSerif', 10), command = self.defaultCameraFilmSize)
         widget = Button(frame, text='Default', font=('MSSansSerif', 10), command = self.defaultCameraFilmSize)
         widget.pack(side=LEFT, padx=3)
         widget.pack(side=LEFT, padx=3)
-        self.widgetsDict['FilmSize'+'-'+'DefaultButton']=widget            
+        self.widgetsDict['FilmSize'+'-'+'DefaultButton']=widget
         frame.pack(side = TOP, fill = X, expand = 0,pady=0)
         frame.pack(side = TOP, fill = X, expand = 0,pady=0)
 
 
         ## Focal Length entry
         ## Focal Length entry
@@ -504,7 +504,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                                        defaultFunction = self.defaultCameraFocalLength)
                                        defaultFunction = self.defaultCameraFocalLength)
         group.pack(side = TOP, fill = X, expand = 0,pady=2)
         group.pack(side = TOP, fill = X, expand = 0,pady=2)
 
 
-        
+
     def defaultCameraFar(self):
     def defaultCameraFar(self):
         #################################################################
         #################################################################
         # defaultCameraFar(self)
         # defaultCameraFar(self)
@@ -655,7 +655,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createPosEntry(group.interior())
         self.createPosEntry(group.interior())
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
-        
+
         group = Pmw.Group(contentFrame,tag_text='Orientation',
         group = Pmw.Group(contentFrame,tag_text='Orientation',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createHprEntry(group.interior())
         self.createHprEntry(group.interior())
@@ -689,7 +689,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.nodePath.setTransparency(True)
             self.nodePath.setTransparency(True)
             self.nodePath.setBin("fixed", 1)
             self.nodePath.setBin("fixed", 1)
         return
         return
-    
+
     def actorInterface(self, contentFrame):
     def actorInterface(self, contentFrame):
         #################################################################
         #################################################################
         # actorInterface(self, contentFrame)
         # actorInterface(self, contentFrame)
@@ -744,7 +744,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             return
             return
         else:
         else:
             self.ignore('animRemovedFromNode')
             self.ignore('animRemovedFromNode')
-            
+
         if len(animDict)!= 0:
         if len(animDict)!= 0:
             del self.info['animDict']
             del self.info['animDict']
             self.info['animDict'] = animDict
             self.info['animDict'] = animDict
@@ -784,14 +784,14 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.lightColor['resetValue'] = [0.3*255,0.3*255,0.3*255,0]
         self.lightColor['resetValue'] = [0.3*255,0.3*255,0.3*255,0]
         self.lightColor.pack(side=TOP, fill=X,expand=1, padx = 2, pady =2)
         self.lightColor.pack(side=TOP, fill=X,expand=1, padx = 2, pady =2)
         self.bind(self.lightColor, 'Set light color')
         self.bind(self.lightColor, 'Set light color')
-        
+
         self.varActive = IntVar()
         self.varActive = IntVar()
         self.varActive.set(self.lightNode.active)
         self.varActive.set(self.lightNode.active)
         checkButton = Checkbutton(frame, text='Enable This Light',
         checkButton = Checkbutton(frame, text='Enable This Light',
                                   variable=self.varActive, command=self.toggleLight)
                                   variable=self.varActive, command=self.toggleLight)
         checkButton.pack(side=RIGHT,pady=3)
         checkButton.pack(side=RIGHT,pady=3)
         lightingGroup.pack(side=TOP, fill = X, expand =1)
         lightingGroup.pack(side=TOP, fill = X, expand =1)
-        
+
         # Directional light controls
         # Directional light controls
         if self.lightNode.type == 'directional':
         if self.lightNode.type == 'directional':
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
@@ -815,10 +815,10 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.dOrientation['resetValue'] = [0,0,0,0]
             self.dOrientation['resetValue'] = [0,0,0,0]
             self.dOrientation.pack(fill = X, expand = 1)
             self.dOrientation.pack(fill = X, expand = 1)
             self.bind(self.dOrientation, 'Set directional light orientation')
             self.bind(self.dOrientation, 'Set directional light orientation')
-            
+
             lightingGroup.pack(side=TOP, fill = X, expand =1)
             lightingGroup.pack(side=TOP, fill = X, expand =1)
 
 
-        
+
         elif self.lightNode.type == 'point':
         elif self.lightNode.type == 'point':
             # Point light controls
             # Point light controls
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
@@ -830,7 +830,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.pSpecularColor.pack(fill = X, expand = 1)
             self.pSpecularColor.pack(fill = X, expand = 1)
             self.bind(self.pSpecularColor,
             self.bind(self.pSpecularColor,
                       'Set point light specular color')
                       'Set point light specular color')
-    
+
             self.pPosition = VectorWidgets.Vector3Entry(
             self.pPosition = VectorWidgets.Vector3Entry(
                 pointPage, text = 'Position',  label_font=('MSSansSerif', 10),
                 pointPage, text = 'Position',  label_font=('MSSansSerif', 10),
                 value = [self.lightNode.getPosition().getX(),self.lightNode.getPosition().getY(),self.lightNode.getPosition().getZ(),0])
                 value = [self.lightNode.getPosition().getX(),self.lightNode.getPosition().getY(),self.lightNode.getPosition().getZ(),0])
@@ -848,7 +848,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.pConstantAttenuation.pack(fill = X, expand = 1)
             self.pConstantAttenuation.pack(fill = X, expand = 1)
             self.bind(self.pConstantAttenuation,
             self.bind(self.pConstantAttenuation,
                       'Set point light constant attenuation')
                       'Set point light constant attenuation')
-           
+
             self.pLinearAttenuation = Slider.Slider(
             self.pLinearAttenuation = Slider.Slider(
                 pointPage,
                 pointPage,
                 text = 'Linear Attenuation', label_font=('MSSansSerif', 10),
                 text = 'Linear Attenuation', label_font=('MSSansSerif', 10),
@@ -858,7 +858,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.pLinearAttenuation.pack(fill = X, expand = 1)
             self.pLinearAttenuation.pack(fill = X, expand = 1)
             self.bind(self.pLinearAttenuation,
             self.bind(self.pLinearAttenuation,
                       'Set point light linear attenuation')
                       'Set point light linear attenuation')
-           
+
             self.pQuadraticAttenuation = Slider.Slider(
             self.pQuadraticAttenuation = Slider.Slider(
                 pointPage,
                 pointPage,
                 text = 'Quadratic Attenuation', label_font=('MSSansSerif', 10),
                 text = 'Quadratic Attenuation', label_font=('MSSansSerif', 10),
@@ -871,8 +871,8 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
 
 
             lightingGroup.pack(side=TOP, fill = X, expand =1)
             lightingGroup.pack(side=TOP, fill = X, expand =1)
 
 
-           
-        elif self.lightNode.type == 'spot':     
+
+        elif self.lightNode.type == 'spot':
             # Spot light controls
             # Spot light controls
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
             lightingGroup = Pmw.Group(contentFrame,tag_pyclass=None)
             spotPage = lightingGroup.interior()
             spotPage = lightingGroup.interior()
@@ -893,7 +893,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.sConstantAttenuation.pack(fill = X, expand = 1)
             self.sConstantAttenuation.pack(fill = X, expand = 1)
             self.bind(self.sConstantAttenuation,
             self.bind(self.sConstantAttenuation,
                       'Set spot light constant attenuation')
                       'Set spot light constant attenuation')
-           
+
             self.sLinearAttenuation = Slider.Slider(
             self.sLinearAttenuation = Slider.Slider(
                 spotPage,
                 spotPage,
                 text = 'Linear Attenuation', label_font=('MSSansSerif', 10),
                 text = 'Linear Attenuation', label_font=('MSSansSerif', 10),
@@ -903,7 +903,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.sLinearAttenuation.pack(fill = X, expand = 1)
             self.sLinearAttenuation.pack(fill = X, expand = 1)
             self.bind(self.sLinearAttenuation,
             self.bind(self.sLinearAttenuation,
                       'Set spot light linear attenuation')
                       'Set spot light linear attenuation')
-           
+
             self.sQuadraticAttenuation = Slider.Slider(
             self.sQuadraticAttenuation = Slider.Slider(
                 spotPage,
                 spotPage,
                 text = 'Quadratic Attenuation', label_font=('MSSansSerif', 10),
                 text = 'Quadratic Attenuation', label_font=('MSSansSerif', 10),
@@ -913,7 +913,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.sQuadraticAttenuation.pack(fill = X, expand = 1)
             self.sQuadraticAttenuation.pack(fill = X, expand = 1)
             self.bind(self.sQuadraticAttenuation,
             self.bind(self.sQuadraticAttenuation,
                       'Set spot light quadratic attenuation')
                       'Set spot light quadratic attenuation')
-           
+
             self.sExponent = Slider.Slider(
             self.sExponent = Slider.Slider(
                 spotPage,
                 spotPage,
                 text = 'Exponent', label_font=('MSSansSerif', 10),
                 text = 'Exponent', label_font=('MSSansSerif', 10),
@@ -924,7 +924,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.bind(self.sExponent,
             self.bind(self.sExponent,
                       'Set spot light exponent')
                       'Set spot light exponent')
             lightingGroup.pack(side=TOP, fill = X, expand =1)
             lightingGroup.pack(side=TOP, fill = X, expand =1)
-            
+
         return
         return
 
 
     def setLightingColorVec(self,color):
     def setLightingColorVec(self,color):
@@ -950,19 +950,19 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             return
             return
         self.lightNode.setOrientation(Vec3(orient[0],orient[1],orient[2]))
         self.lightNode.setOrientation(Vec3(orient[0],orient[1],orient[2]))
         return
         return
-    
+
     def setConstantAttenuation(self, value):
     def setConstantAttenuation(self, value):
         self.lightNode.setConstantAttenuation(value)
         self.lightNode.setConstantAttenuation(value)
         return
         return
-    
+
     def setLinearAttenuation(self, value):
     def setLinearAttenuation(self, value):
         self.lightNode.setLinearAttenuation(value)
         self.lightNode.setLinearAttenuation(value)
         return
         return
-    
+
     def setQuadraticAttenuation(self, value):
     def setQuadraticAttenuation(self, value):
         self.lightNode.setQuadraticAttenuation(value)
         self.lightNode.setQuadraticAttenuation(value)
         return
         return
-    
+
     def setExponent(self, value):
     def setExponent(self, value):
         self.lightNode.setExponent(value)
         self.lightNode.setExponent(value)
         return
         return
@@ -988,12 +988,12 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                                        command = None,
                                        command = None,
                                        initialState='disabled',
                                        initialState='disabled',
                                        side = 'top')
                                        side = 'top')
-        
+
         group = Pmw.Group(contentFrame,tag_text='Position',
         group = Pmw.Group(contentFrame,tag_text='Position',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createPosEntry(group.interior())
         self.createPosEntry(group.interior())
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
-        
+
         group = Pmw.Group(contentFrame,tag_text='Orientation',
         group = Pmw.Group(contentFrame,tag_text='Orientation',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createHprEntry(group.interior())
         self.createHprEntry(group.interior())
@@ -1027,7 +1027,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         group.pack(side=TOP,fill = X, expand = 0, padx = 3, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, padx = 3, pady=3)
 
 
         gridPage = group.interior()
         gridPage = group.interior()
-        
+
         self.xyzSnap = BooleanVar()
         self.xyzSnap = BooleanVar()
         self.xyzSnapButton = Checkbutton(
         self.xyzSnapButton = Checkbutton(
             gridPage,
             gridPage,
@@ -1056,7 +1056,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             value = SEditor.grid.getGridSpacing())
             value = SEditor.grid.getGridSpacing())
         self.gridSpacing['command'] = SEditor.grid.setGridSpacing
         self.gridSpacing['command'] = SEditor.grid.setGridSpacing
         self.gridSpacing.pack(fill = X, expand = 0, pady=3)
         self.gridSpacing.pack(fill = X, expand = 0, pady=3)
-        
+
         self.gridSize = Floater.Floater(
         self.gridSize = Floater.Floater(
             gridPage,
             gridPage,
             text = 'Grid Size',
             text = 'Grid Size',
@@ -1072,7 +1072,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             value = SEditor.grid.getSnapAngle())
             value = SEditor.grid.getSnapAngle())
         self.gridSnapAngle['command'] = SEditor.grid.setSnapAngle
         self.gridSnapAngle['command'] = SEditor.grid.setSnapAngle
         self.gridSnapAngle.pack(fill = X, expand = 0, pady=3)
         self.gridSnapAngle.pack(fill = X, expand = 0, pady=3)
-        
+
         return
         return
 
 
     def toggleXyzSnap(self):
     def toggleXyzSnap(self):
@@ -1108,14 +1108,14 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createPosEntry(group.interior())
         self.createPosEntry(group.interior())
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
-        
+
         group = Pmw.Group(contentFrame,tag_text='Orientation',
         group = Pmw.Group(contentFrame,tag_text='Orientation',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         self.createHprEntry(group.interior())
         self.createHprEntry(group.interior())
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
         group.pack(side=TOP,fill = X, expand = 0, pady=3)
 
 
         self.createScaleEntry(contentFrame)
         self.createScaleEntry(contentFrame)
-        
+
         collisionGroup = Pmw.Group(contentFrame,tag_text='Collision Object Properties',
         collisionGroup = Pmw.Group(contentFrame,tag_text='Collision Object Properties',
                           tag_font=('MSSansSerif', 10))
                           tag_font=('MSSansSerif', 10))
         cObjFrame = collisionGroup.interior()
         cObjFrame = collisionGroup.interior()
@@ -1139,7 +1139,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosX['commandData'] = ['sphere-o']
             self.cPosX['commandData'] = ['sphere-o']
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
             self.cPosY = self.createcomponent('originY', (), None,
             self.cPosY = self.createcomponent('originY', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Y', relief = FLAT,
                                              text = 'Y', relief = FLAT,
@@ -1149,7 +1149,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosY['commandData'] = ['sphere-o']
             self.cPosY['commandData'] = ['sphere-o']
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
             self.cPosZ = self.createcomponent('originZ', (), None,
             self.cPosZ = self.createcomponent('originZ', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Z', relief = FLAT,
                                              text = 'Z', relief = FLAT,
@@ -1164,7 +1164,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             group.pack(side=TOP,fill = X, expand = 0, pady=3)
             group.pack(side=TOP,fill = X, expand = 0, pady=3)
 
 
             scaleInterior = Frame(cObjFrame)
             scaleInterior = Frame(cObjFrame)
-        
+
             self.scaleS = self.createcomponent('radius', (), None,
             self.scaleS = self.createcomponent('radius', (), None,
                                                Floater.Floater, (scaleInterior,),
                                                Floater.Floater, (scaleInterior,),
                                                text = 'Radius',
                                                text = 'Radius',
@@ -1178,7 +1178,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
 
 
             scaleInterior.pack(side=TOP,expand=0,fill=X, padx=3, pady=3)
             scaleInterior.pack(side=TOP,expand=0,fill=X, padx=3, pady=3)
             pass
             pass
-        
+
         elif cType == 'CollisionPolygon':
         elif cType == 'CollisionPolygon':
             frame = Frame(cObjFrame)
             frame = Frame(cObjFrame)
             label = Label(frame, text= "Sorry!",font=('MSSansSerif', 10),
             label = Label(frame, text= "Sorry!",font=('MSSansSerif', 10),
@@ -1199,9 +1199,9 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             label = Label(frame, text= "If you really need to change, recreate one...",font=('MSSansSerif', 10),
             label = Label(frame, text= "If you really need to change, recreate one...",font=('MSSansSerif', 10),
                           borderwidth=5)
                           borderwidth=5)
             label.pack(side=LEFT)
             label.pack(side=LEFT)
-            frame.pack(side=TOP, fill=X, expand=True)        
+            frame.pack(side=TOP, fill=X, expand=True)
             pass
             pass
-        
+
         elif cType == 'CollisionSegment':
         elif cType == 'CollisionSegment':
             pointA = self.collisionObj.getPointA()
             pointA = self.collisionObj.getPointA()
             pointB = self.collisionObj.getPointB()
             pointB = self.collisionObj.getPointB()
@@ -1217,7 +1217,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosX['commandData'] = ['segment-A']
             self.cPosX['commandData'] = ['segment-A']
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
             self.cPosY = self.createcomponent('pointA-Y', (), None,
             self.cPosY = self.createcomponent('pointA-Y', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Y', relief = FLAT,
                                              text = 'Y', relief = FLAT,
@@ -1227,7 +1227,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosY['commandData'] = ['segment-A']
             self.cPosY['commandData'] = ['segment-A']
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
             self.cPosZ = self.createcomponent('pointA-Z', (), None,
             self.cPosZ = self.createcomponent('pointA-Z', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Z', relief = FLAT,
                                              text = 'Z', relief = FLAT,
@@ -1251,7 +1251,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosXB['commandData'] = ['segment-B']
             self.cPosXB['commandData'] = ['segment-B']
             self.cPosXB['command'] = self.setCollisionPosHprScale
             self.cPosXB['command'] = self.setCollisionPosHprScale
             self.cPosXB.pack(side=LEFT,expand=0,fill=X, padx=1)
             self.cPosXB.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
             self.cPosYB = self.createcomponent('pointB-Y', (), None,
             self.cPosYB = self.createcomponent('pointB-Y', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Y', relief = FLAT,
                                              text = 'Y', relief = FLAT,
@@ -1261,7 +1261,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosYB['commandData'] = ['segment-B']
             self.cPosYB['commandData'] = ['segment-B']
             self.cPosYB['command'] = self.setCollisionPosHprScale
             self.cPosYB['command'] = self.setCollisionPosHprScale
             self.cPosYB.pack(side=LEFT, expand=0,fill=X, padx=1)
             self.cPosYB.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
             self.cPosZB = self.createcomponent('pointB-Z', (), None,
             self.cPosZB = self.createcomponent('pointB-Z', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Z', relief = FLAT,
                                              text = 'Z', relief = FLAT,
@@ -1289,7 +1289,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosX['commandData'] = ['ray-A']
             self.cPosX['commandData'] = ['ray-A']
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX['command'] = self.setCollisionPosHprScale
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
             self.cPosX.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
             self.cPosY = self.createcomponent('origin-Y', (), None,
             self.cPosY = self.createcomponent('origin-Y', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Y', relief = FLAT,
                                              text = 'Y', relief = FLAT,
@@ -1299,7 +1299,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosY['commandData'] = ['ray-A']
             self.cPosY['commandData'] = ['ray-A']
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY['command'] = self.setCollisionPosHprScale
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
             self.cPosY.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
             self.cPosZ = self.createcomponent('origin-Z', (), None,
             self.cPosZ = self.createcomponent('origin-Z', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Z', relief = FLAT,
                                              text = 'Z', relief = FLAT,
@@ -1323,7 +1323,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosXB['commandData'] = ['ray-B']
             self.cPosXB['commandData'] = ['ray-B']
             self.cPosXB['command'] = self.setCollisionPosHprScale
             self.cPosXB['command'] = self.setCollisionPosHprScale
             self.cPosXB.pack(side=LEFT,expand=0,fill=X, padx=1)
             self.cPosXB.pack(side=LEFT,expand=0,fill=X, padx=1)
-        
+
             self.cPosYB = self.createcomponent('direction-Y', (), None,
             self.cPosYB = self.createcomponent('direction-Y', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Y', relief = FLAT,
                                              text = 'Y', relief = FLAT,
@@ -1333,7 +1333,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             self.cPosYB['commandData'] = ['ray-B']
             self.cPosYB['commandData'] = ['ray-B']
             self.cPosYB['command'] = self.setCollisionPosHprScale
             self.cPosYB['command'] = self.setCollisionPosHprScale
             self.cPosYB.pack(side=LEFT, expand=0,fill=X, padx=1)
             self.cPosYB.pack(side=LEFT, expand=0,fill=X, padx=1)
-        
+
             self.cPosZB = self.createcomponent('direction-Z', (), None,
             self.cPosZB = self.createcomponent('direction-Z', (), None,
                                              Floater.Floater, (posInterior,),
                                              Floater.Floater, (posInterior,),
                                              text = 'Z', relief = FLAT,
                                              text = 'Z', relief = FLAT,
@@ -1346,7 +1346,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
             posInterior.pack(side=TOP, expand=0,fill=X, padx=3, pady=3)
             posInterior.pack(side=TOP, expand=0,fill=X, padx=3, pady=3)
             group.pack(side=TOP,fill = X, expand = 0, pady=3)
             group.pack(side=TOP,fill = X, expand = 0, pady=3)
             pass
             pass
-            
+
         collisionGroup.pack(side=TOP,fill = X, expand = 0, pady=3)
         collisionGroup.pack(side=TOP,fill = X, expand = 0, pady=3)
 
 
         return
         return
@@ -1422,18 +1422,18 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.hprR.set(hpr.getZ())
         self.hprR.set(hpr.getZ())
         self.scale.set(scale.getX())
         self.scale.set(scale.getX())
         return
         return
-    
+
     def trackDataFromSceneLight(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
     def trackDataFromSceneLight(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
         if self.lightNode.type == 'directional':
         if self.lightNode.type == 'directional':
             self.dPosition.set([pos.getX(),pos.getY(),pos.getZ()])
             self.dPosition.set([pos.getX(),pos.getY(),pos.getZ()])
             self.dOrientation.set([hpr.getX(),hpr.getY(),hpr.getZ()])
             self.dOrientation.set([hpr.getX(),hpr.getY(),hpr.getZ()])
             pass
             pass
-        
+
         elif self.lightNode.type == 'point':
         elif self.lightNode.type == 'point':
             self.pPosition.set([pos.getX(),pos.getY(),pos.getZ()])
             self.pPosition.set([pos.getX(),pos.getY(),pos.getZ()])
-            pass       
+            pass
         return
         return
-    
+
     def trackDataFromSceneDummy(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
     def trackDataFromSceneDummy(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
         self.posX.set(pos.getX())
         self.posX.set(pos.getX())
         self.posY.set(pos.getY())
         self.posY.set(pos.getY())
@@ -1443,7 +1443,7 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.hprR.set(hpr.getZ())
         self.hprR.set(hpr.getZ())
         self.scale.set(scale.getX())
         self.scale.set(scale.getX())
         return
         return
-    
+
     def trackDataFromSceneCollision(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
     def trackDataFromSceneCollision(self, pos=Point3(0,0,0), hpr=Vec3(0,0,0), scale=Point3(0,0,0)):
         self.posX.set(pos.getX())
         self.posX.set(pos.getX())
         self.posY.set(pos.getY())
         self.posY.set(pos.getY())
@@ -1453,4 +1453,4 @@ class propertyWindow(AppShell,Pmw.MegaWidget):
         self.hprR.set(hpr.getZ())
         self.hprR.set(hpr.getZ())
         self.scale.set(scale.getX())
         self.scale.set(scale.getX())
         return
         return
-        
+

+ 46 - 46
contrib/src/sceneeditor/quad.py

@@ -12,15 +12,15 @@ from direct.showbase.DirectObject import DirectObject
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 import math
 import math
 #Manakel 2/12/2005: replace from pandac import by from pandac.PandaModules import
 #Manakel 2/12/2005: replace from pandac import by from pandac.PandaModules import
-from pandac.PandaModules import MouseWatcher 
+from pandac.PandaModules import MouseWatcher
 
 
 
 
 class ViewPort:
 class ViewPort:
 #########################################################################################################################################
 #########################################################################################################################################
 # The ViewPort class has the camera and associated display region set up for actually rendering the four sub-views
 # The ViewPort class has the camera and associated display region set up for actually rendering the four sub-views
 # The constructor needs the bounds, window layer, camera, color, projection type, name and scene for the view
 # The constructor needs the bounds, window layer, camera, color, projection type, name and scene for the view
-#########################################################################################################################################           
-    
+#########################################################################################################################################
+
     def __init__(self,X1,X2,Y1,Y2,layer,cam,background=Vec4(0.3,0.3,0.3,1),projection="perspective",type="top",scene=render):
     def __init__(self,X1,X2,Y1,Y2,layer,cam,background=Vec4(0.3,0.3,0.3,1),projection="perspective",type="top",scene=render):
         self.VPType=type
         self.VPType=type
         self.VP_X1=X1
         self.VP_X1=X1
@@ -29,14 +29,14 @@ class ViewPort:
         self.VP_Y2=Y2
         self.VP_Y2=Y2
         self.VP_width=self.VP_X2 - self.VP_X1
         self.VP_width=self.VP_X2 - self.VP_X1
         self.VP_height=self.VP_Y2 - self.VP_Y1
         self.VP_height=self.VP_Y2 - self.VP_Y1
-        
+
         self.the_viewport=layer.makeDisplayRegion(self.VP_X1, self.VP_X2,self.VP_Y1, self.VP_Y2)
         self.the_viewport=layer.makeDisplayRegion(self.VP_X1, self.VP_X2,self.VP_Y1, self.VP_Y2)
         self.the_viewport.setCamera(cam)
         self.the_viewport.setCamera(cam)
         self.the_viewport.setClearDepthActive(1)
         self.the_viewport.setClearDepthActive(1)
         self.the_viewport.setClearColorActive(1)
         self.the_viewport.setClearColorActive(1)
         self.the_viewport.setClearColor(background)
         self.the_viewport.setClearColor(background)
-        self.cam=cam   
-     
+        self.cam=cam
+
 
 
         # Set up the cameras to look in the right place.
         # Set up the cameras to look in the right place.
         if(type=="top"):
         if(type=="top"):
@@ -46,13 +46,13 @@ class ViewPort:
             self.cam.setH(-90)
             self.cam.setH(-90)
             self.cam.setX(10)
             self.cam.setX(10)
         elif(type=="front"):
         elif(type=="front"):
-            self.cam.setY(-10) 
+            self.cam.setY(-10)
         elif(type=="perspective"):
         elif(type=="perspective"):
             cam.setY(-100)
             cam.setY(-100)
             #cam.setX(10)
             #cam.setX(10)
             #cam.setZ(-10)
             #cam.setZ(-10)
             #cam.setH(45)
             #cam.setH(45)
-            #cam.setP(-45)   
+            #cam.setP(-45)
             #print "aa"
             #print "aa"
 
 
 
 
@@ -89,9 +89,9 @@ class ViewPort:
             y=1
             y=1
         self.lens.setAspectRatio(x/y)
         self.lens.setAspectRatio(x/y)
         self.cam.node().setLens(self.lens)
         self.cam.node().setLens(self.lens)
-   
+
     def resize(self,x,y):
     def resize(self,x,y):
-        
+
         if(self.VPType=="left"):
         if(self.VPType=="left"):
             self.the_viewport.setDimensions(0,x,0,y)
             self.the_viewport.setDimensions(0,x,0,y)
             w=abs(x-self.VP_X1)
             w=abs(x-self.VP_X1)
@@ -127,7 +127,7 @@ class ViewPort:
 
 
     def setScene(self,scene):
     def setScene(self,scene):
         self.cam.node().setScene(scene)
         self.cam.node().setScene(scene)
-    
+
     def setDR(self,mouseWatcher):
     def setDR(self,mouseWatcher):
         #mouseWatcher.setDisplayRegion(self.the_viewport)
         #mouseWatcher.setDisplayRegion(self.the_viewport)
         pass
         pass
@@ -141,7 +141,7 @@ class ViewPort:
 
 
     def getCam(self):
     def getCam(self):
         return self.cam
         return self.cam
-        
+
 
 
 class QuadView(DirectObject):
 class QuadView(DirectObject):
 #########################################################################################################################################
 #########################################################################################################################################
@@ -157,7 +157,7 @@ class QuadView(DirectObject):
         self.AltPressed=0
         self.AltPressed=0
         self.PanConstantX=50
         self.PanConstantX=50
         self.PanConstantY=50
         self.PanConstantY=50
-        self.ZoomConstant=1     
+        self.ZoomConstant=1
         self.FrontWidth=100
         self.FrontWidth=100
         self.FrontHeight=100
         self.FrontHeight=100
         self.TopWidth=100
         self.TopWidth=100
@@ -186,9 +186,9 @@ class QuadView(DirectObject):
         self.PerspectiveWire=0
         self.PerspectiveWire=0
         self.TopWire=0
         self.TopWire=0
 
 
-        # Keep track of the currently selected window... values are 1-4 for four quadrants of a standard 
+        # Keep track of the currently selected window... values are 1-4 for four quadrants of a standard
         # Cartesian coordinate system
         # Cartesian coordinate system
-        
+
         # These are the orthographic cameras
         # These are the orthographic cameras
         # They will be restricted to panning and zooming i.e. no rotation
         # They will be restricted to panning and zooming i.e. no rotation
         # Top could be flipped to back, left to right and front to back
         # Top could be flipped to back, left to right and front to back
@@ -198,7 +198,7 @@ class QuadView(DirectObject):
 
 
         # This camera will have a trackball control since its perspective
         # This camera will have a trackball control since its perspective
         self.perspectiveCam = render.attachNewNode(Camera('perspectiveCam'))
         self.perspectiveCam = render.attachNewNode(Camera('perspectiveCam'))
-        
+
         #self.toplens=OrthographicLens()
         #self.toplens=OrthographicLens()
         #self.leftLens=OrthographicLens()
         #self.leftLens=OrthographicLens()
         #self.frontLens=OrthographicLens()
         #self.frontLens=OrthographicLens()
@@ -210,7 +210,7 @@ class QuadView(DirectObject):
         #self.leftCamLens= base.cam.node().getLens()
         #self.leftCamLens= base.cam.node().getLens()
         #self.perspectiveCamLens= base.cam.node().getLens()
         #self.perspectiveCamLens= base.cam.node().getLens()
 
 
-        # Manipulate lenses here if need be     
+        # Manipulate lenses here if need be
         #self.topCamLens.setFilmSize(250)
         #self.topCamLens.setFilmSize(250)
 
 
         # Set the Lenses
         # Set the Lenses
@@ -239,17 +239,17 @@ class QuadView(DirectObject):
         #self.FrontScene=render.copyTo(self.SceneParent)
         #self.FrontScene=render.copyTo(self.SceneParent)
         #self.TopScene=render.copyTo(self.SceneParent)
         #self.TopScene=render.copyTo(self.SceneParent)
         #self.LeftScene=render.copyTo(self.SceneParent)
         #self.LeftScene=render.copyTo(self.SceneParent)
-                
+
         self.PerspectiveScene=render
         self.PerspectiveScene=render
         self.FrontScene=render
         self.FrontScene=render
         self.TopScene=render
         self.TopScene=render
         self.LeftScene=render
         self.LeftScene=render
-        
+
         #self.PerspectiveScene.reparentTo(self.SceneParent)
         #self.PerspectiveScene.reparentTo(self.SceneParent)
         #self.FrontScene.reparentTo(self.SceneParent)
         #self.FrontScene.reparentTo(self.SceneParent)
         #self.TopScene.reparentTo(self.SceneParent)
         #self.TopScene.reparentTo(self.SceneParent)
         #self.LeftScene.reparentTo(self.SceneParent)
         #self.LeftScene.reparentTo(self.SceneParent)
-        
+
         self.Perspective=ViewPort(0.5,1.0,0.0,0.5,self.newLayer,self.perspectiveCam,Vec4(0.75,0.75,0.75,1),"perspective","perspective",self.PerspectiveScene)
         self.Perspective=ViewPort(0.5,1.0,0.0,0.5,self.newLayer,self.perspectiveCam,Vec4(0.75,0.75,0.75,1),"perspective","perspective",self.PerspectiveScene)
         self.Top=ViewPort(0.0,0.5,0.5,1.0,self.newLayer,self.topCam,Vec4(0.80,0.80,0.80,1),"ortho","top",self.TopScene)
         self.Top=ViewPort(0.0,0.5,0.5,1.0,self.newLayer,self.topCam,Vec4(0.80,0.80,0.80,1),"ortho","top",self.TopScene)
         self.Left=ViewPort(0.0,0.5,0.0,0.5,self.newLayer,self.leftCam,Vec4(0.85,0.85,0.85,1),"ortho","left",self.LeftScene)
         self.Left=ViewPort(0.0,0.5,0.0,0.5,self.newLayer,self.leftCam,Vec4(0.85,0.85,0.85,1),"ortho","left",self.LeftScene)
@@ -263,7 +263,7 @@ class QuadView(DirectObject):
         #self.lastPickPoint = None
         #self.lastPickPoint = None
 
 
         #base.useTrackball()
         #base.useTrackball()
-        
+
         #self.dataRoot = NodePath('dataRoot')
         #self.dataRoot = NodePath('dataRoot')
         # Cache the node so we do not ask for it every frame
         # Cache the node so we do not ask for it every frame
         #self.dataRootNode = self.dataRoot.node()
         #self.dataRootNode = self.dataRoot.node()
@@ -272,7 +272,7 @@ class QuadView(DirectObject):
         #self.mak = self.dataRoot.attachNewNode(MouseAndKeyboard(base.win, 0, 'mak'))
         #self.mak = self.dataRoot.attachNewNode(MouseAndKeyboard(base.win, 0, 'mak'))
         #self.mak.node().setSource(base.win, 0)
         #self.mak.node().setSource(base.win, 0)
         self.mouseWatcherNode = MouseWatcher('mouseWatcher')
         self.mouseWatcherNode = MouseWatcher('mouseWatcher')
-        
+
         self.mouseWatcher = base.mak.attachNewNode(self.mouseWatcherNode)
         self.mouseWatcher = base.mak.attachNewNode(self.mouseWatcherNode)
         #self.Perspective.setDR(self.mouseWatcherNode)
         #self.Perspective.setDR(self.mouseWatcherNode)
 
 
@@ -282,7 +282,7 @@ class QuadView(DirectObject):
         #ddr=DisplayRegionContext(self.Perspective.getCam())
         #ddr=DisplayRegionContext(self.Perspective.getCam())
         #base.setMouseOnNode(self.smiley.node()) # Let Mouse Control Perspective View for now
         #base.setMouseOnNode(self.smiley.node()) # Let Mouse Control Perspective View for now
         #base.enableSoftwareMousePointer()
         #base.enableSoftwareMousePointer()
-        
+
         # Message Handlers
         # Message Handlers
         self.accept("a",self.setLeft)
         self.accept("a",self.setLeft)
         self.accept("q",self.setTop)
         self.accept("q",self.setTop)
@@ -302,7 +302,7 @@ class QuadView(DirectObject):
         self.accept("alt-mouse1-up",self.AltUp)
         self.accept("alt-mouse1-up",self.AltUp)
         self.accept("control-mouse1",self.CtlDown)
         self.accept("control-mouse1",self.CtlDown)
         self.accept("control-mouse1-up",self.CtlUp)
         self.accept("control-mouse1-up",self.CtlUp)
-        
+
     # Methods
     # Methods
 
 
     #def setLastPickPoint( self ):
     #def setLastPickPoint( self ):
@@ -407,7 +407,7 @@ class QuadView(DirectObject):
                 self.PerspectiveScene.clearTexture()
                 self.PerspectiveScene.clearTexture()
                 self.PerspectiveTexture=1
                 self.PerspectiveTexture=1
 
 
-   
+
 
 
     def reparenter(self):
     def reparenter(self):
         #self.FrontScene.reparentTo(render)
         #self.FrontScene.reparentTo(render)
@@ -437,10 +437,10 @@ class QuadView(DirectObject):
         if(self.oldY<-1 or self.oldY>1):
         if(self.oldY<-1 or self.oldY>1):
             return
             return
         taskMgr.add(self.DragAction,'DragAction')
         taskMgr.add(self.DragAction,'DragAction')
-            
+
     def AltUpHandler(self):
     def AltUpHandler(self):
-        taskMgr.remove('DragAction')    
-        
+        taskMgr.remove('DragAction')
+
     def gridtoggle(self):
     def gridtoggle(self):
         #grid=DirectGrid()
         #grid=DirectGrid()
         #grid.enable()
         #grid.enable()
@@ -467,11 +467,11 @@ class QuadView(DirectObject):
                 self.setPerspective()
                 self.setPerspective()
             else:
             else:
                 self.setFront()
                 self.setFront()
-        
+
     def MouseTell(self,buttonCode):
     def MouseTell(self,buttonCode):
         self.MouseButton=buttonCode
         self.MouseButton=buttonCode
         self.setAppropriateViewPort(self.mouseWatcherNode.getMouseX(),self.mouseWatcherNode.getMouseY())
         self.setAppropriateViewPort(self.mouseWatcherNode.getMouseX(),self.mouseWatcherNode.getMouseY())
-        
+
         x=base.mouseWatcherNode.getMouseX()
         x=base.mouseWatcherNode.getMouseX()
         y=base.mouseWatcherNode.getMouseY()
         y=base.mouseWatcherNode.getMouseY()
 
 
@@ -509,12 +509,12 @@ class QuadView(DirectObject):
         print "Sent X:%f Sent Y:%f"%(ansX,ansY)
         print "Sent X:%f Sent Y:%f"%(ansX,ansY)
         #SEditor.iRay.pick(render,self.xy)
         #SEditor.iRay.pick(render,self.xy)
         SEditor.manipulationControl.manipulationStop(self.xy)
         SEditor.manipulationControl.manipulationStop(self.xy)
-        #print "MouseX " + str(base.mouseWatcherNode.getMouseX()) + "MouseY " + str(base.mouseWatcherNode.getMouseY()) + "\n" 
-        #print "MouseX " + str(self.mouseWatcherNode.getMouseX()) + "MouseY " + str(self.mouseWatcherNode.getMouseY()) + "\n" 
-        
+        #print "MouseX " + str(base.mouseWatcherNode.getMouseX()) + "MouseY " + str(base.mouseWatcherNode.getMouseY()) + "\n"
+        #print "MouseX " + str(self.mouseWatcherNode.getMouseX()) + "MouseY " + str(self.mouseWatcherNode.getMouseY()) + "\n"
+
 
 
         base.mouseWatcherNode=self.mouseWatcherNode
         base.mouseWatcherNode=self.mouseWatcherNode
-        
+
         self.oldX=self.mouseWatcherNode.getMouseX()
         self.oldX=self.mouseWatcherNode.getMouseX()
         if(self.oldX<-1 or self.oldX>1):
         if(self.oldX<-1 or self.oldX>1):
             return
             return
@@ -533,11 +533,11 @@ class QuadView(DirectObject):
         taskMgr.remove('DragAction')
         taskMgr.remove('DragAction')
         self.Mouse_Draggin=0
         self.Mouse_Draggin=0
         #print "Mouse Up"
         #print "Mouse Up"
-        
+
 
 
     def Max_Style_Mouse_View(self,buttoncode):
     def Max_Style_Mouse_View(self,buttoncode):
         pass
         pass
-        
+
     def ChangeBaseDR(self):
     def ChangeBaseDR(self):
         dr=base.win.getDisplayRegion(0)
         dr=base.win.getDisplayRegion(0)
         if(self.CurrentQuad==1): #Front
         if(self.CurrentQuad==1): #Front
@@ -569,7 +569,7 @@ class QuadView(DirectObject):
         self.ChangeBaseDR()
         self.ChangeBaseDR()
         self.Perspective.setCam()
         self.Perspective.setCam()
         #self.Perspective.setDR(self.mouseWatcherNode)
         #self.Perspective.setDR(self.mouseWatcherNode)
-        
+
     def setFront(self):
     def setFront(self):
         print "FRONT"
         print "FRONT"
         self.CurrentQuad=1
         self.CurrentQuad=1
@@ -577,7 +577,7 @@ class QuadView(DirectObject):
         self.Front.setCam()
         self.Front.setCam()
         #self.Front.setDR(self.mouseWatcherNode)
         #self.Front.setDR(self.mouseWatcherNode)
 
 
-    
+
     def DragAction(self,task):
     def DragAction(self,task):
         #if(self.MouseDragging==1):
         #if(self.MouseDragging==1):
         self.currX= self.mouseWatcherNode.getMouseX()
         self.currX= self.mouseWatcherNode.getMouseX()
@@ -598,7 +598,7 @@ class QuadView(DirectObject):
              if(self.HorizontalAxis<-1 or self.HorizontalAxis>1 or self.VerticalAxis<-1 or self.VerticalAxis>1):
              if(self.HorizontalAxis<-1 or self.HorizontalAxis>1 or self.VerticalAxis<-1 or self.VerticalAxis>1):
                  return
                  return
              self.resizedr(self.VerticalAxis,self.HorizontalAxis)
              self.resizedr(self.VerticalAxis,self.HorizontalAxis)
-        
+
         #if(self.AltPressed): # View Camera Transforms -> Maya style
         #if(self.AltPressed): # View Camera Transforms -> Maya style
         elif(1):
         elif(1):
             #print "ALTPRESSED"
             #print "ALTPRESSED"
@@ -618,7 +618,7 @@ class QuadView(DirectObject):
                     self.MoveCamera(0,self.diffX*self.PanConstantX,-self.diffY*self.PanConstantY,self.CurrentQuad)
                     self.MoveCamera(0,self.diffX*self.PanConstantX,-self.diffY*self.PanConstantY,self.CurrentQuad)
                 elif(self.CurrentQuad==4):
                 elif(self.CurrentQuad==4):
                     pass
                     pass
-            elif(self.MouseButton==3): # Do Zoom 
+            elif(self.MouseButton==3): # Do Zoom
                 if(self.CurrentQuad==1): # Y and Z values change meanings for different cameras
                 if(self.CurrentQuad==1): # Y and Z values change meanings for different cameras
                     #lens = OrthographicLens()
                     #lens = OrthographicLens()
                     #lens.setFilmSize(l,self.VP_height*200)
                     #lens.setFilmSize(l,self.VP_height*200)
@@ -634,26 +634,26 @@ class QuadView(DirectObject):
                     if(self.FrontHeight<=0):
                     if(self.FrontHeight<=0):
                         FrontHeight=1
                         FrontHeight=1
                     self.frontCam.node().getLens().setFilmSize(self.FrontWidth,self.FrontHeight)
                     self.frontCam.node().getLens().setFilmSize(self.FrontWidth,self.FrontHeight)
-                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)        
+                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)
                 elif(self.CurrentQuad==2):
                 elif(self.CurrentQuad==2):
                     self.TopWidth= self.TopWidth + self.diffX
                     self.TopWidth= self.TopWidth + self.diffX
                     self.TopHeight= self.TopHeight + self.diffX
                     self.TopHeight= self.TopHeight + self.diffX
                     self.TopWidth= self.TopWidth + self.diffY
                     self.TopWidth= self.TopWidth + self.diffY
                     self.TopHeight= self.TopHeight + self.diffY
                     self.TopHeight= self.TopHeight + self.diffY
                     self.topCam.node().getLens().setFilmSize(self.TopWidth,self.TopHeight)
                     self.topCam.node().getLens().setFilmSize(self.TopWidth,self.TopHeight)
-                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)        
+                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)
                 elif(self.CurrentQuad==3):
                 elif(self.CurrentQuad==3):
                     self.LeftWidth= self.LeftWidth + self.diffX
                     self.LeftWidth= self.LeftWidth + self.diffX
                     self.LeftHeight= self.LeftHeight + self.diffX
                     self.LeftHeight= self.LeftHeight + self.diffX
                     self.LeftWidth= self.LeftWidth + self.diffY
                     self.LeftWidth= self.LeftWidth + self.diffY
                     self.LeftHeight= self.LeftHeight + self.diffY
                     self.LeftHeight= self.LeftHeight + self.diffY
                     self.leftCam.node().getLens().setFilmSize(self.LeftWidth,self.LeftHeight)
                     self.leftCam.node().getLens().setFilmSize(self.LeftWidth,self.LeftHeight)
-                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)        
+                    self.resizedr(self.VerticalAxis,self.HorizontalAxis)
                 elif(self.CurrentQuad==4):
                 elif(self.CurrentQuad==4):
                     pass
                     pass
         else:
         else:
              pass
              pass
-                
+
         self.oldX=self.currX
         self.oldX=self.currX
         self.oldY=self.currY
         self.oldY=self.currY
         return Task.cont
         return Task.cont
@@ -669,8 +669,8 @@ class QuadView(DirectObject):
             self.leftCam.setPos(self.leftCam.getX()+X_amt,self.leftCam.getY()+Y_amt,self.leftCam.getZ()+Z_amt)
             self.leftCam.setPos(self.leftCam.getX()+X_amt,self.leftCam.getY()+Y_amt,self.leftCam.getZ()+Z_amt)
         elif(quad==4):
         elif(quad==4):
             self.perspectiveCam.setPos(self.perspectiveCam.getX()+X_amt,self.perspectiveCam.getY()+Y_amt,self.perspectiveCam.getZ()+Z_amt)
             self.perspectiveCam.setPos(self.perspectiveCam.getX()+X_amt,self.perspectiveCam.getY()+Y_amt,self.perspectiveCam.getZ()+Z_amt)
-        
-    
+
+
 
 
 #View=QuadView()
 #View=QuadView()
 #run()
 #run()

+ 64 - 64
contrib/src/sceneeditor/sceneEditor.py

@@ -87,7 +87,7 @@ class myLevelEditor(AppShell):
     controlType = 'Keyboard'
     controlType = 'Keyboard'
     keyboardMapDict = {}
     keyboardMapDict = {}
     keyboardSpeedDict = {}
     keyboardSpeedDict = {}
-    
+
     Scene=None
     Scene=None
     isSelect = False
     isSelect = False
     nodeSelected = None
     nodeSelected = None
@@ -99,9 +99,9 @@ class myLevelEditor(AppShell):
     CurrentFileName=None #Holds the current scene file name
     CurrentFileName=None #Holds the current scene file name
     CurrentDirName=None # Holds the current file name without extension which is the path where file's data gets saved
     CurrentDirName=None # Holds the current file name without extension which is the path where file's data gets saved
     Dirty=0 # Keeps track of whether there are any modifications that should be saved
     Dirty=0 # Keeps track of whether there are any modifications that should be saved
-  
-    
-    
+
+
+
     def __init__(self, parent = None, **kw):
     def __init__(self, parent = None, **kw):
 
 
         base.setBackgroundColor(0,0,0)
         base.setBackgroundColor(0,0,0)
@@ -149,12 +149,12 @@ class myLevelEditor(AppShell):
             text_scale = 0.05,
             text_scale = 0.05,
             text_align = TextNode.ALeft
             text_align = TextNode.ALeft
             )
             )
-        
+
 
 
         self.initialiseoptions(myLevelEditor)
         self.initialiseoptions(myLevelEditor)
 
 
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
         self.parent.resizable(False,False) ## Disable the ability to resize for this Window.
-        
+
         ######### Set the event handler ##########
         ######### Set the event handler ##########
         self.dataFlowEvents = [
         self.dataFlowEvents = [
             ## Event from Side Window
             ## Event from Side Window
@@ -213,7 +213,7 @@ class myLevelEditor(AppShell):
             ['f11',self.loadFromBam],
             ['f11',self.loadFromBam],
             ['f12',self.saveAsBam],
             ['f12',self.saveAsBam],
             ]
             ]
-        
+
 
 
         #################################
         #################################
         ###  Collision detection
         ###  Collision detection
@@ -223,7 +223,7 @@ class myLevelEditor(AppShell):
 
 
         for event in self.dataFlowEvents:
         for event in self.dataFlowEvents:
             self.accept(event[0], event[1], extraArgs = event[2:])
             self.accept(event[0], event[1], extraArgs = event[2:])
-        
+
         self.actionEvents = [
         self.actionEvents = [
             # Scene graph explorer functions
             # Scene graph explorer functions
             ['SGE_changeName', self.changeName],
             ['SGE_changeName', self.changeName],
@@ -247,7 +247,7 @@ class myLevelEditor(AppShell):
             ['se_deselectedAll',self.deselectFromScene],
             ['se_deselectedAll',self.deselectFromScene],
             ]
             ]
         ''' All messages starting with "SGE_" are generated in seSceneGraphExplorer'''
         ''' All messages starting with "SGE_" are generated in seSceneGraphExplorer'''
-        
+
         for event in self.actionEvents:
         for event in self.actionEvents:
             self.accept(event[0], event[1], extraArgs = event[2:])
             self.accept(event[0], event[1], extraArgs = event[2:])
 
 
@@ -260,7 +260,7 @@ class myLevelEditor(AppShell):
         # Initialize the application.
         # Initialize the application.
         # This function will be called when you call AppShell's constructor
         # This function will be called when you call AppShell's constructor
         #################################################################
         #################################################################
-        
+
         ### Create SceneEditor Ver. DirectSession
         ### Create SceneEditor Ver. DirectSession
         self.seSession = SeSession()
         self.seSession = SeSession()
         self.seSession.enable()
         self.seSession.enable()
@@ -270,7 +270,7 @@ class myLevelEditor(AppShell):
         self.MopathPanel = None
         self.MopathPanel = None
         self.alignPanelDict = {}
         self.alignPanelDict = {}
         #self.quadview=QuadView()
         #self.quadview=QuadView()
-        
+
 
 
         self.lightingPanel = None
         self.lightingPanel = None
         self.controllerPanel = None
         self.controllerPanel = None
@@ -291,9 +291,9 @@ class myLevelEditor(AppShell):
         self.sideWindowCount = 1
         self.sideWindowCount = 1
         self.sideWindow.selectPage()
         self.sideWindow.selectPage()
         messenger.send('SGE_Update Explorer',[render]) ## Update the Scene Graph
         messenger.send('SGE_Update Explorer',[render]) ## Update the Scene Graph
-        
+
         pass
         pass
-        
+
     def getPhotoImage(self,name):
     def getPhotoImage(self,name):
         modpath = ConfigVariableSearchPath("model-path")
         modpath = ConfigVariableSearchPath("model-path")
         path = modpath.findFile(Filename(name))
         path = modpath.findFile(Filename(name))
@@ -338,11 +338,11 @@ class myLevelEditor(AppShell):
             i += 1
             i += 1
             button = Button(buttonFrame, image = element, command=lambda n=i : self.buttonPushed(n))
             button = Button(buttonFrame, image = element, command=lambda n=i : self.buttonPushed(n))
             button.pack(fill=X, side = LEFT)
             button.pack(fill=X, side = LEFT)
-            
+
 
 
         buttonFrame.pack(fill=X, side=LEFT,expand=True)
         buttonFrame.pack(fill=X, side=LEFT,expand=True)
-        
-        
+
+
     def buttonPushed(self, buttonIndex):
     def buttonPushed(self, buttonIndex):
         #################################################################
         #################################################################
         # buttonPushed(self, buttonNum)
         # buttonPushed(self, buttonNum)
@@ -379,7 +379,7 @@ class myLevelEditor(AppShell):
         elif buttonIndex==9: # Open Particle Panel
         elif buttonIndex==9: # Open Particle Panel
             self.openParticlePanel()
             self.openParticlePanel()
             return
             return
-        elif buttonIndex==10: 
+        elif buttonIndex==10:
             self.openInputPanel()
             self.openInputPanel()
             return
             return
         elif buttonIndex==11: # Help
         elif buttonIndex==11: # Help
@@ -412,14 +412,14 @@ class myLevelEditor(AppShell):
         elif buttonIndex==20:
         elif buttonIndex==20:
             print "You haven't defined the function for this Button, Number %d."%buttonIndex
             print "You haven't defined the function for this Button, Number %d."%buttonIndex
             return
             return
-        
+
         return
         return
 
 
     def createMenuBar(self):
     def createMenuBar(self):
         # Creates default menus.  Can be overridden or simply augmented
         # Creates default menus.  Can be overridden or simply augmented
         # Using button Add below
         # Using button Add below
         self.menuBar.addmenuitem('Help', 'command',
         self.menuBar.addmenuitem('Help', 'command',
-                                 'Get information on application', 
+                                 'Get information on application',
                                  label='About...', command=self.showAbout)
                                  label='About...', command=self.showAbout)
         ## Creat stuff inside the "File"
         ## Creat stuff inside the "File"
         self.menuBar.addmenuitem('File', 'command', 'Creat New Scene',
         self.menuBar.addmenuitem('File', 'command', 'Creat New Scene',
@@ -447,7 +447,7 @@ class myLevelEditor(AppShell):
         self.menuBar.addmenuitem('File', 'command', 'Load Actor',
         self.menuBar.addmenuitem('File', 'command', 'Load Actor',
                                 label='Load Actor',
                                 label='Load Actor',
                                 command=self.loadActor)
                                 command=self.loadActor)
-        
+
         self.menuBar.addmenuitem('File', 'separator')
         self.menuBar.addmenuitem('File', 'separator')
 
 
         self.menuBar.addmenuitem('File', 'command', 'Import a Scene',
         self.menuBar.addmenuitem('File', 'command', 'Import a Scene',
@@ -455,7 +455,7 @@ class myLevelEditor(AppShell):
                                 command=self.importScene)
                                 command=self.importScene)
 
 
         self.menuBar.addmenuitem('File', 'separator')
         self.menuBar.addmenuitem('File', 'separator')
-        
+
         self.menuBar.addmenuitem('File', 'command', 'Quit this application',
         self.menuBar.addmenuitem('File', 'command', 'Quit this application',
                                 label='Exit',
                                 label='Exit',
                                 command=self.quit)
                                 command=self.quit)
@@ -535,7 +535,7 @@ class myLevelEditor(AppShell):
             self.menuPanel.entryconfig('Animation Panel', state=DISABLED)
             self.menuPanel.entryconfig('Animation Panel', state=DISABLED)
             self.menuPanel.entryconfig('Side Window', state=DISABLED)
             self.menuPanel.entryconfig('Side Window', state=DISABLED)
 
 
-        
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         #################################################################
         #################################################################
         # If you have open any thing, please rewrite here!
         # If you have open any thing, please rewrite here!
@@ -599,7 +599,7 @@ class myLevelEditor(AppShell):
         if self.lightingPanel != None:
         if self.lightingPanel != None:
             self.lightingPanel.updateList(list)
             self.lightingPanel.updateList(list)
         return
         return
-        
+
     def lightRename(self,oName, nName):
     def lightRename(self,oName, nName):
         #################################################################
         #################################################################
         # lightRename(self,oName, nName)
         # lightRename(self,oName, nName)
@@ -613,7 +613,7 @@ class myLevelEditor(AppShell):
         if self.lightingPanel != None:
         if self.lightingPanel != None:
             self.lightingPanel.updateList(list,lightNode)
             self.lightingPanel.updateList(list,lightNode)
         return
         return
-    
+
     def lightSelect(self,lightName):
     def lightSelect(self,lightName):
         #################################################################
         #################################################################
         # lightSelect(self,lightName)
         # lightSelect(self,lightName)
@@ -627,7 +627,7 @@ class myLevelEditor(AppShell):
         if self.lightingPanel != None:
         if self.lightingPanel != None:
             self.lightingPanel.updateDisplay(lightNode)
             self.lightingPanel.updateDisplay(lightNode)
         return
         return
-    
+
     def addLight(self, type):
     def addLight(self, type):
         #################################################################
         #################################################################
         # addLight(self, type)
         # addLight(self, type)
@@ -643,7 +643,7 @@ class myLevelEditor(AppShell):
             self.lightingPanel.updateList(list,lightNode)
             self.lightingPanel.updateList(list,lightNode)
         self.makeDirty()
         self.makeDirty()
         return
         return
-    
+
     def lightingPanelClose(self):
     def lightingPanelClose(self):
         #################################################################
         #################################################################
         # lightingPanelClose(self)
         # lightingPanelClose(self)
@@ -654,7 +654,7 @@ class myLevelEditor(AppShell):
         self.menuPanel.entryconfig('Lighting Panel', state=NORMAL)
         self.menuPanel.entryconfig('Lighting Panel', state=NORMAL)
         self.lightingPanel = None
         self.lightingPanel = None
         return
         return
-    
+
     def openPropertyPanel(self, nodePath = None):
     def openPropertyPanel(self, nodePath = None):
         #################################################################
         #################################################################
         # openPropertyPanel(self, nodePath = None)
         # openPropertyPanel(self, nodePath = None)
@@ -714,7 +714,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
         # addDummyNode(self, nodepath = None)
         # addDummyNode(self, nodepath = None)
         # This function will be called when user try to create a dummy node into scene
         # This function will be called when user try to create a dummy node into scene
-        # 
+        #
         # Here we will call dataHolder to create a dummy node
         # Here we will call dataHolder to create a dummy node
         # and reparent it to the nodePath that user has assigned.
         # and reparent it to the nodePath that user has assigned.
         #
         #
@@ -727,7 +727,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
         # addCollisionObj(self, nodepath = None)
         # addCollisionObj(self, nodepath = None)
         # This function will be called when user try to create a collision object into the scene
         # This function will be called when user try to create a collision object into the scene
-        # 
+        #
         # Here we will call collisionWindow to ask user what kind of collision objects they want to have.
         # Here we will call collisionWindow to ask user what kind of collision objects they want to have.
         # Then, send the information and generated collision object to dataHolder to finish the whole process
         # Then, send the information and generated collision object to dataHolder to finish the whole process
         # and reparent it to the nodePath that user has assigned.
         # and reparent it to the nodePath that user has assigned.
@@ -757,7 +757,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
         SEditor.reparent(nodepath, fWrt = 1)
         SEditor.reparent(nodepath, fWrt = 1)
         return
         return
-    
+
     def openPlacerPanel(self, nodePath = None):
     def openPlacerPanel(self, nodePath = None):
         #################################################################
         #################################################################
         # openPlacerPanel(self, nodePath = None)
         # openPlacerPanel(self, nodePath = None)
@@ -766,7 +766,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
         if(self.placer==None):
         if(self.placer==None):
             self.placer = Placer()
             self.placer = Placer()
-            self.menuPanel.entryconfig('Placer Panel', state=DISABLED)          
+            self.menuPanel.entryconfig('Placer Panel', state=DISABLED)
         return
         return
 
 
     def closePlacerPanel(self):
     def closePlacerPanel(self):
@@ -779,7 +779,7 @@ class myLevelEditor(AppShell):
         self.placer = None
         self.placer = None
         self.menuPanel.entryconfig('Placer Panel', state=NORMAL)
         self.menuPanel.entryconfig('Placer Panel', state=NORMAL)
         return
         return
-        
+
     def openAnimPanel(self, nodePath = None):
     def openAnimPanel(self, nodePath = None):
         #################################################################
         #################################################################
         # openAnimPanel(self, nodePath = None)
         # openAnimPanel(self, nodePath = None)
@@ -819,7 +819,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
         oName = nodePath.getName() # I need this line in order to check the obj name in the control panel.
         oName = nodePath.getName() # I need this line in order to check the obj name in the control panel.
         AllScene.rename(nodePath,nName)
         AllScene.rename(nodePath,nName)
-        
+
         # reset the list in the controller panel if it has been opened.
         # reset the list in the controller panel if it has been opened.
         if (self.controllerPanel) != None:
         if (self.controllerPanel) != None:
             list = AllScene.getAllObjNameAsList()
             list = AllScene.getAllObjNameAsList()
@@ -841,7 +841,7 @@ class myLevelEditor(AppShell):
             currentModName=currentF.getBasenameWoExtension()
             currentModName=currentF.getBasenameWoExtension()
             # Let us actually remove the scene from sys modules... this is done because every scene is loaded as a module
             # Let us actually remove the scene from sys modules... this is done because every scene is loaded as a module
             # And if we reload a scene python wont reload since its already in sys.modules... and hence we delete it
             # And if we reload a scene python wont reload since its already in sys.modules... and hence we delete it
-            # If there is ever a garbage colleciton bug..this might be a point to look at 
+            # If there is ever a garbage colleciton bug..this might be a point to look at
             if sys.modules.has_key(currentModName):
             if sys.modules.has_key(currentModName):
                 del sys.modules[currentModName]
                 del sys.modules[currentModName]
                 print sys.getrefcount(AllScene.theScene)
                 print sys.getrefcount(AllScene.theScene)
@@ -856,14 +856,14 @@ class myLevelEditor(AppShell):
         # openScene(self)
         # openScene(self)
         #################################################################
         #################################################################
         # In the future try and provide merging of two scenes
         # In the future try and provide merging of two scenes
-        
+
         if(self.CurrentFileName or self.Dirty):
         if(self.CurrentFileName or self.Dirty):
             saveScene = tkMessageBox._show("Load scene","Save the current scene?",icon = tkMessageBox.QUESTION,type = tkMessageBox.YESNOCANCEL)
             saveScene = tkMessageBox._show("Load scene","Save the current scene?",icon = tkMessageBox.QUESTION,type = tkMessageBox.YESNOCANCEL)
             if (saveScene == "yes"):
             if (saveScene == "yes"):
                 self.saveScene()
                 self.saveScene()
             elif (saveScene == "cancel"):
             elif (saveScene == "cancel"):
                 return
                 return
-        
+
         self.closeAllSubWindows() ## Close all sub window
         self.closeAllSubWindows() ## Close all sub window
         if(self.CurrentFileName):
         if(self.CurrentFileName):
             currentF=Filename(self.CurrentFileName)
             currentF=Filename(self.CurrentFileName)
@@ -871,7 +871,7 @@ class myLevelEditor(AppShell):
             currentModName=currentF.getBasenameWoExtension()
             currentModName=currentF.getBasenameWoExtension()
             # Let us actually remove the scene from sys modules... this is done because every scene is loaded as a module
             # Let us actually remove the scene from sys modules... this is done because every scene is loaded as a module
             # And if we reload a scene python wont reload since its already in sys.modules... and hence we delete it
             # And if we reload a scene python wont reload since its already in sys.modules... and hence we delete it
-            # If there is ever a garbage colleciton bug..this might be a point to look at 
+            # If there is ever a garbage colleciton bug..this might be a point to look at
             if sys.modules.has_key(currentModName):
             if sys.modules.has_key(currentModName):
                 del sys.modules[currentModName]
                 del sys.modules[currentModName]
                 print sys.getrefcount(AllScene.theScene)
                 print sys.getrefcount(AllScene.theScene)
@@ -880,7 +880,7 @@ class myLevelEditor(AppShell):
             AllScene.resetAll()
             AllScene.resetAll()
 
 
         self.CurrentFileName = AllScene.loadScene()
         self.CurrentFileName = AllScene.loadScene()
-        
+
         if(self.CurrentFileName==None):
         if(self.CurrentFileName==None):
             return
             return
 
 
@@ -894,7 +894,7 @@ class myLevelEditor(AppShell):
             lightList=AllScene.getList()
             lightList=AllScene.getList()
             self.lightingPanel.updateList(lightList)
             self.lightingPanel.updateList(lightList)
         messenger.send('SGE_Update Explorer',[render])
         messenger.send('SGE_Update Explorer',[render])
-        
+
 
 
         # Close the side window in order to reset all world settings to fit the scene we have loaded.
         # Close the side window in order to reset all world settings to fit the scene we have loaded.
         self.sideWindow.quit()
         self.sideWindow.quit()
@@ -920,7 +920,7 @@ class myLevelEditor(AppShell):
         #################################################################
         #################################################################
 
 
         if(self.CurrentFileName):
         if(self.CurrentFileName):
-            f=FileSaver()       
+            f=FileSaver()
             f.SaveFile(AllScene,self.CurrentFileName,self.CurrentDirName,1)
             f.SaveFile(AllScene,self.CurrentFileName,self.CurrentDirName,1)
             self.Dirty=0
             self.Dirty=0
         else:
         else:
@@ -1012,7 +1012,7 @@ class myLevelEditor(AppShell):
             title = 'Load New Actor',
             title = 'Load New Actor',
             parent = self.parent)
             parent = self.parent)
 
 
-        
+
         if ActorFilename:
         if ActorFilename:
             self.makeDirty()
             self.makeDirty()
             if not AllScene.loadActor(ActorFilename, Filename.fromOsSpecific(ActorFilename)):
             if not AllScene.loadActor(ActorFilename, Filename.fromOsSpecific(ActorFilename)):
@@ -1028,7 +1028,7 @@ class myLevelEditor(AppShell):
     ## Take care those things under Edit nemu
     ## Take care those things under Edit nemu
     def unDo(self):
     def unDo(self):
         pass
         pass
-    
+
     def reDo(self):
     def reDo(self):
         pass
         pass
 
 
@@ -1064,7 +1064,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to add a dummy into the scene.
         # to add a dummy into the scene.
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         #################################################################
         #################################################################
         self.addDummyNode(self.nodeSelected)
         self.addDummyNode(self.nodeSelected)
@@ -1076,7 +1076,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to open the duplication window.
         # to open the duplication window.
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         #################################################################
         #################################################################
         if self.nodeSelected!=None:
         if self.nodeSelected!=None:
@@ -1089,7 +1089,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to remove the current selected node..
         # to remove the current selected node..
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         self.remove(self.nodeSelected)
         self.remove(self.nodeSelected)
@@ -1101,11 +1101,11 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to open the property window of current selected node..
         # to open the property window of current selected node..
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         self.openPropertyPanel(self.nodeSelected)
         self.openPropertyPanel(self.nodeSelected)
-        pass 
+        pass
 
 
     def showCameraSetting(self):
     def showCameraSetting(self):
         ################################################################
         ################################################################
@@ -1113,7 +1113,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to open the property window of camera..
         # to open the property window of camera..
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         self.openPropertyPanel(camera)
         self.openPropertyPanel(camera)
@@ -1145,20 +1145,20 @@ class myLevelEditor(AppShell):
             self.sideWindowCount = 1
             self.sideWindowCount = 1
             self.menuPanel.entryconfig('Side Window', state=DISABLED)
             self.menuPanel.entryconfig('Side Window', state=DISABLED)
         return
         return
-    
+
     def openAnimationPanel(self):
     def openAnimationPanel(self):
         ################################################################
         ################################################################
         # openAnimationPanel(self)
         # openAnimationPanel(self)
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to open the animation window for selected node(if it is an Actor)..
         # to open the animation window for selected node(if it is an Actor)..
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         if AllScene.isActor(self.nodeSelected):
         if AllScene.isActor(self.nodeSelected):
             self.openAnimPanel(self.nodeSelected)
             self.openAnimPanel(self.nodeSelected)
         pass
         pass
-    
+
     def openMopathPanel(self):
     def openMopathPanel(self):
         ################################################################
         ################################################################
         # openMopathPanel(self)
         # openMopathPanel(self)
@@ -1178,7 +1178,7 @@ class myLevelEditor(AppShell):
         self.ParticleEnable = visable
         self.ParticleEnable = visable
         AllScene.toggleParticleVisable(visable)
         AllScene.toggleParticleVisable(visable)
         return
         return
-    
+
     def openLightingPanel(self):
     def openLightingPanel(self):
         ################################################################
         ################################################################
         # openLightingPanel(self)
         # openLightingPanel(self)
@@ -1189,7 +1189,7 @@ class myLevelEditor(AppShell):
             self.lightingPanel = lightingPanel(AllScene.getLightList())
             self.lightingPanel = lightingPanel(AllScene.getLightList())
             self.menuPanel.entryconfig('Lighting Panel', state=DISABLED)
             self.menuPanel.entryconfig('Lighting Panel', state=DISABLED)
         return
         return
-    
+
     def addParticleEffect(self,effect_name,effect,node):
     def addParticleEffect(self,effect_name,effect,node):
         AllScene.particleDict[effect_name]=effect
         AllScene.particleDict[effect_name]=effect
         AllScene.particleNodes[effect_name]=node
         AllScene.particleNodes[effect_name]=node
@@ -1215,7 +1215,7 @@ class myLevelEditor(AppShell):
     def closeParticlePanel(self):
     def closeParticlePanel(self):
         self.particlePanel = None
         self.particlePanel = None
         return
         return
-    
+
     def openInputPanel(self):
     def openInputPanel(self):
         if self.controllerPanel==None:
         if self.controllerPanel==None:
             list = AllScene.getAllObjNameAsList()
             list = AllScene.getAllObjNameAsList()
@@ -1237,10 +1237,10 @@ class myLevelEditor(AppShell):
         # set it back into controller panel
         # set it back into controller panel
         ################################################################
         ################################################################
         node = AllScene.getObjFromSceneByName(name)
         node = AllScene.getObjFromSceneByName(name)
-        
+
         if (self.controllerPanel) != None and (node!=None):
         if (self.controllerPanel) != None and (node!=None):
             self.controllerPanel.setNodePathIn(node)
             self.controllerPanel.setNodePathIn(node)
-            
+
         return
         return
 
 
     def setControlSet(self, controlType, dataList):
     def setControlSet(self, controlType, dataList):
@@ -1260,7 +1260,7 @@ class myLevelEditor(AppShell):
             # Also this will make sure we won't catch wrong keyboard message
             # Also this will make sure we won't catch wrong keyboard message
             self.stopControl(controlType)
             self.stopControl(controlType)
             self.enableControl = True
             self.enableControl = True
-        
+
         self.setControlSet(controlType, dataList)
         self.setControlSet(controlType, dataList)
         self.lastContorlTimer = globalClock.getFrameTime()
         self.lastContorlTimer = globalClock.getFrameTime()
         if controlType == 'Keyboard':
         if controlType == 'Keyboard':
@@ -1327,7 +1327,7 @@ class myLevelEditor(AppShell):
         self.controlTarget.setScale(newScale.getX(),newScale.getY(),newScale.getZ())
         self.controlTarget.setScale(newScale.getX(),newScale.getY(),newScale.getZ())
         self.transNodeKeyboard.setPosHpr(0,0,0,0,0,0)
         self.transNodeKeyboard.setPosHpr(0,0,0,0,0,0)
         return Task.cont
         return Task.cont
-    
+
     ## Misc
     ## Misc
     ##### This one get the event from SGE (Scene Graph Explorer) and Picking
     ##### This one get the event from SGE (Scene Graph Explorer) and Picking
     def selectNode(self, nodePath=None, callBack = True):
     def selectNode(self, nodePath=None, callBack = True):
@@ -1428,7 +1428,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to delete selected node...
         # to delete selected node...
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         self.deSelectNode(self.nodeSelected)
         self.deSelectNode(self.nodeSelected)
@@ -1444,7 +1444,7 @@ class myLevelEditor(AppShell):
         self.makeDirty()
         self.makeDirty()
         AllScene.toggleLight()
         AllScene.toggleLight()
         return
         return
-    
+
     def sideWindowClose(self,worldColor,lightEnable,ParticleEnable, basedriveEnable,collision,
     def sideWindowClose(self,worldColor,lightEnable,ParticleEnable, basedriveEnable,collision,
                         backface, texture, wireframe, grid, widgetVis, enableAutoCamera):
                         backface, texture, wireframe, grid, widgetVis, enableAutoCamera):
         ################################################################
         ################################################################
@@ -1478,7 +1478,7 @@ class myLevelEditor(AppShell):
         # This function will do nothing but call other function
         # This function will do nothing but call other function
         # to duplicate selected node...
         # to duplicate selected node...
         #
         #
-        # Ok... this is really redundancy... 
+        # Ok... this is really redundancy...
         #
         #
         ################################################################
         ################################################################
         AllScene.duplicateObj(nodePath, pos, hpr, scale, num)
         AllScene.duplicateObj(nodePath, pos, hpr, scale, num)
@@ -1685,11 +1685,11 @@ class myLevelEditor(AppShell):
             t.doneColor = doneColor
             t.doneColor = doneColor
             # This really does all the work
             # This really does all the work
             t.uponDeath = self.flashDone
             t.uponDeath = self.flashDone
-            
+
     def flashDummy(self, state):
     def flashDummy(self, state):
         # Real work is done in upon death function
         # Real work is done in upon death function
         return Task.done
         return Task.done
-        
+
     def flashDone(self,state):
     def flashDone(self,state):
         # Return node Path to original state
         # Return node Path to original state
         if state.nodePath.isEmpty():
         if state.nodePath.isEmpty():
@@ -1701,7 +1701,7 @@ class myLevelEditor(AppShell):
             state.nodePath.clearColor()
             state.nodePath.clearColor()
 
 
 
 
-    
+
 
 
 editor = myLevelEditor(parent = base.tkRoot)
 editor = myLevelEditor(parent = base.tkRoot)
 
 

+ 14 - 14
contrib/src/sceneeditor/seAnimPanel.py

@@ -31,7 +31,7 @@ class AnimPanel(AppShell):
     dragMode = False
     dragMode = False
     rateList= ['1/24.0', '0.1', '0.5', '1.0', '2.0', '5.0' , '10.0']
     rateList= ['1/24.0', '0.1', '0.5', '1.0', '2.0', '5.0' , '10.0']
 
 
-    
+
     def __init__(self, aNode =  None, parent = None, **kw):
     def __init__(self, aNode =  None, parent = None, **kw):
         INITOPT = Pmw.INITOPT
         INITOPT = Pmw.INITOPT
         self.id = 'AnimPanel '+ aNode.getName()
         self.id = 'AnimPanel '+ aNode.getName()
@@ -63,7 +63,7 @@ class AnimPanel(AppShell):
         menuBar = self.menuBar
         menuBar = self.menuBar
 
 
         menuBar.addmenu('Anim', 'Anim Panel Operations')
         menuBar.addmenu('Anim', 'Anim Panel Operations')
-        
+
         # Reset all actor controls
         # Reset all actor controls
         menuBar.addmenuitem('File', 'command',
         menuBar.addmenuitem('File', 'command',
                             'Load Animation',
                             'Load Animation',
@@ -102,7 +102,7 @@ class AnimPanel(AppShell):
             scrolledlist_items = self['animList'])
             scrolledlist_items = self['animList'])
         self.AnimEntry.place(x=240,y=10,anchor=NW)
         self.AnimEntry.place(x=240,y=10,anchor=NW)
 
 
-        
+
         self.playRateEntry = self.createcomponent(
         self.playRateEntry = self.createcomponent(
             'playRateMenu', (), None,
             'playRateMenu', (), None,
             Pmw.ComboBox, (actorFrame,),
             Pmw.ComboBox, (actorFrame,),
@@ -133,7 +133,7 @@ class AnimPanel(AppShell):
             command = self.updateDisplay,
             command = self.updateDisplay,
             variable = self.unitsVar)
             variable = self.unitsVar)
         self.displayButton.place(x=120,y=77,anchor=NW)
         self.displayButton.place(x=120,y=77,anchor=NW)
-        
+
         ## scale control
         ## scale control
         frameFrame = Frame(actorFrame, relief = SUNKEN, bd = 1)
         frameFrame = Frame(actorFrame, relief = SUNKEN, bd = 1)
         self.minLabel = self.createcomponent(
         self.minLabel = self.createcomponent(
@@ -158,7 +158,7 @@ class AnimPanel(AppShell):
             text = 24)
             text = 24)
         self.maxLabel.pack(side = LEFT)
         self.maxLabel.pack(side = LEFT)
         frameFrame.pack(side = LEFT, expand = 1, fill = X)
         frameFrame.pack(side = LEFT, expand = 1, fill = X)
-        
+
         ## button contorl
         ## button contorl
         ButtomFrame = Frame(actorFrame, relief = SUNKEN, bd = 1,borderwidth=5)
         ButtomFrame = Frame(actorFrame, relief = SUNKEN, bd = 1,borderwidth=5)
         self.toStartButton = self.createcomponent(
         self.toStartButton = self.createcomponent(
@@ -168,7 +168,7 @@ class AnimPanel(AppShell):
             width = 8,
             width = 8,
             command = self.resetAllToZero)
             command = self.resetAllToZero)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
-        
+
         self.playButton = self.createcomponent(
         self.playButton = self.createcomponent(
             'playButton', (), None,
             'playButton', (), None,
             Button, (ButtomFrame,),
             Button, (ButtomFrame,),
@@ -214,14 +214,14 @@ class AnimPanel(AppShell):
         #################################################################
         #################################################################
         # updateList(self)
         # updateList(self)
         # This function will update the list of animations that the Actor
         # This function will update the list of animations that the Actor
-        # currently has into the combo box widget. 
+        # currently has into the combo box widget.
         #################################################################
         #################################################################
         self.ignore('DataH_loadFinish'+self.nodeName)
         self.ignore('DataH_loadFinish'+self.nodeName)
         del self.loaderWindow
         del self.loaderWindow
         self['animList'] = self['actor'].getAnimNames()
         self['animList'] = self['actor'].getAnimNames()
         animL = self['actor'].getAnimNames()
         animL = self['actor'].getAnimNames()
         self.AnimEntry.setlist(animL)
         self.AnimEntry.setlist(animL)
-            
+
 
 
     def removeAnim(self):
     def removeAnim(self):
         #################################################################
         #################################################################
@@ -308,7 +308,7 @@ class AnimPanel(AppShell):
                 self.stopButton.config(state=DISABLED)
                 self.stopButton.config(state=DISABLED)
                 return Task.done
                 return Task.done
         else:
         else:
-            self.gotoT(self.currTime)    
+            self.gotoT(self.currTime)
         return Task.cont
         return Task.cont
 
 
     def stop(self):
     def stop(self):
@@ -329,7 +329,7 @@ class AnimPanel(AppShell):
         # the current animation. Most important thing this function do is
         # the current animation. Most important thing this function do is
         # to recalculate all variables to fit the selected animation
         # to recalculate all variables to fit the selected animation
         #################################################################
         #################################################################
-        self.animName = self.AnimEntry.get()        
+        self.animName = self.AnimEntry.get()
         playRate = '%0.1f' % self['actor'].getPlayRate(self.animName)
         playRate = '%0.1f' % self['actor'].getPlayRate(self.animName)
         if playRate not in self.rateList:
         if playRate not in self.rateList:
             def strCmp(a, b):
             def strCmp(a, b):
@@ -376,7 +376,7 @@ class AnimPanel(AppShell):
         else:
         else:
             self.minLabel['text'] = '0.0'
             self.minLabel['text'] = '0.0'
             self.maxLabel['text'] = "%.2f" % self.duration
             self.maxLabel['text'] = "%.2f" % self.duration
-            self.frameControl.configure(from_ = 0.0, 
+            self.frameControl.configure(from_ = 0.0,
                                         to = self.duration,
                                         to = self.duration,
                                         resolution = 0.01)
                                         resolution = 0.01)
 
 
@@ -429,7 +429,7 @@ class AnimPanel(AppShell):
         #################################################################
         #################################################################
         self.dragMode = True
         self.dragMode = True
         return
         return
-    
+
     def resetAllToZero(self):
     def resetAllToZero(self):
         #################################################################
         #################################################################
         # resetAllToZero(self)
         # resetAllToZero(self)
@@ -536,8 +536,8 @@ class LoadAnimPanel(AppShell):
 
 
         mainFrame.pack(expand = 1, fill = BOTH)
         mainFrame.pack(expand = 1, fill = BOTH)
 
 
-        
-        
+
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         messenger.send('AWL_close',[self.nodeName])
         messenger.send('AWL_close',[self.nodeName])
         '''
         '''

+ 16 - 16
contrib/src/sceneeditor/seBlendAnimPanel.py

@@ -36,7 +36,7 @@ class BlendAnimPanel(AppShell):
     enableBlend = False
     enableBlend = False
     currentBlendName = None
     currentBlendName = None
 
 
-    
+
     def __init__(self, aNode =  None, blendDict={}, parent = None, **kw):
     def __init__(self, aNode =  None, blendDict={}, parent = None, **kw):
         INITOPT = Pmw.INITOPT
         INITOPT = Pmw.INITOPT
         self.id = 'BlendAnimPanel '+ aNode.getName()
         self.id = 'BlendAnimPanel '+ aNode.getName()
@@ -95,7 +95,7 @@ class BlendAnimPanel(AppShell):
         self.blendAnimEntry.pack(side=LEFT)
         self.blendAnimEntry.pack(side=LEFT)
 
 
         Label(actorFrame, text= "   ", font=('MSSansSerif', 10)).pack(side=LEFT)
         Label(actorFrame, text= "   ", font=('MSSansSerif', 10)).pack(side=LEFT)
-        
+
         button = Button(actorFrame, text="Save", font=('MSSansSerif', 10),width = 12,
         button = Button(actorFrame, text="Save", font=('MSSansSerif', 10),width = 12,
                         command = self.saveButtonPushed).pack(side=LEFT)
                         command = self.saveButtonPushed).pack(side=LEFT)
         button = Button(actorFrame, text="Remove", font=('MSSansSerif', 10),width = 12,
         button = Button(actorFrame, text="Remove", font=('MSSansSerif', 10),width = 12,
@@ -130,7 +130,7 @@ class BlendAnimPanel(AppShell):
             scrolledlist_items = self['animList'])
             scrolledlist_items = self['animList'])
         self.AnimEntryB.pack(side=LEFT)
         self.AnimEntryB.pack(side=LEFT)
         actorFrame.pack(side = TOP, expand = False, fill = X)
         actorFrame.pack(side = TOP, expand = False, fill = X)
-        
+
         ### Blend Enable checkbox
         ### Blend Enable checkbox
         actorFrame = Frame(interior, relief = SUNKEN, bd = 1)
         actorFrame = Frame(interior, relief = SUNKEN, bd = 1)
         Label(actorFrame, text= "Enable Blending:", font=('MSSansSerif', 10)).pack(side=LEFT,)
         Label(actorFrame, text= "Enable Blending:", font=('MSSansSerif', 10)).pack(side=LEFT,)
@@ -182,7 +182,7 @@ class BlendAnimPanel(AppShell):
         self.playRateEntry.pack(side=LEFT)
         self.playRateEntry.pack(side=LEFT)
         self.playRateEntry.selectitem('1.0')
         self.playRateEntry.selectitem('1.0')
 
 
-        ### Loop checkbox        
+        ### Loop checkbox
         Label(actorFrame, text= "   ", font=('MSSansSerif', 10)).pack(side=LEFT,)
         Label(actorFrame, text= "   ", font=('MSSansSerif', 10)).pack(side=LEFT,)
         Label(actorFrame, text= "Loop:", font=('MSSansSerif', 10)).pack(side=LEFT,)
         Label(actorFrame, text= "Loop:", font=('MSSansSerif', 10)).pack(side=LEFT,)
 
 
@@ -193,14 +193,14 @@ class BlendAnimPanel(AppShell):
             Checkbutton, (actorFrame,),
             Checkbutton, (actorFrame,),
             variable = self.loopVar)
             variable = self.loopVar)
         self.loopButton.pack(side=LEFT)
         self.loopButton.pack(side=LEFT)
-        
+
         actorFrame.pack(side = TOP, expand = True, fill = X)
         actorFrame.pack(side = TOP, expand = True, fill = X)
 
 
-        
-        
+
+
         ### Display Frames/Seconds
         ### Display Frames/Seconds
         actorFrame = Frame(interior)
         actorFrame = Frame(interior)
-        
+
         Label(actorFrame, text= "Frame/Second:", font=('MSSansSerif', 10)).pack(side=LEFT)
         Label(actorFrame, text= "Frame/Second:", font=('MSSansSerif', 10)).pack(side=LEFT)
 
 
         self.unitsVar = IntVar()
         self.unitsVar = IntVar()
@@ -213,7 +213,7 @@ class BlendAnimPanel(AppShell):
         self.displayButton.pack(side=LEFT)
         self.displayButton.pack(side=LEFT)
 
 
         actorFrame.pack(side = TOP, expand = True, fill = X)
         actorFrame.pack(side = TOP, expand = True, fill = X)
-        
+
         ## scale control
         ## scale control
         actorFrame = Frame(interior)
         actorFrame = Frame(interior)
         frameFrame = Frame(actorFrame, relief = SUNKEN, bd = 1)
         frameFrame = Frame(actorFrame, relief = SUNKEN, bd = 1)
@@ -240,7 +240,7 @@ class BlendAnimPanel(AppShell):
         self.maxLabel.pack(side = LEFT)
         self.maxLabel.pack(side = LEFT)
         frameFrame.pack(side = LEFT, expand = 1, fill = X)
         frameFrame.pack(side = LEFT, expand = 1, fill = X)
         actorFrame.pack(side = TOP, expand = True, fill = X)
         actorFrame.pack(side = TOP, expand = True, fill = X)
-        
+
         ## button contorl
         ## button contorl
         actorFrame = Frame(interior)
         actorFrame = Frame(interior)
         ButtomFrame = Frame(actorFrame, relief = SUNKEN, bd = 1,borderwidth=5)
         ButtomFrame = Frame(actorFrame, relief = SUNKEN, bd = 1,borderwidth=5)
@@ -251,7 +251,7 @@ class BlendAnimPanel(AppShell):
             width = 8,
             width = 8,
             command = self.resetAllToZero)
             command = self.resetAllToZero)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
         self.toStartButton.pack(side = LEFT, expand = 1, fill = X)
-        
+
         self.playButton = self.createcomponent(
         self.playButton = self.createcomponent(
             'playButton', (), None,
             'playButton', (), None,
             Button, (ButtomFrame,),
             Button, (ButtomFrame,),
@@ -287,7 +287,7 @@ class BlendAnimPanel(AppShell):
         animL = self['actor'].getAnimNames()
         animL = self['actor'].getAnimNames()
         self.AnimEntryA.setlist(animL)
         self.AnimEntryA.setlist(animL)
         self.AnimEntryB.setlist(animL)
         self.AnimEntryB.setlist(animL)
-            
+
     def play(self):
     def play(self):
         #################################################################
         #################################################################
         # play(self)
         # play(self)
@@ -330,7 +330,7 @@ class BlendAnimPanel(AppShell):
                 self.stopButton.config(state=DISABLED)
                 self.stopButton.config(state=DISABLED)
                 return Task.done
                 return Task.done
         else:
         else:
-            self.gotoT(self.currTime)    
+            self.gotoT(self.currTime)
         return Task.cont
         return Task.cont
 
 
     def stop(self):
     def stop(self):
@@ -405,7 +405,7 @@ class BlendAnimPanel(AppShell):
         else:
         else:
             self.minLabel['text'] = '0.0'
             self.minLabel['text'] = '0.0'
             self.maxLabel['text'] = "%.2f" % self.duration
             self.maxLabel['text'] = "%.2f" % self.duration
-            self.frameControl.configure(from_ = 0.0, 
+            self.frameControl.configure(from_ = 0.0,
                                         to = self.duration,
                                         to = self.duration,
                                         resolution = 0.01)
                                         resolution = 0.01)
 
 
@@ -454,7 +454,7 @@ class BlendAnimPanel(AppShell):
         #################################################################
         #################################################################
         self.dragMode = True
         self.dragMode = True
         return
         return
-    
+
     def resetAllToZero(self):
     def resetAllToZero(self):
         #################################################################
         #################################################################
         # resetAllToZero(self)
         # resetAllToZero(self)
@@ -559,7 +559,7 @@ class BlendAnimPanel(AppShell):
                 self.blendAnimEntry.clear()
                 self.blendAnimEntry.clear()
                 self.currentBlendName = None
                 self.currentBlendName = None
         return
         return
-    
+
     def saveButtonPushed(self):
     def saveButtonPushed(self):
         #################################################################
         #################################################################
         # saveButtonPushed(self)
         # saveButtonPushed(self)

+ 13 - 13
contrib/src/sceneeditor/seCameraControl.py

@@ -290,7 +290,7 @@ class DirectCameraControl(DirectObject):
     def lockCOA(self):
     def lockCOA(self):
         self.fLockCOA = 1
         self.fLockCOA = 1
         SEditor.message('COA Lock On')
         SEditor.message('COA Lock On')
-            
+
     def unlockCOA(self):
     def unlockCOA(self):
         self.fLockCOA = 0
         self.fLockCOA = 0
         SEditor.message('COA Lock Off')
         SEditor.message('COA Lock Off')
@@ -456,7 +456,7 @@ class DirectCameraControl(DirectObject):
 
 
     def centerCam(self):
     def centerCam(self):
         self.centerCamIn(1.0)
         self.centerCamIn(1.0)
-        
+
     def centerCamNow(self):
     def centerCamNow(self):
         self.centerCamIn(0.)
         self.centerCamIn(0.)
 
 
@@ -493,7 +493,7 @@ class DirectCameraControl(DirectObject):
                                   blendType = 'easeInOut',
                                   blendType = 'easeInOut',
                                   task = 'manipulateCamera')
                                   task = 'manipulateCamera')
         t.uponDeath = self.updateCoaMarkerSizeOnDeath
         t.uponDeath = self.updateCoaMarkerSizeOnDeath
-        
+
     def spawnMoveToView(self, view):
     def spawnMoveToView(self, view):
         # Kill any existing tasks
         # Kill any existing tasks
         taskMgr.remove('manipulateCamera')
         taskMgr.remove('manipulateCamera')
@@ -527,7 +527,7 @@ class DirectCameraControl(DirectObject):
         self.camManipRef.setPosHpr(self.coaMarker, ZERO_VEC,
         self.camManipRef.setPosHpr(self.coaMarker, ZERO_VEC,
                                    hprOffset)
                                    hprOffset)
         # Scale center vec by current distance to target
         # Scale center vec by current distance to target
-        offsetDistance = Vec3(SEditor.camera.getPos(self.camManipRef) - 
+        offsetDistance = Vec3(SEditor.camera.getPos(self.camManipRef) -
                               ZERO_POINT).length()
                               ZERO_POINT).length()
         scaledCenterVec = Y_AXIS * (-1.0 * offsetDistance)
         scaledCenterVec = Y_AXIS * (-1.0 * offsetDistance)
         # Now put the camManipRef at that point
         # Now put the camManipRef at that point
@@ -543,15 +543,15 @@ class DirectCameraControl(DirectObject):
                                      blendType = 'easeInOut',
                                      blendType = 'easeInOut',
                                      task = 'manipulateCamera')
                                      task = 'manipulateCamera')
         t.uponDeath = self.updateCoaMarkerSizeOnDeath
         t.uponDeath = self.updateCoaMarkerSizeOnDeath
-        
-        
+
+
     def swingCamAboutWidget(self, degrees, t):
     def swingCamAboutWidget(self, degrees, t):
         # Remove existing camera manipulation task
         # Remove existing camera manipulation task
         taskMgr.remove('manipulateCamera')
         taskMgr.remove('manipulateCamera')
 
 
         # Record undo point
         # Record undo point
         SEditor.pushUndo([SEditor.camera])
         SEditor.pushUndo([SEditor.camera])
-        
+
         # Coincident with widget
         # Coincident with widget
         self.camManipRef.setPos(self.coaMarker, ZERO_POINT)
         self.camManipRef.setPos(self.coaMarker, ZERO_POINT)
         # But aligned with render space
         # But aligned with render space
@@ -584,16 +584,16 @@ class DirectCameraControl(DirectObject):
         # At what distance does the object fill 30% of the screen?
         # At what distance does the object fill 30% of the screen?
         # Assuming radius of 1 on widget
         # Assuming radius of 1 on widget
         camY = SEditor.dr.near * (2.0 * maxScale)/(0.3 * maxDim)
         camY = SEditor.dr.near * (2.0 * maxScale)/(0.3 * maxDim)
-    
+
         # What is the vector through the center of the screen?
         # What is the vector through the center of the screen?
         centerVec = Y_AXIS * camY
         centerVec = Y_AXIS * camY
-    
+
         # Where is the node relative to the viewpoint
         # Where is the node relative to the viewpoint
         vWidget2Camera = SEditor.widget.getPos(SEditor.camera)
         vWidget2Camera = SEditor.widget.getPos(SEditor.camera)
-    
+
         # How far do you move the camera to be this distance from the node?
         # How far do you move the camera to be this distance from the node?
         deltaMove = vWidget2Camera - centerVec
         deltaMove = vWidget2Camera - centerVec
-    
+
         # Move a target there
         # Move a target there
         self.camManipRef.setPos(SEditor.camera, deltaMove)
         self.camManipRef.setPos(SEditor.camera, deltaMove)
 
 
@@ -605,7 +605,7 @@ class DirectCameraControl(DirectObject):
                                         task = 'manipulateCamera')
                                         task = 'manipulateCamera')
         # Upon death, reparent Cam to parent
         # Upon death, reparent Cam to parent
         fitTask.parent = parent
         fitTask.parent = parent
-        fitTask.uponDeath = self.reparentCam                                
+        fitTask.uponDeath = self.reparentCam
 
 
     def moveToFit(self):
     def moveToFit(self):
         # How bit is the active widget?
         # How bit is the active widget?
@@ -629,7 +629,7 @@ class DirectCameraControl(DirectObject):
         # Spawn a task to move the widget
         # Spawn a task to move the widget
         t = SEditor.widget.lerpPos(Point3(centerVec),
         t = SEditor.widget.lerpPos(Point3(centerVec),
                                   CAM_MOVE_DURATION,
                                   CAM_MOVE_DURATION,
-                                  other = SEditor.camera, 
+                                  other = SEditor.camera,
                                   blendType = 'easeInOut',
                                   blendType = 'easeInOut',
                                   task = 'moveToFitTask')
                                   task = 'moveToFitTask')
         t.uponDeath = lambda state: taskMgr.remove('stickToWidget')
         t.uponDeath = lambda state: taskMgr.remove('stickToWidget')

+ 86 - 86
contrib/src/sceneeditor/seFileSaver.py

@@ -1,7 +1,7 @@
-####################################################################################################################################################    
-# File Saving 
+####################################################################################################################################################
+# File Saving
 # This code saves the scene out as python code... the scene is stored in the various dictionaries in "dataHolder.py" ...the class "AllScene"
 # This code saves the scene out as python code... the scene is stored in the various dictionaries in "dataHolder.py" ...the class "AllScene"
-# 
+#
 ####################################################################################################################################################
 ####################################################################################################################################################
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 
 
@@ -21,12 +21,12 @@ import seForceGroup
 
 
 class FileSaver:
 class FileSaver:
 
 
-    ####################################################################################################################################################    
+    ####################################################################################################################################################
     # This class saves out the scene built with the scene editor as python code
     # This class saves out the scene built with the scene editor as python code
     # There are dictionaries saved out to save the state of the scene for reloading it with the editor
     # There are dictionaries saved out to save the state of the scene for reloading it with the editor
     # Currently saving is supported for Models, Animations, Lights, Dummy Nodes
     # Currently saving is supported for Models, Animations, Lights, Dummy Nodes
     # Attributes like parenting are also saved out
     # Attributes like parenting are also saved out
-    # This class is actually instantiated in sceneEditor.py in the saveScene() method 
+    # This class is actually instantiated in sceneEditor.py in the saveScene() method
     ####################################################################################################################################################
     ####################################################################################################################################################
 
 
     def __init(self):
     def __init(self):
@@ -34,11 +34,11 @@ class FileSaver:
 
 
     def SaveFile(self,AllScene,filename,dirname,reSaveFlag=0):
     def SaveFile(self,AllScene,filename,dirname,reSaveFlag=0):
 
 
-      ################################################################################################################################################  
+      ################################################################################################################################################
         # This function takes the "dataHolder" instance "AllScene" which has dictionaries containing scene information
         # This function takes the "dataHolder" instance "AllScene" which has dictionaries containing scene information
         # The filename is where the scene will be written to
         # The filename is where the scene will be written to
         ################################################################################################################################################
         ################################################################################################################################################
-        
+
         i1="    " # indentation
         i1="    " # indentation
         i2=i1+i1  # double indentation
         i2=i1+i1  # double indentation
         out_file = open(filename,"w")
         out_file = open(filename,"w")
@@ -57,7 +57,7 @@ class FileSaver:
         out_file.write("# theScene=SavedScene() #instantiate the class\n")
         out_file.write("# theScene=SavedScene() #instantiate the class\n")
         out_file.write("# IMPORTANT: All the documentation below refers to \"theScene\" as the instance of SavedScene()\n")
         out_file.write("# IMPORTANT: All the documentation below refers to \"theScene\" as the instance of SavedScene()\n")
         out_file.write("##########################################################################################################\n\n")
         out_file.write("##########################################################################################################\n\n")
-        
+
         out_file.write("##########################################################################################################\n")
         out_file.write("##########################################################################################################\n")
         out_file.write("# Import Panda Modules\n")
         out_file.write("# Import Panda Modules\n")
         out_file.write("##########################################################################################################\n")
         out_file.write("##########################################################################################################\n")
@@ -146,7 +146,7 @@ class FileSaver:
         for model in AllScene.ModelDic:
         for model in AllScene.ModelDic:
             out_file.write("\n")
             out_file.write("\n")
             modelS=str(model)
             modelS=str(model)
-            
+
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
                 #Loading Code
                 #Loading Code
                 out_file.write(i2+"# Loading model's egg file\n")
                 out_file.write(i2+"# Loading model's egg file\n")
@@ -165,33 +165,33 @@ class FileSaver:
                 for index in range(textures.getNumTextures()):
                 for index in range(textures.getNumTextures()):
                     texture=textures.getTexture(index)
                     texture=textures.getTexture(index)
                     texfilename=texture.getFilename()
                     texfilename=texture.getFilename()
-                    fnamelist.append(texfilename.getFullpath())   
+                    fnamelist.append(texfilename.getFullpath())
                     oldFilename=Filename(Filename(AllScene.ModelRefDic[model].getDirname()),texfilename)
                     oldFilename=Filename(Filename(AllScene.ModelRefDic[model].getDirname()),texfilename)
                     if(not oldFilename.isRegularFile()):
                     if(not oldFilename.isRegularFile()):
                         if(texfilename.resolveFilename(getTexturePath(),"")):
                         if(texfilename.resolveFilename(getTexturePath(),"")):
                             oldFilename=texfilename
                             oldFilename=texfilename
                     oldtexpath=oldFilename.toOsSpecific()
                     oldtexpath=oldFilename.toOsSpecific()
-                
+
                     newtexpath=dirname + "/" + texfilename.getBasename()
                     newtexpath=dirname + "/" + texfilename.getBasename()
                     newtexpathF=Filename(newtexpath)
                     newtexpathF=Filename(newtexpath)
                     newtexpathSpecific=newtexpathF.toOsSpecific()
                     newtexpathSpecific=newtexpathF.toOsSpecific()
-                    
+
                     print "TEXTURE SAVER:: copying" + oldtexpath + " to " + newtexpathSpecific
                     print "TEXTURE SAVER:: copying" + oldtexpath + " to " + newtexpathSpecific
                     if(oldtexpath != newtexpathSpecific):
                     if(oldtexpath != newtexpathSpecific):
                         shutil.copyfile(oldtexpath,newtexpathSpecific)
                         shutil.copyfile(oldtexpath,newtexpathSpecific)
 
 
-                    
-                
-                    
 
 
-                
+
+
+
+
                 # Copy the file over to the relative directory
                 # Copy the file over to the relative directory
                 oldModelpath=AllScene.ModelRefDic[model].toOsSpecific()
                 oldModelpath=AllScene.ModelRefDic[model].toOsSpecific()
-                print "FILESAVER:: copying from " + AllScene.ModelRefDic[model].toOsSpecific() + "to" + newpathSpecific 
+                print "FILESAVER:: copying from " + AllScene.ModelRefDic[model].toOsSpecific() + "to" + newpathSpecific
                 if(oldModelpath!=newpathSpecific):
                 if(oldModelpath!=newpathSpecific):
                     shutil.copyfile(oldModelpath,newpathSpecific)
                     shutil.copyfile(oldModelpath,newpathSpecific)
 
 
-                
+
                 e=EggData()
                 e=EggData()
                 e.read(AllScene.ModelRefDic[model])
                 e.read(AllScene.ModelRefDic[model])
                 etc=EggTextureCollection()
                 etc=EggTextureCollection()
@@ -203,10 +203,10 @@ class FileSaver:
                     fn.setDirname("")
                     fn.setDirname("")
                     tex.setFilename(fn)
                     tex.setFilename(fn)
                     e.writeEgg(Filename.fromOsSpecific(newpathSpecific))
                     e.writeEgg(Filename.fromOsSpecific(newpathSpecific))
-                
 
 
 
 
-                out_file.write(i2+"if(self.loadmode==1):\n")    
+
+                out_file.write(i2+"if(self.loadmode==1):\n")
                 out_file.write(i2+i1+ "self."+ modelS + "=loader.loadModel(\'" + self.savepath + "/" +  AllScene.ModelRefDic[model].getBasename() + "')\n")#Relative Path
                 out_file.write(i2+i1+ "self."+ modelS + "=loader.loadModel(\'" + self.savepath + "/" +  AllScene.ModelRefDic[model].getBasename() + "')\n")#Relative Path
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+i1+ "self."+ modelS + "=loader.loadModel(self.executionpath + \'/" +  AllScene.ModelRefDic[model].getBasename() + "')\n")#Relative Path with execution point specified by the invoking-level-editor
                 out_file.write(i2+i1+ "self."+ modelS + "=loader.loadModel(self.executionpath + \'/" +  AllScene.ModelRefDic[model].getBasename() + "')\n")#Relative Path with execution point specified by the invoking-level-editor
@@ -221,7 +221,7 @@ class FileSaver:
                     out_file.write(i2+"# Alpha\n")
                     out_file.write(i2+"# Alpha\n")
                     out_file.write(i2+ "self."+ modelS + ".setTransparency(1)\n")
                     out_file.write(i2+ "self."+ modelS + ".setTransparency(1)\n")
                     clr=AllScene.ModelDic[model].getColor()
                     clr=AllScene.ModelDic[model].getColor()
-                    out_file.write(i2+ "self."+ modelS + ".setColor(%.4f,%.4f,%.4f,%.4f)\n"%(clr.getX(),clr.getY(),clr.getZ(),clr.getW()))                  
+                    out_file.write(i2+ "self."+ modelS + ".setColor(%.4f,%.4f,%.4f,%.4f)\n"%(clr.getX(),clr.getY(),clr.getZ(),clr.getW()))
 
 
                 out_file.write("\n")
                 out_file.write("\n")
                 out_file.write(i2+ "# Reparent To Render for now and later we update all the parentings\n")
                 out_file.write(i2+ "# Reparent To Render for now and later we update all the parentings\n")
@@ -234,7 +234,7 @@ class FileSaver:
                 out_file.write(i2+ "self.ModelDic[\'" + modelS + "\']=self." + AllScene.ModelDic[model].getName()+"\n")
                 out_file.write(i2+ "self.ModelDic[\'" + modelS + "\']=self." + AllScene.ModelDic[model].getName()+"\n")
                 #out_file.write(i2+ "self.ModelRefDic[\'" + modelS + "\']=Filename(\'"+ AllScene.ModelRefDic[model].getFullpath() +"\')\n")# The old Absolute Path way
                 #out_file.write(i2+ "self.ModelRefDic[\'" + modelS + "\']=Filename(\'"+ AllScene.ModelRefDic[model].getFullpath() +"\')\n")# The old Absolute Path way
                 out_file.write(i2+ "self.ModelRefDic[\'" + modelS + "\']=\'"+ AllScene.ModelRefDic[model].getBasename() +"\'\n")# Relative paths
                 out_file.write(i2+ "self.ModelRefDic[\'" + modelS + "\']=\'"+ AllScene.ModelRefDic[model].getBasename() +"\'\n")# Relative paths
-                out_file.write(i2+ "self.ModelDic[\'"+ modelS + "\'].setName(\'"+ modelS +"\')\n")              
+                out_file.write(i2+ "self.ModelDic[\'"+ modelS + "\'].setName(\'"+ modelS +"\')\n")
                 out_file.write("\n")
                 out_file.write("\n")
 
 
         ####################################################################################################################################################
         ####################################################################################################################################################
@@ -248,7 +248,7 @@ class FileSaver:
         for dummy in AllScene.dummyDict:
         for dummy in AllScene.dummyDict:
             out_file.write("\n")
             out_file.write("\n")
             dummyS=str(dummy)
             dummyS=str(dummy)
-            
+
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
                 out_file.write(i2+ "self."+ dummyS + "=loader.loadModel(\"models/misc/sphere\")\n")
                 out_file.write(i2+ "self."+ dummyS + "=loader.loadModel(\"models/misc/sphere\")\n")
                 #Transformation Code
                 #Transformation Code
@@ -259,13 +259,13 @@ class FileSaver:
                 out_file.write(i2+ "self.dummyDict[\'" + dummyS + "\']=self." + AllScene.dummyDict[dummy].getName()+"\n")
                 out_file.write(i2+ "self.dummyDict[\'" + dummyS + "\']=self." + AllScene.dummyDict[dummy].getName()+"\n")
                 out_file.write(i2+ "self.dummyDict[\'"+ dummyS + "\'].setName(\'"+ dummyS +"\')\n")
                 out_file.write(i2+ "self.dummyDict[\'"+ dummyS + "\'].setName(\'"+ dummyS +"\')\n")
                 out_file.write("\n")
                 out_file.write("\n")
-                out_file.write(i2+ "# Save Metadata...can be retrieved by doing theScene.dummyDict[\"Dummy_Name\"].getTag(\"Metadata\")\n")             
+                out_file.write(i2+ "# Save Metadata...can be retrieved by doing theScene.dummyDict[\"Dummy_Name\"].getTag(\"Metadata\")\n")
                 out_file.write(i2+ "self."+ dummyS + ".setTag(\"Metadata\",\"" + AllScene.dummyDict[dummy].getTag("Metadata") + "\")\n")
                 out_file.write(i2+ "self."+ dummyS + ".setTag(\"Metadata\",\"" + AllScene.dummyDict[dummy].getTag("Metadata") + "\")\n")
                 out_file.write("\n")
                 out_file.write("\n")
 
 
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Saving Actors and their animations
         # Saving Actors and their animations
-        ####################################################################################################################################################                    
+        ####################################################################################################################################################
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"# Code for all the Actors and animations\n")
         out_file.write(i2+"# Code for all the Actors and animations\n")
         out_file.write(i2+"# To access the Actors\n")
         out_file.write(i2+"# To access the Actors\n")
@@ -275,7 +275,7 @@ class FileSaver:
         for actor in AllScene.ActorDic:
         for actor in AllScene.ActorDic:
             out_file.write("\n")
             out_file.write("\n")
             actorS=str(actor)
             actorS=str(actor)
-            
+
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
                 #out_file.write(i2+ "self."+ actorS + "=Actor.Actor(\'"+ AllScene.ActorRefDic[actor].getFullpath() + "\')\n")# The old way with absolute paths
                 #out_file.write(i2+ "self."+ actorS + "=Actor.Actor(\'"+ AllScene.ActorRefDic[actor].getFullpath() + "\')\n")# The old way with absolute paths
 
 
@@ -293,7 +293,7 @@ class FileSaver:
                 for index in range(textures.getNumTextures()):
                 for index in range(textures.getNumTextures()):
                     texture=textures.getTexture(index)
                     texture=textures.getTexture(index)
                     texfilename=texture.getFilename()
                     texfilename=texture.getFilename()
-                    actorfnamelist.append(texfilename.getFullpath()) 
+                    actorfnamelist.append(texfilename.getFullpath())
 
 
                     oldFilename=Filename(Filename(AllScene.ActorRefDic[actor].getDirname()),texfilename)
                     oldFilename=Filename(Filename(AllScene.ActorRefDic[actor].getDirname()),texfilename)
                     if(not oldFilename.isRegularFile()):
                     if(not oldFilename.isRegularFile()):
@@ -312,10 +312,10 @@ class FileSaver:
 
 
                 # Copy the file over to the relative directory
                 # Copy the file over to the relative directory
                 oldActorpath=AllScene.ActorRefDic[actor].toOsSpecific()
                 oldActorpath=AllScene.ActorRefDic[actor].toOsSpecific()
-                print "FILESAVER:: copying from " + AllScene.ActorRefDic[actor].toOsSpecific() + "to" + newpathSpecific 
+                print "FILESAVER:: copying from " + AllScene.ActorRefDic[actor].toOsSpecific() + "to" + newpathSpecific
                 if(oldActorpath!=newpathSpecific):
                 if(oldActorpath!=newpathSpecific):
                     shutil.copyfile(oldActorpath,newpathSpecific)
                     shutil.copyfile(oldActorpath,newpathSpecific)
-                
+
 
 
                 e=EggData()
                 e=EggData()
                 e.read(AllScene.ActorRefDic[actor])
                 e.read(AllScene.ActorRefDic[actor])
@@ -328,10 +328,10 @@ class FileSaver:
                     fn.setDirname("")
                     fn.setDirname("")
                     tex.setFilename(fn)
                     tex.setFilename(fn)
                     e.writeEgg(Filename.fromOsSpecific(newpathSpecific))
                     e.writeEgg(Filename.fromOsSpecific(newpathSpecific))
-                
 
 
 
 
-                out_file.write(i2+"if(self.loadmode==1):\n")    
+
+                out_file.write(i2+"if(self.loadmode==1):\n")
                 out_file.write(i2+i1+ "self."+ actorS + "=Actor.Actor(\'" + self.savepath + "/" +  AllScene.ActorRefDic[actor].getBasename() + "')\n")#Relative Path
                 out_file.write(i2+i1+ "self."+ actorS + "=Actor.Actor(\'" + self.savepath + "/" +  AllScene.ActorRefDic[actor].getBasename() + "')\n")#Relative Path
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+i1+ "self."+ actorS + "=Actor.Actor(self.executionpath + \'/" +  AllScene.ActorRefDic[actor].getBasename() + "')\n")#Relative Path with execution point specified by the invoking-level-editor
                 out_file.write(i2+i1+ "self."+ actorS + "=Actor.Actor(self.executionpath + \'/" +  AllScene.ActorRefDic[actor].getBasename() + "')\n")#Relative Path with execution point specified by the invoking-level-editor
@@ -347,7 +347,7 @@ class FileSaver:
                     out_file.write(i2+ "self."+ actorS + ".setColor(%.4f,%.4f,%.4f,%.4f)\n"%(clr.getX(),clr.getY(),clr.getZ(),clr.getW()))
                     out_file.write(i2+ "self."+ actorS + ".setColor(%.4f,%.4f,%.4f,%.4f)\n"%(clr.getX(),clr.getY(),clr.getZ(),clr.getW()))
 
 
                 out_file.write(i2+ "self."+ actorS + ".reparentTo(render)\n")
                 out_file.write(i2+ "self."+ actorS + ".reparentTo(render)\n")
-                
+
                 out_file.write("\n")
                 out_file.write("\n")
                 out_file.write(i2+ "# Save Metadata...can be retrieved by doing theScene.ActorDic[\"Actor_Name\"].getTag(\"Metadata\")\n")
                 out_file.write(i2+ "# Save Metadata...can be retrieved by doing theScene.ActorDic[\"Actor_Name\"].getTag(\"Metadata\")\n")
                 out_file.write(i2+ "self."+ actorS + ".setTag(\"Metadata\",\"" + AllScene.ActorDic[actor].getTag("Metadata") + "\")\n")
                 out_file.write(i2+ "self."+ actorS + ".setTag(\"Metadata\",\"" + AllScene.ActorDic[actor].getTag("Metadata") + "\")\n")
@@ -362,7 +362,7 @@ class FileSaver:
                         #out_file.write(i2+ "self."+ actorS + ".loadAnims(" + str(ActorAnimations) +")\n") # Old way with absolute paths
                         #out_file.write(i2+ "self."+ actorS + ".loadAnims(" + str(ActorAnimations) +")\n") # Old way with absolute paths
                         #Manakel 2/12/2004: solve the not empty but not defined animation case
                         #Manakel 2/12/2004: solve the not empty but not defined animation case
                         if not animation is None:
                         if not animation is None:
-                            print "ACTOR ANIMATIONS:" + ActorAnimations[animation]   
+                            print "ACTOR ANIMATIONS:" + ActorAnimations[animation]
                             oldAnimPath=Filename(ActorAnimations[animation])
                             oldAnimPath=Filename(ActorAnimations[animation])
                             oldAnim=oldAnimPath.toOsSpecific()
                             oldAnim=oldAnimPath.toOsSpecific()
                             dirOS=Filename(dirname)
                             dirOS=Filename(dirname)
@@ -380,24 +380,24 @@ class FileSaver:
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+"else:\n")
                 theloadAnimString=str(ActorAnimationsInvoke)# We hack the "self.executionpath" part into the dictionary as a variable using string replace
                 theloadAnimString=str(ActorAnimationsInvoke)# We hack the "self.executionpath" part into the dictionary as a variable using string replace
                 print "LOAD ANIM STRING BEFORE" + theloadAnimString
                 print "LOAD ANIM STRING BEFORE" + theloadAnimString
-                theloadAnimString=theloadAnimString.replace('\'self.executionpath +','self.executionpath + \'')         
+                theloadAnimString=theloadAnimString.replace('\'self.executionpath +','self.executionpath + \'')
                 print "LOAD ANIM STRING AFTER" + theloadAnimString
                 print "LOAD ANIM STRING AFTER" + theloadAnimString
                 out_file.write(i2+ i1+"self."+ actorS + ".loadAnims(" + theloadAnimString +")\n") # Now with new relative paths based on editor invocation
                 out_file.write(i2+ i1+"self."+ actorS + ".loadAnims(" + theloadAnimString +")\n") # Now with new relative paths based on editor invocation
 
 
                 out_file.write(i2+ "self.ActorDic[\'" + actorS + "\']=self." + AllScene.ActorDic[actor].getName()+"\n")
                 out_file.write(i2+ "self.ActorDic[\'" + actorS + "\']=self." + AllScene.ActorDic[actor].getName()+"\n")
                 #out_file.write(i2+ "self.ActorRefDic[\'" + actorS + "\']=Filename(\'"+AllScene.ActorRefDic[actor].getFullpath() +"\')\n") # Old way with absolute paths
                 #out_file.write(i2+ "self.ActorRefDic[\'" + actorS + "\']=Filename(\'"+AllScene.ActorRefDic[actor].getFullpath() +"\')\n") # Old way with absolute paths
                 out_file.write(i2+ "self.ActorRefDic[\'" + actorS + "\']=\'"+ AllScene.ActorRefDic[actor].getBasename() +"\'\n")# Relative paths
                 out_file.write(i2+ "self.ActorRefDic[\'" + actorS + "\']=\'"+ AllScene.ActorRefDic[actor].getBasename() +"\'\n")# Relative paths
-                out_file.write(i2+ "self.ActorDic[\'"+ actorS + "\'].setName(\'"+ actorS +"\')\n")              
+                out_file.write(i2+ "self.ActorDic[\'"+ actorS + "\'].setName(\'"+ actorS +"\')\n")
                 if(AllScene.blendAnimDict.has_key(actor)): # Check if a dictionary of blended animations exists
                 if(AllScene.blendAnimDict.has_key(actor)): # Check if a dictionary of blended animations exists
                     out_file.write(i2+ "self.blendAnimDict[\"" + actorS +"\"]=" + str(AllScene.blendAnimDict[actor]) + "\n")
                     out_file.write(i2+ "self.blendAnimDict[\"" + actorS +"\"]=" + str(AllScene.blendAnimDict[actor]) + "\n")
-                
-                
+
+
                 out_file.write("\n")
                 out_file.write("\n")
-        
+
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Collsion Node Saving
         # Collsion Node Saving
         ####################################################################################################################################################
         ####################################################################################################################################################
-        
+
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"# Code for setting up Collision Nodes\n")
         out_file.write(i2+"# Code for setting up Collision Nodes\n")
         out_file.write(i2+"# To use collision detection:\n")
         out_file.write(i2+"# To use collision detection:\n")
@@ -410,7 +410,7 @@ class FileSaver:
             nodetype=solid.getType().getName()
             nodetype=solid.getType().getName()
 
 
             if(nodetype=="CollisionSphere"): #Save Collison Sphere
             if(nodetype=="CollisionSphere"): #Save Collison Sphere
-                out_file.write(i2+"collSolid=CollisionSphere(%.3f,%.3f,%.3f,%.3f)\n"%(solid.getCenter().getX(),solid.getCenter().getY(),solid.getCenter().getZ(),solid.getRadius()))            
+                out_file.write(i2+"collSolid=CollisionSphere(%.3f,%.3f,%.3f,%.3f)\n"%(solid.getCenter().getX(),solid.getCenter().getY(),solid.getCenter().getZ(),solid.getRadius()))
                 pass
                 pass
             elif(nodetype=="CollisionPolygon"): #Save Collison Polygon
             elif(nodetype=="CollisionPolygon"): #Save Collison Polygon
 
 
@@ -430,13 +430,13 @@ class FileSaver:
                 out_file.write(i2+"pointB =  Point3(" + bx + "," + by + "," + bz + ")\n")
                 out_file.write(i2+"pointB =  Point3(" + bx + "," + by + "," + bz + ")\n")
                 out_file.write(i2+"pointC =  Point3(" + cx + "," + cy + "," + cz + ")\n")
                 out_file.write(i2+"pointC =  Point3(" + cx + "," + cy + "," + cz + ")\n")
                 out_file.write(i2+"collSolid=CollisionPolygon(pointA, pointB, pointC)\n")
                 out_file.write(i2+"collSolid=CollisionPolygon(pointA, pointB, pointC)\n")
-                
+
                 pass
                 pass
 
 
             elif(nodetype=="CollisionSegment"): #Save Collison Segment
             elif(nodetype=="CollisionSegment"): #Save Collison Segment
                 A=AllScene.collisionDict[collnode].node().getSolid(0).getPointA()
                 A=AllScene.collisionDict[collnode].node().getSolid(0).getPointA()
                 B=AllScene.collisionDict[collnode].node().getSolid(0).getPointB()
                 B=AllScene.collisionDict[collnode].node().getSolid(0).getPointB()
-                
+
                 out_file.write(i2+"pointA =  Point3(%.3f,%.3f,%.3f)\n"%(A.getX(),A.getY(),A.getZ()))
                 out_file.write(i2+"pointA =  Point3(%.3f,%.3f,%.3f)\n"%(A.getX(),A.getY(),A.getZ()))
                 out_file.write(i2+"pointB =  Point3(%.3f,%.3f,%.3f)\n"%(B.getX(),B.getY(),B.getZ()))
                 out_file.write(i2+"pointB =  Point3(%.3f,%.3f,%.3f)\n"%(B.getX(),B.getY(),B.getZ()))
                 out_file.write(i2+"collSolid=CollisionSegment()\n")
                 out_file.write(i2+"collSolid=CollisionSegment()\n")
@@ -455,7 +455,7 @@ class FileSaver:
                 out_file.write(i2+"collSolid=CollisionRay()\n")
                 out_file.write(i2+"collSolid=CollisionRay()\n")
                 out_file.write(i2+"collSolid.setOrigin(point)\n")
                 out_file.write(i2+"collSolid.setOrigin(point)\n")
                 out_file.write(i2+"collSolid.setDirection(vector)\n")
                 out_file.write(i2+"collSolid.setDirection(vector)\n")
-            
+
                 pass
                 pass
             else:
             else:
                  print "Invalid Collision Node: " + nodetype
                  print "Invalid Collision Node: " + nodetype
@@ -466,7 +466,7 @@ class FileSaver:
             out_file.write(i2+"self." + collnodeS + "_Node" + ".addSolid(collSolid)\n")
             out_file.write(i2+"self." + collnodeS + "_Node" + ".addSolid(collSolid)\n")
             out_file.write(i2+"base.cTrav.addCollider(self." + collnodeS + "_Node,self.CollisionHandler)\n")
             out_file.write(i2+"base.cTrav.addCollider(self." + collnodeS + "_Node,self.CollisionHandler)\n")
             out_file.write("\n")
             out_file.write("\n")
-           
+
 
 
 
 
 
 
@@ -488,8 +488,8 @@ class FileSaver:
                      out_file.write (i2+ "alight = AmbientLight(\'"+ light.getName() +"\')\n")
                      out_file.write (i2+ "alight = AmbientLight(\'"+ light.getName() +"\')\n")
                      out_file.write (i2+ "alight.setColor(VBase4("+ str(light.getLightColor().getX())+ "," + str(light.getLightColor().getY())+ "," + str(light.getLightColor().getZ()) + "," + str(light.getLightColor().getW()) + "))\n")
                      out_file.write (i2+ "alight.setColor(VBase4("+ str(light.getLightColor().getX())+ "," + str(light.getLightColor().getY())+ "," + str(light.getLightColor().getZ()) + "," + str(light.getLightColor().getW()) + "))\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
-                     out_file.write (i2+ "self."+light.getName()+"= render.attachNewNode(alight.upcastToPandaNode())\n") 
-                     out_file.write (i2+ "self."+light.getName()+".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")        
+                     out_file.write (i2+ "self."+light.getName()+"= render.attachNewNode(alight.upcastToPandaNode())\n")
+                     out_file.write (i2+ "self."+light.getName()+".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
                      out_file.write (i2+ "self.LightNodes[\'" + light.getName() + "\']=self." + light.getName() + "\n")
                      out_file.write (i2+ "self.LightNodes[\'" + light.getName() + "\']=self." + light.getName() + "\n")
@@ -503,10 +503,10 @@ class FileSaver:
                      #out_file.write (i2+ "alight.setPoint(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      #out_file.write (i2+ "alight.setPoint(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "alight.setSpecularColor(Vec4(" + str(light.getSpecColor().getX()) + "," + str(light.getSpecColor().getY()) + "," + str(light.getSpecColor().getZ()) + "," + str(light.getSpecColor().getW()) + "))\n")
                      out_file.write (i2+ "alight.setSpecularColor(Vec4(" + str(light.getSpecColor().getX()) + "," + str(light.getSpecColor().getY()) + "," + str(light.getSpecColor().getZ()) + "," + str(light.getSpecColor().getW()) + "))\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
-                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToPandaNode())\n") 
+                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToPandaNode())\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setHpr(Vec3("+ str(light.getH())+ "," + str(light.getP())+ "," + str(light.getR()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setHpr(Vec3("+ str(light.getH())+ "," + str(light.getP())+ "," + str(light.getR()) + "))\n")
-                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")       
+                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")
                      #out_file.write (i2+ "alight.setPos
                      #out_file.write (i2+ "alight.setPos
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
@@ -521,8 +521,8 @@ class FileSaver:
                      out_file.write (i2+ "alight.setSpecularColor(Vec4(" + str(light.getSpecColor().getX()) + "," + str(light.getSpecColor().getY()) + "," + str(light.getSpecColor().getZ()) + "," + str(light.getSpecColor().getW()) + "))\n")
                      out_file.write (i2+ "alight.setSpecularColor(Vec4(" + str(light.getSpecColor().getX()) + "," + str(light.getSpecColor().getY()) + "," + str(light.getSpecColor().getZ()) + "," + str(light.getSpecColor().getW()) + "))\n")
                      out_file.write (i2+ "alight.setAttenuation(Vec3("+ str(light.getAttenuation().getX()) + "," + str(light.getAttenuation().getY()) + "," + str(light.getAttenuation().getZ()) + "))\n")
                      out_file.write (i2+ "alight.setAttenuation(Vec3("+ str(light.getAttenuation().getX()) + "," + str(light.getAttenuation().getY()) + "," + str(light.getAttenuation().getZ()) + "))\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
-                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToPandaNode())\n") 
-                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")       
+                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToPandaNode())\n")
+                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
                      out_file.write (i2+ "self.LightTypes[\'" + light.getName() + "\']=\'" + type + "\'\n")
@@ -539,8 +539,8 @@ class FileSaver:
                      out_file.write (i2+ "alight.setAttenuation(Vec3("+ str(light.getAttenuation().getX()) + "," + str(light.getAttenuation().getY()) + "," + str(light.getAttenuation().getZ()) + "))\n")
                      out_file.write (i2+ "alight.setAttenuation(Vec3("+ str(light.getAttenuation().getX()) + "," + str(light.getAttenuation().getY()) + "," + str(light.getAttenuation().getZ()) + "))\n")
                      out_file.write (i2+ "alight.setExponent(" +str(light.getExponent()) +")\n")
                      out_file.write (i2+ "alight.setExponent(" +str(light.getExponent()) +")\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
                      out_file.write (i2+ "self.lightAttrib=self.lightAttrib.addLight(alight)\n")
-                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToLensNode())\n") 
-                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")       
+                     out_file.write (i2+ "self."+light.getName()+ "= render.attachNewNode(alight.upcastToLensNode())\n")
+                     out_file.write (i2+ "self."+light.getName()+ ".setTag(\"Metadata\",\"" + light.getTag("Metadata") + "\")\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setPos(Point3(" + str(light.getX()) + "," + str(light.getY()) + "," + str(light.getZ()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setHpr(Vec3("+ str(light.getH())+ "," + str(light.getP())+ "," + str(light.getR()) + "))\n")
                      out_file.write (i2+ "self."+light.getName()+ ".setHpr(Vec3("+ str(light.getH())+ "," + str(light.getP())+ "," + str(light.getR()) + "))\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
                      out_file.write (i2+ "self.LightDict[\'" + light.getName() + "\']=alight\n")
@@ -552,7 +552,7 @@ class FileSaver:
                      out_file.write (i2+ "return None")
                      out_file.write (i2+ "return None")
                  out_file.write("\n")
                  out_file.write("\n")
 
 
-        
+
 
 
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Enable Lighting
         # Enable Lighting
@@ -571,32 +571,32 @@ class FileSaver:
         out_file.write(i2+"# Load Particle Effects. The parameters to this function are to allow us to use our modified versions of the Particle Effects modules when loading this file with the level editor\n")
         out_file.write(i2+"# Load Particle Effects. The parameters to this function are to allow us to use our modified versions of the Particle Effects modules when loading this file with the level editor\n")
         out_file.write(i2+"self.starteffects(self.loadmode,self.seParticleEffect,self.seParticles)\n")
         out_file.write(i2+"self.starteffects(self.loadmode,self.seParticleEffect,self.seParticles)\n")
         out_file.write("\n")
         out_file.write("\n")
-                
+
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Save Camera Settings
         # Save Camera Settings
         ####################################################################################################################################################
         ####################################################################################################################################################
 
 
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i2+ "# Save Camera Settings\n")
         out_file.write(i2+ "# Save Camera Settings\n")
-        out_file.write(i2+ "camera.setX(" + str(camera.getX()) + ")\n")         
-        out_file.write(i2+ "camera.setY(" + str(camera.getY()) + ")\n")         
-        out_file.write(i2+ "camera.setZ(" + str(camera.getZ()) + ")\n")         
-        out_file.write(i2+ "camera.setH(" + str(camera.getH()) + ")\n")         
-        out_file.write(i2+ "camera.setP(" + str(camera.getP()) + ")\n")         
-        out_file.write(i2+ "camera.setR(" + str(camera.getR()) + ")\n") 
-        out_file.write(i2+ "camera.getChild(0).node().getLens().setNear(" + str(camera.getChild(0).node().getLens().getNear()) + ")\n") 
-        out_file.write(i2+ "camera.getChild(0).node().getLens().setFar(" + str(camera.getChild(0).node().getLens().getFar()) + ")\n") 
-        out_file.write(i2+ "camera.getChild(0).node().getLens().setFov(VBase2(%.5f,%.5f))\n"% (camera.getChild(0).node().getLens().getHfov(),camera.getChild(0).node().getLens().getVfov())) 
+        out_file.write(i2+ "camera.setX(" + str(camera.getX()) + ")\n")
+        out_file.write(i2+ "camera.setY(" + str(camera.getY()) + ")\n")
+        out_file.write(i2+ "camera.setZ(" + str(camera.getZ()) + ")\n")
+        out_file.write(i2+ "camera.setH(" + str(camera.getH()) + ")\n")
+        out_file.write(i2+ "camera.setP(" + str(camera.getP()) + ")\n")
+        out_file.write(i2+ "camera.setR(" + str(camera.getR()) + ")\n")
+        out_file.write(i2+ "camera.getChild(0).node().getLens().setNear(" + str(camera.getChild(0).node().getLens().getNear()) + ")\n")
+        out_file.write(i2+ "camera.getChild(0).node().getLens().setFar(" + str(camera.getChild(0).node().getLens().getFar()) + ")\n")
+        out_file.write(i2+ "camera.getChild(0).node().getLens().setFov(VBase2(%.5f,%.5f))\n"% (camera.getChild(0).node().getLens().getHfov(),camera.getChild(0).node().getLens().getVfov()))
         FilmSize=camera.getChild(0).node().getLens().getFilmSize()
         FilmSize=camera.getChild(0).node().getLens().getFilmSize()
-        out_file.write(i2+ "camera.getChild(0).node().getLens().setFilmSize(%.3f,%.3f)\n"%(FilmSize.getX(),FilmSize.getY())) 
-        out_file.write(i2+ "camera.getChild(0).node().getLens().setFocalLength(" + str(camera.getChild(0).node().getLens().getFocalLength()) + ")\n") 
-        out_file.write(i2+ "camera.setTag(\"Metadata\",\"" + camera.getTag("Metadata") + "\")\n")       
+        out_file.write(i2+ "camera.getChild(0).node().getLens().setFilmSize(%.3f,%.3f)\n"%(FilmSize.getX(),FilmSize.getY()))
+        out_file.write(i2+ "camera.getChild(0).node().getLens().setFocalLength(" + str(camera.getChild(0).node().getLens().getFocalLength()) + ")\n")
+        out_file.write(i2+ "camera.setTag(\"Metadata\",\"" + camera.getTag("Metadata") + "\")\n")
         out_file.write(i2+ "camera.reparentTo(render)\n")
         out_file.write(i2+ "camera.reparentTo(render)\n")
         out_file.write(i2+ "base.disableMouse()\n")
         out_file.write(i2+ "base.disableMouse()\n")
         self.bgColor=base.getBackgroundColor()
         self.bgColor=base.getBackgroundColor()
         out_file.write(i2+ "base.setBackgroundColor(%.3f,%.3f,%.3f)\n"%(self.bgColor.getX(),self.bgColor.getY(),self.bgColor.getZ()))
         out_file.write(i2+ "base.setBackgroundColor(%.3f,%.3f,%.3f)\n"%(self.bgColor.getX(),self.bgColor.getY(),self.bgColor.getZ()))
         out_file.write("\n")
         out_file.write("\n")
-        
+
 
 
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Mopath Saving
         # Mopath Saving
@@ -626,17 +626,17 @@ class FileSaver:
 
 
                 out_file.write(i2+"mp=MopathInterval(m,self." + str(node) + ")\n")
                 out_file.write(i2+"mp=MopathInterval(m,self." + str(node) + ")\n")
                 out_file.write(i2+"self.curveIntervals.append(mp)\n")
                 out_file.write(i2+"self.curveIntervals.append(mp)\n")
-                
+
                 out_file.write(i2+"if(self.loadmode==1):\n")
                 out_file.write(i2+"if(self.loadmode==1):\n")
                 out_file.write(i2+i1+"self.curveRefColl.append(\"" + self.savepath +"/"+ filestring +"\")\n")
                 out_file.write(i2+i1+"self.curveRefColl.append(\"" + self.savepath +"/"+ filestring +"\")\n")
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+"else:\n")
                 out_file.write(i2+i1+"self.curveRefColl.append(self.executionpath + \"/"+ filestring +"\")\n")
                 out_file.write(i2+i1+"self.curveRefColl.append(self.executionpath + \"/"+ filestring +"\")\n")
 
 
                 curvenumber=curvenumber+1
                 curvenumber=curvenumber+1
-            out_file.write(i2+"self.curveIntervalsDict[\"" + str(node) + "\"]=self.curveIntervals\n")        
+            out_file.write(i2+"self.curveIntervalsDict[\"" + str(node) + "\"]=self.curveIntervals\n")
             out_file.write(i2+"self.curveDict[\"" + str(node) + "\"]=self.curveRefColl\n")
             out_file.write(i2+"self.curveDict[\"" + str(node) + "\"]=self.curveRefColl\n")
 
 
-    
+
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Lets do all the reparenting here so as to make sure everything that needed to load was loaded
         # Lets do all the reparenting here so as to make sure everything that needed to load was loaded
         ####################################################################################################################################################
         ####################################################################################################################################################
@@ -665,7 +665,7 @@ class FileSaver:
             parent=AllScene.dummyDict[dummy].getParent().getName()
             parent=AllScene.dummyDict[dummy].getParent().getName()
             if(parent=="render" or parent=="camera"):
             if(parent=="render" or parent=="camera"):
                 out_file.write(i2+ "self."+ dummyS + ".reparentTo(" + parent + ")\n")
                 out_file.write(i2+ "self."+ dummyS + ".reparentTo(" + parent + ")\n")
-            else:  
+            else:
                 if(AllScene.particleDict.has_key(parent)):
                 if(AllScene.particleDict.has_key(parent)):
                     out_file.write(i2+ "self."+ dummyS + ".reparentTo(self." + parent + ".getEffect())\n")
                     out_file.write(i2+ "self."+ dummyS + ".reparentTo(self." + parent + ".getEffect())\n")
                 else:
                 else:
@@ -675,7 +675,7 @@ class FileSaver:
             out_file.write(i2+"\n")
             out_file.write(i2+"\n")
 
 
         for actor in AllScene.ActorDic:
         for actor in AllScene.ActorDic:
-            actorS=str(actor)   
+            actorS=str(actor)
             parent=AllScene.ActorDic[actor].getParent().getName()
             parent=AllScene.ActorDic[actor].getParent().getName()
             if(parent=="render" or parent=="camera"):
             if(parent=="render" or parent=="camera"):
                 out_file.write(i2+ "self."+ actorS + ".reparentTo(" + parent + ")\n")
                 out_file.write(i2+ "self."+ actorS + ".reparentTo(" + parent + ")\n")
@@ -687,7 +687,7 @@ class FileSaver:
 
 
             out_file.write(i2+ "self.ActorDic[\'" + actorS + "\']=self." + AllScene.ActorDic[actor].getName()+"\n")
             out_file.write(i2+ "self.ActorDic[\'" + actorS + "\']=self." + AllScene.ActorDic[actor].getName()+"\n")
             out_file.write(i2+"\n")
             out_file.write(i2+"\n")
-        
+
 
 
         for collnode in AllScene.collisionDict:
         for collnode in AllScene.collisionDict:
             collnodeS=str(collnode)
             collnodeS=str(collnode)
@@ -741,7 +741,7 @@ class FileSaver:
         for effect in AllScene.particleDict:
         for effect in AllScene.particleDict:
             parent=AllScene.particleNodes[effect].getParent().getName()
             parent=AllScene.particleNodes[effect].getParent().getName()
             if(parent=="render" or parent=="camera"):
             if(parent=="render" or parent=="camera"):
-                out_file.write(i2+"self.particleDict[\""+ str(effect) +"\"].reparentTo("  + parent + ")\n")             
+                out_file.write(i2+"self.particleDict[\""+ str(effect) +"\"].reparentTo("  + parent + ")\n")
             else:
             else:
                 out_file.write(i2+"self.particleDict[\""+ str(effect) +"\"].reparentTo(self."  + parent + ")\n")
                 out_file.write(i2+"self.particleDict[\""+ str(effect) +"\"].reparentTo(self."  + parent + ")\n")
             out_file.write(i2+"\n")
             out_file.write(i2+"\n")
@@ -809,11 +809,11 @@ class FileSaver:
         out_file.write(i2+"blendList=blendDicts[blendName]\n")
         out_file.write(i2+"blendList=blendDicts[blendName]\n")
         out_file.write(i2+"actor.stop(blendList[0])\n")
         out_file.write(i2+"actor.stop(blendList[0])\n")
         out_file.write(i2+"actor.stop(blendList[1])\n")
         out_file.write(i2+"actor.stop(blendList[1])\n")
-        out_file.write("\n")    
+        out_file.write("\n")
 
 
         out_file.write(i1+"def changeBlending(self,actor,blendName,blending):\n")
         out_file.write(i1+"def changeBlending(self,actor,blendName,blending):\n")
         out_file.write(i2+"blendDicts=self.blendAnimDict[actor.getName()]\n")
         out_file.write(i2+"blendDicts=self.blendAnimDict[actor.getName()]\n")
-        out_file.write(i2+"blendList=blendDicts[blendName]\n")  
+        out_file.write(i2+"blendList=blendDicts[blendName]\n")
         out_file.write(i2+"blendList[2]=blending\n")
         out_file.write(i2+"blendList[2]=blending\n")
         out_file.write(i2+"self.blendAnimDict[actor.getName()]={blendName:[blendList[0],blendList[1],blending]}\n")
         out_file.write(i2+"self.blendAnimDict[actor.getName()]={blendName:[blendList[0],blendList[1],blending]}\n")
         out_file.write("\n")
         out_file.write("\n")
@@ -823,21 +823,21 @@ class FileSaver:
         ####################################################################################################################################################
         ####################################################################################################################################################
         # Hide and Show Methods
         # Hide and Show Methods
         ####################################################################################################################################################
         ####################################################################################################################################################
-     
+
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"##########################################################################################################\n")
         out_file.write(i2+"# Hide and Show Methods\n")
         out_file.write(i2+"# Hide and Show Methods\n")
         out_file.write(i2+"# These will help you hide/show dummies, collision solids, effect nodes etc.\n")
         out_file.write(i2+"# These will help you hide/show dummies, collision solids, effect nodes etc.\n")
         out_file.write(i2+"##########################################################################################################\n\n")
         out_file.write(i2+"##########################################################################################################\n\n")
-  
-     
+
+
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i1+"def hideDummies(self):\n")
         out_file.write(i1+"def hideDummies(self):\n")
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i2+"for dummy in self.dummyDict:\n")
         out_file.write(i2+"for dummy in self.dummyDict:\n")
         out_file.write(i2+i1+"self.dummyDict[dummy].reparentTo(hidden)\n")
         out_file.write(i2+i1+"self.dummyDict[dummy].reparentTo(hidden)\n")
-        
-       
+
+
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i1+"def hideCollSolids(self):\n")
         out_file.write(i1+"def hideCollSolids(self):\n")
         out_file.write("\n")
         out_file.write("\n")
@@ -857,8 +857,8 @@ class FileSaver:
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i2+"for dummy in self.dummyDict:\n")
         out_file.write(i2+"for dummy in self.dummyDict:\n")
         out_file.write(i2+i1+"self.dummyDict[dummy].reparentTo(hidden)\n")
         out_file.write(i2+i1+"self.dummyDict[dummy].reparentTo(hidden)\n")
-        
-       
+
+
         out_file.write("\n")
         out_file.write("\n")
         out_file.write(i1+"def showCollSolids(self):\n")
         out_file.write(i1+"def showCollSolids(self):\n")
         out_file.write("\n")
         out_file.write("\n")
@@ -885,7 +885,7 @@ class FileSaver:
         out_file.write(i2+"##########################################################################################################\n\n")
         out_file.write(i2+"##########################################################################################################\n\n")
 
 
         for effect in AllScene.particleDict:
         for effect in AllScene.particleDict:
-        
+
             out_file.write("\n\n")
             out_file.write("\n\n")
             out_file.write("class " + str(effect) + ":\n")
             out_file.write("class " + str(effect) + ":\n")
             out_file.write(i1+"def __init__(self,mode=1,seParticleEffect=None,seParticles=None):\n")
             out_file.write(i1+"def __init__(self,mode=1,seParticleEffect=None,seParticles=None):\n")
@@ -911,5 +911,5 @@ class FileSaver:
         #out_file.write("run()\n")
         #out_file.write("run()\n")
 
 
         out_file.close()
         out_file.close()
-                
-                
+
+

+ 2 - 2
contrib/src/sceneeditor/seForceGroup.py

@@ -15,7 +15,7 @@ class ForceGroup(DirectObject):
         """__init__(self)"""
         """__init__(self)"""
 
 
         if (name == None):
         if (name == None):
-            self.name = 'ForceGroup-%d' % ForceGroup.id 
+            self.name = 'ForceGroup-%d' % ForceGroup.id
             ForceGroup.id += 1
             ForceGroup.id += 1
         else:
         else:
             self.name = name
             self.name = name
@@ -74,7 +74,7 @@ class ForceGroup(DirectObject):
     def getNodePath(self):
     def getNodePath(self):
         return self.nodePath
         return self.nodePath
 
 
-    # Utility functions 
+    # Utility functions
     def __getitem__(self, index):
     def __getitem__(self, index):
         numForces = self.node.getNumForces()
         numForces = self.node.getNumForces()
         if ((index < 0) or (index >= numForces)):
         if ((index < 0) or (index >= numForces)):

+ 4 - 4
contrib/src/sceneeditor/seGeometry.py

@@ -79,7 +79,7 @@ class LineNodePath(NodePath):
 
 
     def getVertexColor( self ):
     def getVertexColor( self ):
         return self.lineSegs.getVertexColor()
         return self.lineSegs.getVertexColor()
-    
+
     def drawArrow(self, sv, ev, arrowAngle, arrowLength):
     def drawArrow(self, sv, ev, arrowAngle, arrowLength):
         """
         """
         Do the work of moving the cursor around to draw an arrow from
         Do the work of moving the cursor around to draw an arrow from
@@ -206,12 +206,12 @@ def qSlerp(startQuat, endQuat, t):
     destQuat = Quat.identQuat()
     destQuat = Quat.identQuat()
     # Calc dot product
     # Calc dot product
     cosOmega = (startQ.getI() * endQuat.getI() +
     cosOmega = (startQ.getI() * endQuat.getI() +
-                startQ.getJ() * endQuat.getJ() + 
+                startQ.getJ() * endQuat.getJ() +
                 startQ.getK() * endQuat.getK() +
                 startQ.getK() * endQuat.getK() +
                 startQ.getR() * endQuat.getR())
                 startQ.getR() * endQuat.getR())
     # If the above dot product is negative, it would be better to
     # If the above dot product is negative, it would be better to
     # go between the negative of the initial and the final, so that
     # go between the negative of the initial and the final, so that
-    # we take the shorter path.  
+    # we take the shorter path.
     if ( cosOmega < 0.0 ):
     if ( cosOmega < 0.0 ):
         cosOmega *= -1
         cosOmega *= -1
         startQ.setI(-1 * startQ.getI())
         startQ.setI(-1 * startQ.getI())
@@ -227,7 +227,7 @@ def qSlerp(startQuat, endQuat, t):
             startScale = math.sin((1.0 - t) * omega)/sinOmega
             startScale = math.sin((1.0 - t) * omega)/sinOmega
             endScale = math.sin(t * omega)/sinOmega
             endScale = math.sin(t * omega)/sinOmega
         else:
         else:
-            # ends very close 
+            # ends very close
             startScale = 1.0 - t
             startScale = 1.0 - t
             endScale = t
             endScale = t
         destQuat.setI(startScale * startQ.getI() +
         destQuat.setI(startScale * startQ.getI() +

+ 4 - 4
contrib/src/sceneeditor/seGrid.py

@@ -90,7 +90,7 @@ class DirectGrid(NodePath,DirectObject):
         # Now redraw lines
         # Now redraw lines
         numLines = int(math.ceil(self.gridSize/self.gridSpacing))
         numLines = int(math.ceil(self.gridSize/self.gridSpacing))
         scaledSize = numLines * self.gridSpacing
         scaledSize = numLines * self.gridSpacing
- 
+
         center = self.centerLines
         center = self.centerLines
         minor = self.minorLines
         minor = self.minorLines
         major = self.majorLines
         major = self.majorLines
@@ -116,7 +116,7 @@ class DirectGrid(NodePath,DirectObject):
         minor.create()
         minor.create()
         major.create()
         major.create()
         self.gridBack.setScale(scaledSize)
         self.gridBack.setScale(scaledSize)
-        
+
     def setXyzSnap(self, fSnap):
     def setXyzSnap(self, fSnap):
         self.fXyzSnap = fSnap
         self.fXyzSnap = fSnap
 
 
@@ -138,7 +138,7 @@ class DirectGrid(NodePath,DirectObject):
                 ROUND_TO(self.snapPos[0], self.gridSpacing),
                 ROUND_TO(self.snapPos[0], self.gridSpacing),
                 ROUND_TO(self.snapPos[1], self.gridSpacing),
                 ROUND_TO(self.snapPos[1], self.gridSpacing),
                 ROUND_TO(self.snapPos[2], self.gridSpacing))
                 ROUND_TO(self.snapPos[2], self.gridSpacing))
-            
+
         # Move snap marker to this point
         # Move snap marker to this point
         self.snapMarker.setPos(self.snapPos)
         self.snapMarker.setPos(self.snapPos)
 
 
@@ -157,7 +157,7 @@ class DirectGrid(NodePath,DirectObject):
     def setGridSpacing(self, spacing):
     def setGridSpacing(self, spacing):
         self.gridSpacing = spacing
         self.gridSpacing = spacing
         self.updateGrid()
         self.updateGrid()
-        
+
     def getGridSpacing(self):
     def getGridSpacing(self):
         return self.gridSpacing
         return self.gridSpacing
 
 

+ 19 - 19
contrib/src/sceneeditor/seLights.py

@@ -62,7 +62,7 @@ class seLight(NodePath):
         self.exponent = exponent
         self.exponent = exponent
         self.lence = lence
         self.lence = lence
         self.active = True
         self.active = True
-           
+
         if isinstance(light, Spotlight):
         if isinstance(light, Spotlight):
             node = light.upcastToLensNode()
             node = light.upcastToLensNode()
         else:
         else:
@@ -75,10 +75,10 @@ class seLight(NodePath):
             self.LightNode.setHpr(self.orientation)
             self.LightNode.setHpr(self.orientation)
             self.LightNode.setPos(self.position)
             self.LightNode.setPos(self.position)
         else:
         else:
-            self.LightNode.setHpr(self.orientation)     
+            self.LightNode.setHpr(self.orientation)
             self.LightNode.setPos(self.position)
             self.LightNode.setPos(self.position)
-            
-        
+
+
         self.assign(self.LightNode)
         self.assign(self.LightNode)
         if(self.type=='spot'):
         if(self.type=='spot'):
             self.helpModel = loader.loadModel( "models/misc/Spotlight" )
             self.helpModel = loader.loadModel( "models/misc/Spotlight" )
@@ -99,7 +99,7 @@ class seLight(NodePath):
         # getLight(self)
         # getLight(self)
         # This function will return the light object it contains.
         # This function will return the light object it contains.
         #################################################################
         #################################################################
-        
+
         return self.light
         return self.light
 
 
     def getLightColor(self):
     def getLightColor(self):
@@ -108,14 +108,14 @@ class seLight(NodePath):
         # This function will return the color of the light color of this light node.
         # This function will return the color of the light color of this light node.
         #################################################################
         #################################################################
         return self.lightcolor
         return self.lightcolor
-    
+
     def getName(self):
     def getName(self):
         #################################################################
         #################################################################
         # getName(self)
         # getName(self)
         # This function will return the name of this light.
         # This function will return the name of this light.
         #################################################################
         #################################################################
         return self.light.getName()
         return self.light.getName()
-    
+
     def rename(self,name):
     def rename(self,name):
         #################################################################
         #################################################################
         # rename(self, name)
         # rename(self, name)
@@ -203,7 +203,7 @@ class seLight(NodePath):
         #################################################################
         #################################################################
         self.orientation = self.LightNode.getHpr()
         self.orientation = self.LightNode.getHpr()
         return self.orientation
         return self.orientation
-        
+
     def setOrientation(self,orient):
     def setOrientation(self,orient):
         #################################################################
         #################################################################
         # setOrientation(self, orient)
         # setOrientation(self, orient)
@@ -241,7 +241,7 @@ class seLight(NodePath):
         self.light.setAttenuation(Vec3(value, self.linear, self.quadratic))
         self.light.setAttenuation(Vec3(value, self.linear, self.quadratic))
         self.constant = value
         self.constant = value
         return
         return
-    
+
     def setLinearAttenuation(self, value):
     def setLinearAttenuation(self, value):
         #################################################################
         #################################################################
         # setLinearAttenuation(self, value)
         # setLinearAttenuation(self, value)
@@ -252,7 +252,7 @@ class seLight(NodePath):
         self.light.setAttenuation(Vec3(self.constant, value, self.quadratic))
         self.light.setAttenuation(Vec3(self.constant, value, self.quadratic))
         self.linear = value
         self.linear = value
         return
         return
-    
+
     def setQuadraticAttenuation(self, value):
     def setQuadraticAttenuation(self, value):
         #################################################################
         #################################################################
         # setQuadraticAttenuation(self, value)
         # setQuadraticAttenuation(self, value)
@@ -270,7 +270,7 @@ class seLight(NodePath):
         # This function will return the value of the Exponent Attenuation
         # This function will return the value of the Exponent Attenuation
         # of this light node. (float)
         # of this light node. (float)
         #################################################################
         #################################################################
-        return self.exponent    
+        return self.exponent
 
 
     def setExponent(self, value):
     def setExponent(self, value):
         #################################################################
         #################################################################
@@ -282,7 +282,7 @@ class seLight(NodePath):
         self.light.setExponent(value)
         self.light.setExponent(value)
         self.exponent = value
         self.exponent = value
         return
         return
-        
+
 class seLightManager(NodePath):
 class seLightManager(NodePath):
     #################################################################
     #################################################################
     # seLightManager(NodePath)
     # seLightManager(NodePath)
@@ -307,7 +307,7 @@ class seLightManager(NodePath):
         self.helpModel = loader.loadModel( "models/misc/sphere" )
         self.helpModel = loader.loadModel( "models/misc/sphere" )
         self.helpModel.reparentTo(self)
         self.helpModel.reparentTo(self)
         self.helpModel.hide()
         self.helpModel.hide()
-   
+
 
 
 
 
 
 
@@ -342,7 +342,7 @@ class seLightManager(NodePath):
         ### create the light
         ### create the light
 
 
         lence = None
         lence = None
-        
+
         if type == 'ambient':
         if type == 'ambient':
             self.ambientCount += 1
             self.ambientCount += 1
             if(name=='DEFAULT_NAME'):
             if(name=='DEFAULT_NAME'):
@@ -368,7 +368,7 @@ class seLightManager(NodePath):
                 light = PointLight('point_' + `self.pointCount`)
                 light = PointLight('point_' + `self.pointCount`)
             else:
             else:
                 light = PointLight(name)
                 light = PointLight(name)
-            
+
             light.setColor(lightcolor)
             light.setColor(lightcolor)
             light.setSpecularColor(specularColor)
             light.setSpecularColor(specularColor)
             light.setAttenuation(Vec3(constant, linear, quadratic))
             light.setAttenuation(Vec3(constant, linear, quadratic))
@@ -406,7 +406,7 @@ class seLightManager(NodePath):
         self.lightDict[light.getName()] = lightNode
         self.lightDict[light.getName()] = lightNode
         self.setOn(lightNode)
         self.setOn(lightNode)
 
 
-        
+
         return self.lightDict.keys(),lightNode
         return self.lightDict.keys(),lightNode
 
 
     def addLight(self, light):
     def addLight(self, light):
@@ -507,7 +507,7 @@ class seLightManager(NodePath):
         #################################################################
         #################################################################
         for name in self.lightDict:
         for name in self.lightDict:
             self.delete(name, removeEntry = False)
             self.delete(name, removeEntry = False)
-        
+
         self.lightDict.clear()
         self.lightDict.clear()
 
 
     def isLight(self,name):
     def isLight(self,name):
@@ -531,7 +531,7 @@ class seLightManager(NodePath):
             return self.lightDict.keys(),lightNode
             return self.lightDict.keys(),lightNode
         else:
         else:
             print '----Light Mnager: No such Light!'
             print '----Light Mnager: No such Light!'
-            
+
     def getLightNodeList(self):
     def getLightNodeList(self):
         #################################################################
         #################################################################
         # getLightNodeList(self)
         # getLightNodeList(self)
@@ -612,7 +612,7 @@ class seLightManager(NodePath):
         if render.node().hasAttrib(LightAttrib.getClassType()):
         if render.node().hasAttrib(LightAttrib.getClassType()):
             render.node().setAttrib(self.lightAttrib)
             render.node().setAttrib(self.lightAttrib)
 
 
-            
+
     def setOff(self, lightNode):
     def setOff(self, lightNode):
         #################################################################
         #################################################################
         # setOff(self, lightNode)
         # setOff(self, lightNode)

+ 10 - 10
contrib/src/sceneeditor/seManipulation.py

@@ -200,7 +200,7 @@ class DirectManipulationControl(DirectObject):
             # Send event to signal start of manipulation
             # Send event to signal start of manipulation
             messenger.send('DIRECT_manipulateObjectStart')
             messenger.send('DIRECT_manipulateObjectStart')
             # Manipulate the real object with the constraint
             # Manipulate the real object with the constraint
-            # The constraint is passed as the name of the node 
+            # The constraint is passed as the name of the node
             self.spawnManipulateObjectTask()
             self.spawnManipulateObjectTask()
 
 
     def spawnManipulateObjectTask(self):
     def spawnManipulateObjectTask(self):
@@ -314,7 +314,7 @@ class DirectManipulationControl(DirectObject):
             self.fWidgetTop = self.widgetCheck('top?')
             self.fWidgetTop = self.widgetCheck('top?')
             self.rotationCenter = getScreenXY(SEditor.widget)
             self.rotationCenter = getScreenXY(SEditor.widget)
             self.lastCrankAngle = getCrankAngle(self.rotationCenter)
             self.lastCrankAngle = getCrankAngle(self.rotationCenter)
-            
+
         # Rotate widget based on how far cursor has swung around origin
         # Rotate widget based on how far cursor has swung around origin
         newAngle = getCrankAngle(self.rotationCenter)
         newAngle = getCrankAngle(self.rotationCenter)
         deltaAngle = self.lastCrankAngle - newAngle
         deltaAngle = self.lastCrankAngle - newAngle
@@ -528,7 +528,7 @@ class ObjectHandles(NodePath,DirectObject):
         self.xDiscGroup = self.xHandles.find('**/x-disc-group')
         self.xDiscGroup = self.xHandles.find('**/x-disc-group')
         self.xDisc = self.xHandles.find('**/x-disc-visible')
         self.xDisc = self.xHandles.find('**/x-disc-visible')
         self.xDiscCollision = self.xHandles.find('**/x-disc')
         self.xDiscCollision = self.xHandles.find('**/x-disc')
-        
+
         self.yHandles = self.find('**/Y')
         self.yHandles = self.find('**/Y')
         self.yPostGroup = self.yHandles.find('**/y-post-group')
         self.yPostGroup = self.yHandles.find('**/y-post-group')
         self.yPostCollision = self.yHandles.find('**/y-post')
         self.yPostCollision = self.yHandles.find('**/y-post')
@@ -537,7 +537,7 @@ class ObjectHandles(NodePath,DirectObject):
         self.yDiscGroup = self.yHandles.find('**/y-disc-group')
         self.yDiscGroup = self.yHandles.find('**/y-disc-group')
         self.yDisc = self.yHandles.find('**/y-disc-visible')
         self.yDisc = self.yHandles.find('**/y-disc-visible')
         self.yDiscCollision = self.yHandles.find('**/y-disc')
         self.yDiscCollision = self.yHandles.find('**/y-disc')
-        
+
         self.zHandles = self.find('**/Z')
         self.zHandles = self.find('**/Z')
         self.zPostGroup = self.zHandles.find('**/z-post-group')
         self.zPostGroup = self.zHandles.find('**/z-post-group')
         self.zPostCollision = self.zHandles.find('**/z-post')
         self.zPostCollision = self.zHandles.find('**/z-post')
@@ -782,7 +782,7 @@ class ObjectHandles(NodePath,DirectObject):
         lines.moveTo(0,0,0)
         lines.moveTo(0,0,0)
         lines.drawTo(-1.5,0,0)
         lines.drawTo(-1.5,0,0)
         lines.create()
         lines.create()
-        
+
         # X ring
         # X ring
         self.xRing = self.xRingGroup.attachNewNode('x-ring-visible')
         self.xRing = self.xRingGroup.attachNewNode('x-ring-visible')
         lines = LineNodePath(self.xRing)
         lines = LineNodePath(self.xRing)
@@ -794,7 +794,7 @@ class ObjectHandles(NodePath,DirectObject):
                           math.cos(deg2Rad(ang)),
                           math.cos(deg2Rad(ang)),
                           math.sin(deg2Rad(ang)))
                           math.sin(deg2Rad(ang)))
         lines.create()
         lines.create()
-        
+
         # Y post
         # Y post
         self.yPost = self.yPostGroup.attachNewNode('y-post-visible')
         self.yPost = self.yPostGroup.attachNewNode('y-post-visible')
         lines = LineNodePath(self.yPost)
         lines = LineNodePath(self.yPost)
@@ -809,7 +809,7 @@ class ObjectHandles(NodePath,DirectObject):
         lines.moveTo(0,0,0)
         lines.moveTo(0,0,0)
         lines.drawTo(0,-1.5,0)
         lines.drawTo(0,-1.5,0)
         lines.create()
         lines.create()
-        
+
         # Y ring
         # Y ring
         self.yRing = self.yRingGroup.attachNewNode('y-ring-visible')
         self.yRing = self.yRingGroup.attachNewNode('y-ring-visible')
         lines = LineNodePath(self.yRing)
         lines = LineNodePath(self.yRing)
@@ -836,7 +836,7 @@ class ObjectHandles(NodePath,DirectObject):
         lines.moveTo(0,0,0)
         lines.moveTo(0,0,0)
         lines.drawTo(0,0,-1.5)
         lines.drawTo(0,0,-1.5)
         lines.create()
         lines.create()
-        
+
         # Z ring
         # Z ring
         self.zRing = self.zRingGroup.attachNewNode('z-ring-visible')
         self.zRing = self.zRingGroup.attachNewNode('z-ring-visible')
         lines = LineNodePath(self.zRing)
         lines = LineNodePath(self.zRing)
@@ -929,12 +929,12 @@ class ObjectHandles(NodePath,DirectObject):
 
 
         # Calc the xfrom from camera to the nodePath
         # Calc the xfrom from camera to the nodePath
         mCam2NodePath = SEditor.camera.getMat(nodePath)
         mCam2NodePath = SEditor.camera.getMat(nodePath)
-    
+
         # And determine where the viewpoint is relative to widget
         # And determine where the viewpoint is relative to widget
         lineOrigin = VBase3(0)
         lineOrigin = VBase3(0)
         decomposeMatrix(mCam2NodePath, VBase3(0), VBase3(0), lineOrigin,
         decomposeMatrix(mCam2NodePath, VBase3(0), VBase3(0), lineOrigin,
                         CSDefault)
                         CSDefault)
-        
+
         # Next we find the vector from viewpoint to the widget through
         # Next we find the vector from viewpoint to the widget through
         # the mouse's position on near plane.
         # the mouse's position on near plane.
         # This defines the intersection ray
         # This defines the intersection ray

+ 37 - 37
contrib/src/sceneeditor/seMopathRecorder.py

@@ -59,7 +59,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
         # Call superclass initialization function
         # Call superclass initialization function
         AppShell.__init__(self)
         AppShell.__init__(self)
-        
+
         self.initialiseoptions(MopathRecorder)
         self.initialiseoptions(MopathRecorder)
 
 
         self.selectNodePathNamed('camera')
         self.selectNodePathNamed('camera')
@@ -306,9 +306,9 @@ class MopathRecorder(AppShell, DirectObject):
 
 
 
 
         frame.pack(fill = Tkinter.X, expand = 1)
         frame.pack(fill = Tkinter.X, expand = 1)
-        
+
         mainFrame.pack(expand = 1, fill = Tkinter.X, pady = 3)
         mainFrame.pack(expand = 1, fill = Tkinter.X, pady = 3)
-        
+
         # Playback controls
         # Playback controls
         playbackFrame = Frame(interior, relief = Tkinter.SUNKEN,
         playbackFrame = Frame(interior, relief = Tkinter.SUNKEN,
                               borderwidth = 2)
                               borderwidth = 2)
@@ -370,7 +370,7 @@ class MopathRecorder(AppShell, DirectObject):
             string.atof(s.speedVar.get())))
             string.atof(s.speedVar.get())))
         self.speedEntry.pack(side = Tkinter.LEFT, expand = 0)
         self.speedEntry.pack(side = Tkinter.LEFT, expand = 0)
         frame.pack(fill = Tkinter.X, expand = 1)
         frame.pack(fill = Tkinter.X, expand = 1)
-        
+
         playbackFrame.pack(fill = Tkinter.X, pady = 2)
         playbackFrame.pack(fill = Tkinter.X, pady = 2)
 
 
         # Create notebook pages
         # Create notebook pages
@@ -387,7 +387,7 @@ class MopathRecorder(AppShell, DirectObject):
         label = Label(self.resamplePage, text = 'RESAMPLE CURVE',
         label = Label(self.resamplePage, text = 'RESAMPLE CURVE',
                       font=('MSSansSerif', 12, 'bold'))
                       font=('MSSansSerif', 12, 'bold'))
         label.pack(fill = Tkinter.X)
         label.pack(fill = Tkinter.X)
-        
+
         # Resample
         # Resample
         resampleFrame = Frame(
         resampleFrame = Frame(
             self.resamplePage, relief = Tkinter.SUNKEN, borderwidth = 2)
             self.resamplePage, relief = Tkinter.SUNKEN, borderwidth = 2)
@@ -411,7 +411,7 @@ class MopathRecorder(AppShell, DirectObject):
             self.faceForward, side = Tkinter.LEFT, fill = Tkinter.X, expand = 1)
             self.faceForward, side = Tkinter.LEFT, fill = Tkinter.X, expand = 1)
         frame.pack(fill = Tkinter.X, expand = 0)
         frame.pack(fill = Tkinter.X, expand = 0)
         resampleFrame.pack(fill = Tkinter.X, expand = 0, pady = 2)
         resampleFrame.pack(fill = Tkinter.X, expand = 0, pady = 2)
-        
+
         # Desample
         # Desample
         desampleFrame = Frame(
         desampleFrame = Frame(
             self.resamplePage, relief = Tkinter.SUNKEN, borderwidth = 2)
             self.resamplePage, relief = Tkinter.SUNKEN, borderwidth = 2)
@@ -555,7 +555,7 @@ class MopathRecorder(AppShell, DirectObject):
             sfFrame, 'Style', 'Num Segs',
             sfFrame, 'Style', 'Num Segs',
             'Set number of segments used to approximate each parametric unit',
             'Set number of segments used to approximate each parametric unit',
             min = 1.0, max = 400, resolution = 1.0,
             min = 1.0, max = 400, resolution = 1.0,
-            value = 40, 
+            value = 40,
             command = self.setNumSegs, side = Tkinter.TOP)
             command = self.setNumSegs, side = Tkinter.TOP)
         widget.component('hull')['relief'] = Tkinter.RIDGE
         widget.component('hull')['relief'] = Tkinter.RIDGE
         widget = self.createSlider(
         widget = self.createSlider(
@@ -644,8 +644,8 @@ class MopathRecorder(AppShell, DirectObject):
         # Pack record frame
         # Pack record frame
         optionsFrame.pack(fill = Tkinter.X, pady = 2)
         optionsFrame.pack(fill = Tkinter.X, pady = 2)
 
 
-        self.mainNotebook.setnaturalsize()        
-        
+        self.mainNotebook.setnaturalsize()
+
     def pushUndo(self, fResetRedo = 1):
     def pushUndo(self, fResetRedo = 1):
         SEditor.pushUndo([self.nodePath])
         SEditor.pushUndo([self.nodePath])
 
 
@@ -663,7 +663,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def pushRedo(self):
     def pushRedo(self):
         SEditor.pushRedo([self.nodePath])
         SEditor.pushRedo([self.nodePath])
-        
+
     def redoHook(self):
     def redoHook(self):
         # Reflect new changes
         # Reflect new changes
         pass
         pass
@@ -675,7 +675,7 @@ class MopathRecorder(AppShell, DirectObject):
     def redoListEmptyHook(self):
     def redoListEmptyHook(self):
         # Make sure button is deactivated
         # Make sure button is deactivated
         self.redoButton.configure(state = 'disabled')
         self.redoButton.configure(state = 'disabled')
-        
+
     def selectedNodePathHook(self, nodePath):
     def selectedNodePathHook(self, nodePath):
         """
         """
         Hook called upon selection of a node path used to select playback
         Hook called upon selection of a node path used to select playback
@@ -770,11 +770,11 @@ class MopathRecorder(AppShell, DirectObject):
                 self.manipulandumId = self.playbackMarker.id()
                 self.manipulandumId = self.playbackMarker.id()
             elif SEditor.selected.last.id() == self.tangentMarker.id():
             elif SEditor.selected.last.id() == self.tangentMarker.id():
                 self.manipulandumId = self.tangentMarker.id()
                 self.manipulandumId = self.tangentMarker.id()
-              
+
     def manipulateObjectCleanupHook(self):
     def manipulateObjectCleanupHook(self):
         # Clear flag
         # Clear flag
         self.manipulandumId = None
         self.manipulandumId = None
-            
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         # Remove hooks
         # Remove hooks
         for event, method in self.actionEvents:
         for event, method in self.actionEvents:
@@ -853,7 +853,7 @@ class MopathRecorder(AppShell, DirectObject):
             self.curveNodePath.show()
             self.curveNodePath.show()
         else:
         else:
             self.curveNodePath.hide()
             self.curveNodePath.hide()
-        
+
     def setKnotVis(self):
     def setKnotVis(self):
         self.nurbsCurveDrawer.setShowKnots(
         self.nurbsCurveDrawer.setShowKnots(
             self.getVariable('Style', 'Knots').get())
             self.getVariable('Style', 'Knots').get())
@@ -861,11 +861,11 @@ class MopathRecorder(AppShell, DirectObject):
     def setCvVis(self):
     def setCvVis(self):
         self.nurbsCurveDrawer.setShowCvs(
         self.nurbsCurveDrawer.setShowCvs(
             self.getVariable('Style', 'CVs').get())
             self.getVariable('Style', 'CVs').get())
-        
+
     def setHullVis(self):
     def setHullVis(self):
         self.nurbsCurveDrawer.setShowHull(
         self.nurbsCurveDrawer.setShowHull(
             self.getVariable('Style', 'Hull').get())
             self.getVariable('Style', 'Hull').get())
-        
+
     def setTraceVis(self):
     def setTraceVis(self):
         if self.getVariable('Style', 'Trace').get():
         if self.getVariable('Style', 'Trace').get():
             self.trace.show()
             self.trace.show()
@@ -881,10 +881,10 @@ class MopathRecorder(AppShell, DirectObject):
     def setNumSegs(self, value):
     def setNumSegs(self, value):
         self.numSegs = int(value)
         self.numSegs = int(value)
         self.nurbsCurveDrawer.setNumSegs(self.numSegs)
         self.nurbsCurveDrawer.setNumSegs(self.numSegs)
-        
+
     def setNumTicks(self, value):
     def setNumTicks(self, value):
         self.nurbsCurveDrawer.setNumTicks(float(value))
         self.nurbsCurveDrawer.setNumTicks(float(value))
-        
+
     def setTickScale(self, value):
     def setTickScale(self, value):
         self.nurbsCurveDrawer.setTickScale(float(value))
         self.nurbsCurveDrawer.setTickScale(float(value))
 
 
@@ -933,7 +933,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.curveCollection = None
         self.curveCollection = None
         self.curveFitter.reset()
         self.curveFitter.reset()
         self.nurbsCurveDrawer.hide()
         self.nurbsCurveDrawer.hide()
-        
+
     def setSamplingMode(self, mode):
     def setSamplingMode(self, mode):
         self.samplingMode = mode
         self.samplingMode = mode
 
 
@@ -950,7 +950,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setRefineMode(self):
     def setRefineMode(self):
         self.setRecordingType('Refine')
         self.setRecordingType('Refine')
-        
+
     def setExtendMode(self):
     def setExtendMode(self):
         self.setRecordingType('Extend')
         self.setRecordingType('Extend')
 
 
@@ -1015,7 +1015,7 @@ class MopathRecorder(AppShell, DirectObject):
                     self.recordTask, self.name + '-recordTask')
                     self.recordTask, self.name + '-recordTask')
                 t.startTime = globalClock.getFrameTime()
                 t.startTime = globalClock.getFrameTime()
         else:
         else:
-            self.markingNode.removeNode() # Hide the marker in the end of recording 
+            self.markingNode.removeNode() # Hide the marker in the end of recording
             if self.samplingMode == 'Continuous':
             if self.samplingMode == 'Continuous':
                 # Kill old task
                 # Kill old task
                 taskMgr.remove(self.name + '-recordTask')
                 taskMgr.remove(self.name + '-recordTask')
@@ -1043,7 +1043,7 @@ class MopathRecorder(AppShell, DirectObject):
                 self.setNewCurveMode()
                 self.setNewCurveMode()
             # Compute curve
             # Compute curve
             self.computeCurves()
             self.computeCurves()
-            
+
     def recordTask(self, state):
     def recordTask(self, state):
         # Record raw data point
         # Record raw data point
         time = self.recordStart + (
         time = self.recordStart + (
@@ -1324,7 +1324,7 @@ class MopathRecorder(AppShell, DirectObject):
     def setPlaybackSF(self, value):
     def setPlaybackSF(self, value):
         self.playbackSF = pow(10.0, float(value))
         self.playbackSF = pow(10.0, float(value))
         self.speedVar.set('%0.2f' % self.playbackSF)
         self.speedVar.set('%0.2f' % self.playbackSF)
-        
+
     def playbackTask(self, state):
     def playbackTask(self, state):
         time = globalClock.getFrameTime()
         time = globalClock.getFrameTime()
         dTime = self.playbackSF * (time - state.lastTime)
         dTime = self.playbackSF * (time - state.lastTime)
@@ -1383,7 +1383,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setDesampleFrequency(self, frequency):
     def setDesampleFrequency(self, frequency):
         self.desampleFrequency = frequency
         self.desampleFrequency = frequency
-        
+
     def desampleCurve(self):
     def desampleCurve(self):
         if (self.curveFitter.getNumSamples() == 0):
         if (self.curveFitter.getNumSamples() == 0):
             print 'MopathRecorder.desampleCurve: Must define curve first'
             print 'MopathRecorder.desampleCurve: Must define curve first'
@@ -1397,7 +1397,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def setNumSamples(self, numSamples):
     def setNumSamples(self, numSamples):
         self.numSamples = int(numSamples)
         self.numSamples = int(numSamples)
-        
+
     def sampleCurve(self, fCompute = 1, curveName = None):
     def sampleCurve(self, fCompute = 1, curveName = None):
         if self.curveCollection == None:
         if self.curveCollection == None:
             print 'MopathRecorder.sampleCurve: Must define curve first'
             print 'MopathRecorder.sampleCurve: Must define curve first'
@@ -1429,7 +1429,7 @@ class MopathRecorder(AppShell, DirectObject):
     def setPathDuration(self, event):
     def setPathDuration(self, event):
         newMaxT = float(self.getWidget('Resample', 'Path Duration').get())
         newMaxT = float(self.getWidget('Resample', 'Path Duration').get())
         self.setPathDurationTo(newMaxT)
         self.setPathDurationTo(newMaxT)
-        
+
     def setPathDurationTo(self, newMaxT):
     def setPathDurationTo(self, newMaxT):
         # Compute scale factor
         # Compute scale factor
         sf = newMaxT/self.maxT
         sf = newMaxT/self.maxT
@@ -1725,7 +1725,7 @@ class MopathRecorder(AppShell, DirectObject):
     ## WIDGET UTILITY FUNCTIONS ##
     ## WIDGET UTILITY FUNCTIONS ##
     def addWidget(self, widget, category, text):
     def addWidget(self, widget, category, text):
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
-        
+
     def getWidget(self, category, text):
     def getWidget(self, category, text):
         return self.widgetDict[category + '-' + text]
         return self.widgetDict[category + '-' + text]
 
 
@@ -1763,7 +1763,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.bind(widget, balloonHelp)
         self.bind(widget, balloonHelp)
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         return widget
         return widget
-        
+
     def createCheckbutton(self, parent, category, text,
     def createCheckbutton(self, parent, category, text,
                           balloonHelp, command, initialState,
                           balloonHelp, command, initialState,
                           side = 'top', fill = Tkinter.X, expand = 0):
                           side = 'top', fill = Tkinter.X, expand = 0):
@@ -1778,7 +1778,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         self.variableDict[category + '-' + text] = bool
         self.variableDict[category + '-' + text] = bool
         return widget
         return widget
-        
+
     def createRadiobutton(self, parent, side, category, text,
     def createRadiobutton(self, parent, side, category, text,
                           balloonHelp, variable, value,
                           balloonHelp, variable, value,
                           command = None, fill = Tkinter.X, expand = 0):
                           command = None, fill = Tkinter.X, expand = 0):
@@ -1790,7 +1790,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.bind(widget, balloonHelp)
         self.bind(widget, balloonHelp)
         self.widgetDict[category + '-' + text] = widget
         self.widgetDict[category + '-' + text] = widget
         return widget
         return widget
-        
+
     def createFloater(self, parent, category, text, balloonHelp,
     def createFloater(self, parent, category, text, balloonHelp,
                       command = None, min = 0.0, resolution = None,
                       command = None, min = 0.0, resolution = None,
                       maxVelocity = 10.0, **kw):
                       maxVelocity = 10.0, **kw):
@@ -1948,7 +1948,7 @@ class MopathRecorder(AppShell, DirectObject):
         self.cCamNode.setLens(self.cLens)
         self.cCamNode.setLens(self.cLens)
         self.cCamNode.setScene(render)
         self.cCamNode.setScene(render)
         self.cCam = self.cCamera.attachNewNode(self.cCamNode)
         self.cCam = self.cCamera.attachNewNode(self.cCamNode)
-        
+
         self.cDr.setCamera(self.cCam)
         self.cDr.setCamera(self.cCam)
 
 
     def toggleWidgetVis(self):
     def toggleWidgetVis(self):
@@ -1984,8 +1984,8 @@ class MopathRecorder(AppShell, DirectObject):
         comboBox.selectitem(name)
         comboBox.selectitem(name)
         messenger.send('mPath_bindPathToNode',[self.playbackNodePath, self.curveCollection])
         messenger.send('mPath_bindPathToNode',[self.playbackNodePath, self.curveCollection])
         return
         return
-        
-        
+
+
 
 
     def addCurvesFromNodepath(self,curveList):
     def addCurvesFromNodepath(self,curveList):
         '''addCurvesFromNodepath(self,curveList)
         '''addCurvesFromNodepath(self,curveList)
@@ -2039,7 +2039,7 @@ class namePathPanel(AppShell):
         label = Label(dataFrame, text='This name will be used as a reference for this Path.',font=('MSSansSerif', 10))
         label = Label(dataFrame, text='This name will be used as a reference for this Path.',font=('MSSansSerif', 10))
         label.pack(side = Tkinter.TOP, expand = 0, fill = Tkinter.X)
         label.pack(side = Tkinter.TOP, expand = 0, fill = Tkinter.X)
         dataFrame.pack(side = Tkinter.TOP, expand = 0, fill = Tkinter.X, padx=5, pady=10)
         dataFrame.pack(side = Tkinter.TOP, expand = 0, fill = Tkinter.X, padx=5, pady=10)
-        
+
         dataFrame = Frame(mainFrame)
         dataFrame = Frame(mainFrame)
         self.inputZone = Pmw.EntryField(dataFrame, labelpos='w', label_text = 'Name Selected Path: ',
         self.inputZone = Pmw.EntryField(dataFrame, labelpos='w', label_text = 'Name Selected Path: ',
                                         entry_font=('MSSansSerif', 10),
                                         entry_font=('MSSansSerif', 10),
@@ -2055,15 +2055,15 @@ class namePathPanel(AppShell):
 
 
         mainFrame.pack(expand = 1, fill = Tkinter.BOTH)
         mainFrame.pack(expand = 1, fill = Tkinter.BOTH)
 
 
-        
-        
+
+
     def onDestroy(self, event):
     def onDestroy(self, event):
         '''
         '''
         If you have open any thing, please rewrite here!
         If you have open any thing, please rewrite here!
         '''
         '''
         pass
         pass
 
 
-    
+
     def ok_press(self):
     def ok_press(self):
         name = self.inputZone.getvalue()
         name = self.inputZone.getvalue()
         messenger.send('MP_checkName',[name])
         messenger.send('MP_checkName',[name])

+ 4 - 4
contrib/src/sceneeditor/seParticleEffect.py

@@ -6,7 +6,7 @@ from direct.directnotify import DirectNotifyGlobal
 class ParticleEffect(NodePath):
 class ParticleEffect(NodePath):
 
 
     notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffect')
     notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffect')
-    pid = 1 
+    pid = 1
 
 
     def __init__(self, name=None, particles=None):
     def __init__(self, name=None, particles=None):
         """__init__()"""
         """__init__()"""
@@ -143,7 +143,7 @@ class ParticleEffect(NodePath):
     def getParticlesList(self):
     def getParticlesList(self):
         """getParticles()"""
         """getParticles()"""
         return self.particlesDict.values()
         return self.particlesDict.values()
-    
+
     def getParticlesNamed(self, name):
     def getParticlesNamed(self, name):
         """getParticlesNamed(name)"""
         """getParticlesNamed(name)"""
         return self.particlesDict.get(name, None)
         return self.particlesDict.get(name, None)
@@ -186,7 +186,7 @@ class ParticleEffect(NodePath):
         # Save all the particles to file
         # Save all the particles to file
         num = 0
         num = 0
         for p in self.particlesDict.values():
         for p in self.particlesDict.values():
-            target = 'p%d' % num 
+            target = 'p%d' % num
             num = num + 1
             num = num + 1
             f.write(target + ' = Particles.Particles(\'%s\')\n' % p.getName())
             f.write(target + ' = Particles.Particles(\'%s\')\n' % p.getName())
             p.printParams(f, target)
             p.printParams(f, target)
@@ -240,7 +240,7 @@ class ParticleEffect(NodePath):
         # Save all the particles to file
         # Save all the particles to file
         num = 0
         num = 0
         for p in self.particlesDict.values():
         for p in self.particlesDict.values():
-            target = 'p%d' % num 
+            target = 'p%d' % num
             num = num + 1
             num = num + 1
             f.write(i2+"if(mode==0):\n")
             f.write(i2+"if(mode==0):\n")
             f.write(i2+i1+target + ' = seParticles.Particles(\'%s\')\n' % p.getName())
             f.write(i2+i1+target + ' = seParticles.Particles(\'%s\')\n' % p.getName())

+ 3 - 3
contrib/src/sceneeditor/seParticlePanel.py

@@ -48,16 +48,16 @@ class ParticlePanel(AppShell):
             pe = seParticleEffect.ParticleEffect('effect1', particles)
             pe = seParticleEffect.ParticleEffect('effect1', particles)
             self.particleEffect = pe
             self.particleEffect = pe
             self.emitter=loader.loadModel("sphere")
             self.emitter=loader.loadModel("sphere")
-            pe.reparentTo(self.emitter) 
+            pe.reparentTo(self.emitter)
             self.emitter.setName("effect1")
             self.emitter.setName("effect1")
             self.emitter.reparentTo(render)
             self.emitter.reparentTo(render)
             pe.enable()
             pe.enable()
             messenger.send('ParticlePanel_Added_Effect',['effect1',pe,self.emitter])
             messenger.send('ParticlePanel_Added_Effect',['effect1',pe,self.emitter])
             self.effectsDict[self.particleEffect.getName()]=self.particleEffect
             self.effectsDict[self.particleEffect.getName()]=self.particleEffect
-        
+
 
 
         messenger.send('SGE_Update Explorer',[render])
         messenger.send('SGE_Update Explorer',[render])
-        
+
         # Initialize application specific info
         # Initialize application specific info
         AppShell.__init__(self)
         AppShell.__init__(self)
 
 

+ 1 - 1
contrib/src/sceneeditor/seParticles.py

@@ -144,7 +144,7 @@ class Particles(ParticleSystem):
             self.renderer = SpriteParticleRenderer.SpriteParticleRenderer()
             self.renderer = SpriteParticleRenderer.SpriteParticleRenderer()
             if (self.renderer.getSourceType() ==
             if (self.renderer.getSourceType() ==
                 SpriteParticleRenderer.SpriteParticleRenderer.STTexture):
                 SpriteParticleRenderer.SpriteParticleRenderer.STTexture):
-                # Use current default texture 
+                # Use current default texture
                 # See sourceTextureName SpriteParticleRenderer-extensions.py
                 # See sourceTextureName SpriteParticleRenderer-extensions.py
                 self.renderer.setTextureFromFile()
                 self.renderer.setTextureFromFile()
             else:
             else:

+ 19 - 19
contrib/src/sceneeditor/sePlacer.py

@@ -31,7 +31,7 @@ class Placer(AppShell):
 
 
         # Call superclass initialization function
         # Call superclass initialization function
         AppShell.__init__(self)
         AppShell.__init__(self)
-        
+
         self.initialiseoptions(Placer)
         self.initialiseoptions(Placer)
 
 
         # Accept the message from sceneEditor to update the information about the target nodePath
         # Accept the message from sceneEditor to update the information about the target nodePath
@@ -44,7 +44,7 @@ class Placer(AppShell):
             'placerOrbitFromCS')
             'placerOrbitFromCS')
         self.orbitToCS = SEditor.group.attachNewNode('placerOrbitToCS')
         self.orbitToCS = SEditor.group.attachNewNode('placerOrbitToCS')
         self.refCS = self.tempCS
         self.refCS = self.tempCS
-        
+
         # Dictionary keeping track of all node paths manipulated so far
         # Dictionary keeping track of all node paths manipulated so far
         self.nodePathDict = {}
         self.nodePathDict = {}
         self.nodePathDict['camera'] = SEditor.camera
         self.nodePathDict['camera'] = SEditor.camera
@@ -109,7 +109,7 @@ class Placer(AppShell):
             'Toggle widget manipulation mode',
             'Toggle widget manipulation mode',
             label = 'Toggle Widget Mode',
             label = 'Toggle Widget Mode',
             command = SEditor.manipulationControl.toggleObjectHandlesMode)
             command = SEditor.manipulationControl.toggleObjectHandlesMode)
-        
+
         # Get a handle to the menu frame
         # Get a handle to the menu frame
         menuFrame = self.menuFrame
         menuFrame = self.menuFrame
         self.nodePathMenu = Pmw.ComboBox(
         self.nodePathMenu = Pmw.ComboBox(
@@ -133,7 +133,7 @@ class Placer(AppShell):
                                   menubutton_width = 8)
                                   menubutton_width = 8)
         modeMenu.pack(side = 'left', expand = 0)
         modeMenu.pack(side = 'left', expand = 0)
         self.bind(modeMenu, 'Select manipulation mode')
         self.bind(modeMenu, 'Select manipulation mode')
-        
+
         self.refNodePathMenu = Pmw.ComboBox(
         self.refNodePathMenu = Pmw.ComboBox(
             menuFrame, entry_width = 16,
             menuFrame, entry_width = 16,
             selectioncommand = self.selectRefNodePathNamed,
             selectioncommand = self.selectRefNodePathNamed,
@@ -190,7 +190,7 @@ class Placer(AppShell):
         self.posX['postCallback'] = self.xformStop
         self.posX['postCallback'] = self.xformStop
         self.posX['callbackData'] = ['x']
         self.posX['callbackData'] = ['x']
         self.posX.pack(expand=1,fill='both')
         self.posX.pack(expand=1,fill='both')
-        
+
         self.posY = self.createcomponent('posY', (), None,
         self.posY = self.createcomponent('posY', (), None,
                                          Floater, (posInterior,),
                                          Floater, (posInterior,),
                                          text = 'Y', relief = Tkinter.FLAT,
                                          text = 'Y', relief = Tkinter.FLAT,
@@ -201,7 +201,7 @@ class Placer(AppShell):
         self.posY['postCallback'] = self.xformStop
         self.posY['postCallback'] = self.xformStop
         self.posY['callbackData'] = ['y']
         self.posY['callbackData'] = ['y']
         self.posY.pack(expand=1,fill='both')
         self.posY.pack(expand=1,fill='both')
-        
+
         self.posZ = self.createcomponent('posZ', (), None,
         self.posZ = self.createcomponent('posZ', (), None,
                                          Floater, (posInterior,),
                                          Floater, (posInterior,),
                                          text = 'Z', relief = Tkinter.FLAT,
                                          text = 'Z', relief = Tkinter.FLAT,
@@ -228,7 +228,7 @@ class Placer(AppShell):
         hprMenubutton['menu'] = hprMenu
         hprMenubutton['menu'] = hprMenu
         hprGroup.pack(side='left',fill = 'both', expand = 1)
         hprGroup.pack(side='left',fill = 'both', expand = 1)
         hprInterior = hprGroup.interior()
         hprInterior = hprGroup.interior()
-        
+
         # Create the dials
         # Create the dials
         self.hprH = self.createcomponent('hprH', (), None,
         self.hprH = self.createcomponent('hprH', (), None,
                                          AngleDial, (hprInterior,),
                                          AngleDial, (hprInterior,),
@@ -241,7 +241,7 @@ class Placer(AppShell):
         self.hprH['postCallback'] = self.xformStop
         self.hprH['postCallback'] = self.xformStop
         self.hprH['callbackData'] = ['h']
         self.hprH['callbackData'] = ['h']
         self.hprH.pack(expand=1,fill='both')
         self.hprH.pack(expand=1,fill='both')
-        
+
         self.hprP = self.createcomponent('hprP', (), None,
         self.hprP = self.createcomponent('hprP', (), None,
                                          AngleDial, (hprInterior,),
                                          AngleDial, (hprInterior,),
                                          style = 'mini',
                                          style = 'mini',
@@ -253,7 +253,7 @@ class Placer(AppShell):
         self.hprP['postCallback'] = self.xformStop
         self.hprP['postCallback'] = self.xformStop
         self.hprP['callbackData'] = ['p']
         self.hprP['callbackData'] = ['p']
         self.hprP.pack(expand=1,fill='both')
         self.hprP.pack(expand=1,fill='both')
-        
+
         self.hprR = self.createcomponent('hprR', (), None,
         self.hprR = self.createcomponent('hprR', (), None,
                                          AngleDial, (hprInterior,),
                                          AngleDial, (hprInterior,),
                                          style = 'mini',
                                          style = 'mini',
@@ -297,7 +297,7 @@ class Placer(AppShell):
         # Pack group widgets
         # Pack group widgets
         scaleGroup.pack(side='left',fill = 'both', expand = 1)
         scaleGroup.pack(side='left',fill = 'both', expand = 1)
         scaleInterior = scaleGroup.interior()
         scaleInterior = scaleGroup.interior()
-        
+
         # Create the dials
         # Create the dials
         self.scaleX = self.createcomponent('scaleX', (), None,
         self.scaleX = self.createcomponent('scaleX', (), None,
                                            Floater, (scaleInterior,),
                                            Floater, (scaleInterior,),
@@ -311,7 +311,7 @@ class Placer(AppShell):
         self.scaleX['preCallback'] = self.xformStart
         self.scaleX['preCallback'] = self.xformStart
         self.scaleX['postCallback'] = self.xformStop
         self.scaleX['postCallback'] = self.xformStop
         self.scaleX.pack(expand=1,fill='both')
         self.scaleX.pack(expand=1,fill='both')
-        
+
         self.scaleY = self.createcomponent('scaleY', (), None,
         self.scaleY = self.createcomponent('scaleY', (), None,
                                            Floater, (scaleInterior,),
                                            Floater, (scaleInterior,),
                                            text = 'Y Scale',
                                            text = 'Y Scale',
@@ -324,7 +324,7 @@ class Placer(AppShell):
         self.scaleY['preCallback'] = self.xformStart
         self.scaleY['preCallback'] = self.xformStart
         self.scaleY['postCallback'] = self.xformStop
         self.scaleY['postCallback'] = self.xformStop
         self.scaleY.pack(expand=1,fill='both')
         self.scaleY.pack(expand=1,fill='both')
-        
+
         self.scaleZ = self.createcomponent('scaleZ', (), None,
         self.scaleZ = self.createcomponent('scaleZ', (), None,
                                            Floater, (scaleInterior,),
                                            Floater, (scaleInterior,),
                                            text = 'Z Scale',
                                            text = 'Z Scale',
@@ -417,7 +417,7 @@ class Placer(AppShell):
             else:
             else:
                 if name == 'widget':
                 if name == 'widget':
                     # Record relationship between selected nodes and widget
                     # Record relationship between selected nodes and widget
-                    SEditor.selected.getWrtAll()                    
+                    SEditor.selected.getWrtAll()
         # Update active node path
         # Update active node path
         self.setActiveNodePath(nodePath)
         self.setActiveNodePath(nodePath)
 
 
@@ -490,7 +490,7 @@ class Placer(AppShell):
         else:
         else:
             # Flash entry
             # Flash entry
             self.refNodePathMenuEntry.configure(background = 'Pink')
             self.refNodePathMenuEntry.configure(background = 'Pink')
-        
+
     def addNodePath(self, nodePath):
     def addNodePath(self, nodePath):
         self.addNodePathToDict(nodePath, self.nodePathNames,
         self.addNodePathToDict(nodePath, self.nodePathNames,
                                self.nodePathMenu, self.nodePathDict)
                                self.nodePathMenu, self.nodePathDict)
@@ -568,7 +568,7 @@ class Placer(AppShell):
             else:
             else:
                 # Move the objects with the widget
                 # Move the objects with the widget
                 SEditor.selected.moveWrtWidgetAll()
                 SEditor.selected.moveWrtWidgetAll()
-    
+
     def xformStart(self, data):
     def xformStart(self, data):
         # Record undo point
         # Record undo point
         self.pushUndo()
         self.pushUndo()
@@ -581,7 +581,7 @@ class Placer(AppShell):
         self.deltaHpr = self['nodePath'].getHpr(self.refCS)
         self.deltaHpr = self['nodePath'].getHpr(self.refCS)
         # Update placer to reflect new state
         # Update placer to reflect new state
         self.updatePlacer()
         self.updatePlacer()
-        
+
     def xformStop(self, data):
     def xformStop(self, data):
         # Throw event to signal manipulation done
         # Throw event to signal manipulation done
         # Send nodepath as a list
         # Send nodepath as a list
@@ -746,7 +746,7 @@ class Placer(AppShell):
 
 
     def pushRedo(self):
     def pushRedo(self):
         SEditor.pushRedo([self['nodePath']])
         SEditor.pushRedo([self['nodePath']])
-        
+
     def redoHook(self, nodePathList = []):
     def redoHook(self, nodePathList = []):
         # Reflect new changes
         # Reflect new changes
         self.updatePlacer()
         self.updatePlacer()
@@ -758,7 +758,7 @@ class Placer(AppShell):
     def redoListEmptyHook(self):
     def redoListEmptyHook(self):
         # Make sure button is deactivated
         # Make sure button is deactivated
         self.redoButton.configure(state = 'disabled')
         self.redoButton.configure(state = 'disabled')
-        
+
     def printNodePathInfo(self):
     def printNodePathInfo(self):
         np = self['nodePath']
         np = self['nodePath']
         if np:
         if np:
@@ -787,7 +787,7 @@ class Placer(AppShell):
         # Also, stop accepting the updata message from sceneEditor
         # Also, stop accepting the updata message from sceneEditor
         messenger.send('Placer_close')
         messenger.send('Placer_close')
         self.ignore('placerUpdate')
         self.ignore('placerUpdate')
-        
+
 def place(nodePath):
 def place(nodePath):
     return Placer(nodePath = nodePath)
     return Placer(nodePath = nodePath)
 
 

+ 9 - 9
contrib/src/sceneeditor/seSceneGraphExplorer.py

@@ -5,7 +5,7 @@
 #
 #
 # we need a customized SceneGraphExplorer.
 # we need a customized SceneGraphExplorer.
 #
 #
-# Do forget to check the seTree. 
+# Do forget to check the seTree.
 #
 #
 #################################################################
 #################################################################
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
@@ -40,25 +40,25 @@ DEFAULT_MENU_ITEMS = [
 
 
 class seSceneGraphExplorer(Pmw.MegaWidget, DirectObject):
 class seSceneGraphExplorer(Pmw.MegaWidget, DirectObject):
     "Graphical display of a scene graph"
     "Graphical display of a scene graph"
-    def __init__(self, parent = None, nodePath = render, **kw): 
+    def __init__(self, parent = None, nodePath = render, **kw):
         # Define the megawidget options.
         # Define the megawidget options.
         optiondefs = (
         optiondefs = (
             ('menuItems',   [],   Pmw.INITOPT),
             ('menuItems',   [],   Pmw.INITOPT),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
- 
+
         # Initialise superclass
         # Initialise superclass
         Pmw.MegaWidget.__init__(self, parent)
         Pmw.MegaWidget.__init__(self, parent)
-        
+
         # Initialize some class variables
         # Initialize some class variables
         self.nodePath = nodePath
         self.nodePath = nodePath
 
 
         # Create the components.
         # Create the components.
-        
+
         # Setup up container
         # Setup up container
         interior = self.interior()
         interior = self.interior()
         interior.configure(relief = Tkinter.GROOVE, borderwidth = 2)
         interior.configure(relief = Tkinter.GROOVE, borderwidth = 2)
-        
+
         # Create a label and an entry
         # Create a label and an entry
         self._scrolledCanvas = self.createcomponent(
         self._scrolledCanvas = self.createcomponent(
             'scrolledCanvas',
             'scrolledCanvas',
@@ -70,14 +70,14 @@ class seSceneGraphExplorer(Pmw.MegaWidget, DirectObject):
         self._canvas['scrollregion'] = ('0i', '0i', '2i', '4i')
         self._canvas['scrollregion'] = ('0i', '0i', '2i', '4i')
         self._scrolledCanvas.resizescrollregion()
         self._scrolledCanvas.resizescrollregion()
         self._scrolledCanvas.pack(padx = 3, pady = 3, expand=1, fill = Tkinter.BOTH)
         self._scrolledCanvas.pack(padx = 3, pady = 3, expand=1, fill = Tkinter.BOTH)
-        
+
         self._canvas.bind('<ButtonPress-2>', self.mouse2Down)
         self._canvas.bind('<ButtonPress-2>', self.mouse2Down)
         self._canvas.bind('<B2-Motion>', self.mouse2Motion)
         self._canvas.bind('<B2-Motion>', self.mouse2Motion)
         self._canvas.bind('<Configure>',
         self._canvas.bind('<Configure>',
                           lambda e, sc = self._scrolledCanvas:
                           lambda e, sc = self._scrolledCanvas:
                           sc.resizescrollregion())
                           sc.resizescrollregion())
         self.interior().bind('<Destroy>', self.onDestroy)
         self.interior().bind('<Destroy>', self.onDestroy)
-        
+
         # Create the contents
         # Create the contents
         self._treeItem = SceneGraphExplorerItem(self.nodePath)
         self._treeItem = SceneGraphExplorerItem(self.nodePath)
 
 
@@ -114,7 +114,7 @@ class seSceneGraphExplorer(Pmw.MegaWidget, DirectObject):
         self._width = 1.0 * self._canvas.winfo_width()
         self._width = 1.0 * self._canvas.winfo_width()
         self._height = 1.0 * self._canvas.winfo_height()
         self._height = 1.0 * self._canvas.winfo_height()
         xview = self._canvas.xview()
         xview = self._canvas.xview()
-        yview = self._canvas.yview()        
+        yview = self._canvas.yview()
         self._left = xview[0]
         self._left = xview[0]
         self._top = yview[0]
         self._top = yview[0]
         self._dxview = xview[1] - xview[0]
         self._dxview = xview[1] - xview[0]

+ 24 - 24
contrib/src/sceneeditor/seSelection.py

@@ -35,7 +35,7 @@ class DirectNodePath(NodePath):
         self.mCoa2Dnp = Mat4(Mat4.identMat())
         self.mCoa2Dnp = Mat4(Mat4.identMat())
         if SEditor.coaMode == COA_CENTER:
         if SEditor.coaMode == COA_CENTER:
             self.mCoa2Dnp.setRow(3, Vec4(center[0], center[1], center[2], 1))
             self.mCoa2Dnp.setRow(3, Vec4(center[0], center[1], center[2], 1))
-            
+
         # Transform from nodePath to widget
         # Transform from nodePath to widget
         self.tDnp2Widget = TransformState.makeIdentity()
         self.tDnp2Widget = TransformState.makeIdentity()
 
 
@@ -72,11 +72,11 @@ class SelectedNodePaths(DirectObject):
         if not nodePath:
         if not nodePath:
             print 'Nothing selected!!'
             print 'Nothing selected!!'
             return None
             return None
-        
+
         # Reset selected objects and highlight if multiSelect is false
         # Reset selected objects and highlight if multiSelect is false
         if not fMultiSelect:
         if not fMultiSelect:
             self.deselectAll()
             self.deselectAll()
-        
+
         # Get this pointer
         # Get this pointer
         id = nodePath.id()
         id = nodePath.id()
         # First see if its already in the selected dictionary
         # First see if its already in the selected dictionary
@@ -199,7 +199,7 @@ class SelectedNodePaths(DirectObject):
         if selected:
         if selected:
             selected.remove()
             selected.remove()
         __builtins__["last"] = self.last = None
         __builtins__["last"] = self.last = None
-        
+
     def removeAll(self):
     def removeAll(self):
         # Remove all selected nodePaths from the Scene Graph
         # Remove all selected nodePaths from the Scene Graph
         self.forEachSelectedNodePathDo(NodePath.remove)
         self.forEachSelectedNodePathDo(NodePath.remove)
@@ -258,7 +258,7 @@ class DirectBoundingBox:
         # Restore transform
         # Restore transform
         self.nodePath.setMat(tMat)
         self.nodePath.setMat(tMat)
         del tMat
         del tMat
-        
+
     def computeBounds(self):
     def computeBounds(self):
         self.bounds = self.getBounds()
         self.bounds = self.getBounds()
         if self.bounds.isEmpty() or self.bounds.isInfinite():
         if self.bounds.isEmpty() or self.bounds.isInfinite():
@@ -269,7 +269,7 @@ class DirectBoundingBox:
             self.radius = self.bounds.getRadius()
             self.radius = self.bounds.getRadius()
         self.min = Point3(self.center - Point3(self.radius))
         self.min = Point3(self.center - Point3(self.radius))
         self.max = Point3(self.center + Point3(self.radius))
         self.max = Point3(self.center + Point3(self.radius))
-        
+
     def createBBoxLines(self):
     def createBBoxLines(self):
         # Create a line segments object for the bbox
         # Create a line segments object for the bbox
         lines = LineNodePath(hidden)
         lines = LineNodePath(hidden)
@@ -283,7 +283,7 @@ class DirectBoundingBox:
         maxX = self.max[0]
         maxX = self.max[0]
         maxY = self.max[1]
         maxY = self.max[1]
         maxZ = self.max[2]
         maxZ = self.max[2]
-        
+
         # Bottom face
         # Bottom face
         lines.moveTo( minX, minY, minZ )
         lines.moveTo( minX, minY, minZ )
         lines.drawTo( maxX, minY, minZ )
         lines.drawTo( maxX, minY, minZ )
@@ -308,22 +308,22 @@ class DirectBoundingBox:
 
 
         # Create and return bbox lines
         # Create and return bbox lines
         lines.create()
         lines.create()
-        
+
         # Make sure bbox is never lit or drawn in wireframe
         # Make sure bbox is never lit or drawn in wireframe
         useDirectRenderStyle(lines)
         useDirectRenderStyle(lines)
-        
+
         return lines
         return lines
 
 
     def updateBBoxLines(self):
     def updateBBoxLines(self):
         ls = self.lines.lineSegs
         ls = self.lines.lineSegs
-        
+
         minX = self.min[0]
         minX = self.min[0]
         minY = self.min[1]
         minY = self.min[1]
         minZ = self.min[2]
         minZ = self.min[2]
         maxX = self.max[0]
         maxX = self.max[0]
         maxY = self.max[1]
         maxY = self.max[1]
         maxZ = self.max[2]
         maxZ = self.max[2]
-        
+
         # Bottom face
         # Bottom face
         ls.setVertex( 0, minX, minY, minZ )
         ls.setVertex( 0, minX, minY, minZ )
         ls.setVertex( 1, maxX, minY, minZ )
         ls.setVertex( 1, maxX, minY, minZ )
@@ -359,7 +359,7 @@ class DirectBoundingBox:
 
 
     def hide(self):
     def hide(self):
         self.lines.reparentTo(hidden)
         self.lines.reparentTo(hidden)
-        
+
     def getCenter(self):
     def getCenter(self):
         return self.center
         return self.center
 
 
@@ -376,7 +376,7 @@ class DirectBoundingBox:
         return '%.2f %.2f %.2f' % (vec[0], vec[1], vec[2])
         return '%.2f %.2f %.2f' % (vec[0], vec[1], vec[2])
 
 
     def __repr__(self):
     def __repr__(self):
-        return (`self.__class__` + 
+        return (`self.__class__` +
                 '\nNodePath:\t%s\n' % self.nodePath.getName() +
                 '\nNodePath:\t%s\n' % self.nodePath.getName() +
                 'Min:\t\t%s\n' % self.vecAsString(self.min) +
                 'Min:\t\t%s\n' % self.vecAsString(self.min) +
                 'Max:\t\t%s\n' % self.vecAsString(self.max) +
                 'Max:\t\t%s\n' % self.vecAsString(self.max) +
@@ -533,7 +533,7 @@ class SelectionRay(SelectionQueue):
         # Initialize the superclass
         # Initialize the superclass
         SelectionQueue.__init__(self, parentNP)
         SelectionQueue.__init__(self, parentNP)
         self.addCollider(CollisionRay())
         self.addCollider(CollisionRay())
-    
+
     def pick(self, targetNodePath, xy = None):
     def pick(self, targetNodePath, xy = None):
         # Determine ray direction based upon the mouse coordinates
         # Determine ray direction based upon the mouse coordinates
         if xy:
         if xy:
@@ -553,7 +553,7 @@ class SelectionRay(SelectionQueue):
         #mx = base.mouseWatcherNode.getMouseX()+1
         #mx = base.mouseWatcherNode.getMouseX()+1
         #my = base.mouseWatcherNode.getMouseY()+1
         #my = base.mouseWatcherNode.getMouseY()+1
         #print base.camNode.getName()
         #print base.camNode.getName()
-        #print "Arrived X" + str(mx) + " Arrived Y " + str(my) 
+        #print "Arrived X" + str(mx) + " Arrived Y " + str(my)
         self.collider.setFromLens( base.camNode, mx, my )
         self.collider.setFromLens( base.camNode, mx, my )
 
 
         self.ct.traverse( targetNodePath )
         self.ct.traverse( targetNodePath )
@@ -587,7 +587,7 @@ class SelectionRay(SelectionQueue):
         self.collider.setDirection( dir )
         self.collider.setDirection( dir )
         self.ct.traverse( targetNodePath )
         self.ct.traverse( targetNodePath )
         self.sortEntries()
         self.sortEntries()
-        
+
     def pickGeom3D(self, targetNodePath = render,
     def pickGeom3D(self, targetNodePath = render,
                    origin = Point3(0), dir = Vec3(0,0,-1),
                    origin = Point3(0), dir = Vec3(0,0,-1),
                    skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):
                    skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):
@@ -616,7 +616,7 @@ class SelectionSegment(SelectionQueue):
         self.numColliders = 0
         self.numColliders = 0
         for i in range(numSegments):
         for i in range(numSegments):
             self.addCollider(CollisionSegment())
             self.addCollider(CollisionSegment())
-    
+
     def addCollider(self, collider):
     def addCollider(self, collider):
         # Record new collision object
         # Record new collision object
         self.colliders.append(collider)
         self.colliders.append(collider)
@@ -659,30 +659,30 @@ class SelectionSphere(SelectionQueue):
         self.numColliders = 0
         self.numColliders = 0
         for i in range(numSpheres):
         for i in range(numSpheres):
             self.addCollider(CollisionSphere(Point3(0), 1))
             self.addCollider(CollisionSphere(Point3(0), 1))
-        
+
     def addCollider(self, collider):
     def addCollider(self, collider):
         # Record new collision object
         # Record new collision object
         self.colliders.append(collider)
         self.colliders.append(collider)
         # Add the collider to the collision Node
         # Add the collider to the collision Node
         self.collisionNode.addSolid( collider )
         self.collisionNode.addSolid( collider )
         self.numColliders += 1
         self.numColliders += 1
-    
+
     def setCenter(self, i, center):
     def setCenter(self, i, center):
         c = self.colliders[i]
         c = self.colliders[i]
         c.setCenter(center)
         c.setCenter(center)
-    
+
     def setRadius(self, i, radius):
     def setRadius(self, i, radius):
         c = self.colliders[i]
         c = self.colliders[i]
         c.setRadius(radius)
         c.setRadius(radius)
-    
+
     def setCenterRadius(self, i, center, radius):
     def setCenterRadius(self, i, center, radius):
         c = self.colliders[i]
         c = self.colliders[i]
         c.setCenter(center)
         c.setCenter(center)
         c.setRadius(radius)
         c.setRadius(radius)
-    
+
     def isEntryBackfacing(self, entry):
     def isEntryBackfacing(self, entry):
         # If dot product of collision point surface normal and
         # If dot product of collision point surface normal and
-        # ray from sphere origin to collision point is positive, 
+        # ray from sphere origin to collision point is positive,
         # center is on the backside of the polygon
         # center is on the backside of the polygon
         fromNodePath = entry.getFromNodePath()
         fromNodePath = entry.getFromNodePath()
         v = Vec3(entry.getSurfacePoint(fromNodePath) -
         v = Vec3(entry.getSurfacePoint(fromNodePath) -
@@ -706,7 +706,7 @@ class SelectionSphere(SelectionQueue):
                  skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):
                  skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):
         self.collideWithGeom()
         self.collideWithGeom()
         return self.pick(targetNodePath, skipFlags)
         return self.pick(targetNodePath, skipFlags)
-    
+
     def pickBitMask(self, bitMask = BitMask32.allOff(),
     def pickBitMask(self, bitMask = BitMask32.allOff(),
                     targetNodePath = render,
                     targetNodePath = render,
                     skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):
                     skipFlags = SKIP_HIDDEN | SKIP_CAMERA ):

+ 20 - 20
contrib/src/sceneeditor/seSession.py

@@ -49,7 +49,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
         self.useObjectHandles()
         self.useObjectHandles()
         self.grid = DirectGrid()
         self.grid = DirectGrid()
         self.grid.disable()
         self.grid.disable()
-        
+
         # Initialize the collection of selected nodePaths
         # Initialize the collection of selected nodePaths
         self.selected = SelectedNodePaths()
         self.selected = SelectedNodePaths()
         # Ancestry of currently selected object
         # Ancestry of currently selected object
@@ -94,19 +94,19 @@ class SeSession(DirectObject):  ### Customized DirectSession
         # Lists for managing undo/redo operations
         # Lists for managing undo/redo operations
         self.undoList = []
         self.undoList = []
         self.redoList = []
         self.redoList = []
-        
+
         # One run through the context task to init everything
         # One run through the context task to init everything
         self.drList.updateContext()
         self.drList.updateContext()
         for dr in self.drList:
         for dr in self.drList:
             dr.camUpdate()
             dr.camUpdate()
 
 
-        
+
 
 
         self.modifierEvents = ['control', 'control-up',
         self.modifierEvents = ['control', 'control-up',
                               'shift', 'shift-up',
                               'shift', 'shift-up',
                               'alt', 'alt-up',
                               'alt', 'alt-up',
                               ]
                               ]
-        self.keyEvents = ['escape', 'delete', 'page_up', 'page_down', 
+        self.keyEvents = ['escape', 'delete', 'page_up', 'page_down',
                           '[', '{', ']', '}',
                           '[', '{', ']', '}',
                           'shift-a', 'b', 'control-f',
                           'shift-a', 'b', 'control-f',
                           'l', 'shift-l', 'o', 'p', 'r',
                           'l', 'shift-l', 'o', 'p', 'r',
@@ -124,7 +124,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
                             'control-mouse3', 'control-mouse3-up',
                             'control-mouse3', 'control-mouse3-up',
                             'alt-mouse3', 'alt-mouse3-up',
                             'alt-mouse3', 'alt-mouse3-up',
                             ]
                             ]
-            
+
     def enable(self):
     def enable(self):
         if self.fEnabled:
         if self.fEnabled:
             return
             return
@@ -361,7 +361,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
         elif (input == ']') or (input == '}'):
         elif (input == ']') or (input == '}'):
             self.redo()
             self.redo()
 
 
-        
+
     def getModifiers(self, input, base):
     def getModifiers(self, input, base):
         modifiers = DIRECT_NO_MOD
         modifiers = DIRECT_NO_MOD
         modifierString = input[: input.find(base)]
         modifierString = input[: input.find(base)]
@@ -405,7 +405,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             self.cameraControl.updateCoa(coa)
             self.cameraControl.updateCoa(coa)
             # Adjust widgets size
             # Adjust widgets size
             # This uses the additional scaling factor used to grow and
             # This uses the additional scaling factor used to grow and
-            # shrink the widget            
+            # shrink the widget
             self.widget.setScalingFactor(dnp.getRadius())
             self.widget.setScalingFactor(dnp.getRadius())
             # Spawn task to have object handles follow the selected object
             # Spawn task to have object handles follow the selected object
             taskMgr.remove('followSelectedNodePath')
             taskMgr.remove('followSelectedNodePath')
@@ -462,7 +462,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             'Active Reparent Target:' + nodePath.getName())
             'Active Reparent Target:' + nodePath.getName())
         # Alert everyone else
         # Alert everyone else
         self.activeParentReadout.show()
         self.activeParentReadout.show()
-        
+
     def reparent(self, nodePath = None, fWrt = 0):
     def reparent(self, nodePath = None, fWrt = 0):
         if (nodePath and self.activeParent and
         if (nodePath and self.activeParent and
             self.isNotCycle(nodePath, self.activeParent)):
             self.isNotCycle(nodePath, self.activeParent)):
@@ -486,7 +486,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             return self.isNotCycle(nodePath, parent.getParent())
             return self.isNotCycle(nodePath, parent.getParent())
         else:
         else:
             return 1
             return 1
-        
+
     def fitOnNodePath(self, nodePath = 'None Given'):
     def fitOnNodePath(self, nodePath = 'None Given'):
         if nodePath == 'None Given':
         if nodePath == 'None Given':
             # If nothing specified, try selected node path
             # If nothing specified, try selected node path
@@ -553,7 +553,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
                 if (name != 'render') and (name != 'renderTop')and(self.checkTypeNameForAncestry(type, ntype)):
                 if (name != 'render') and (name != 'renderTop')and(self.checkTypeNameForAncestry(type, ntype)):
                     self.ancestryIndex = i
                     self.ancestryIndex = i
                     self.select(np, 0, 0, True)
                     self.select(np, 0, 0, True)
-            
+
     def checkTypeNameForAncestry(self, type, nextType ):
     def checkTypeNameForAncestry(self, type, nextType ):
         if (type=='ModelRoot'):
         if (type=='ModelRoot'):
             if (nextType=='AmbientLight')or(nextType=='PointLight')or(nextType=='DirectionalLight')or(nextType=='Spotlight'):
             if (nextType=='AmbientLight')or(nextType=='PointLight')or(nextType=='DirectionalLight')or(nextType=='Spotlight'):
@@ -620,7 +620,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             messenger.send('DIRECT_undoListEmpty')
             messenger.send('DIRECT_undoListEmpty')
         # Return last item
         # Return last item
         return undoGroup
         return undoGroup
-        
+
     def pushRedo(self, nodePathList):
     def pushRedo(self, nodePathList):
         # Assemble group of changes
         # Assemble group of changes
         redoGroup = []
         redoGroup = []
@@ -644,7 +644,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             messenger.send('DIRECT_redoListEmpty')
             messenger.send('DIRECT_redoListEmpty')
         # Return last item
         # Return last item
         return redoGroup
         return redoGroup
-        
+
     def undo(self):
     def undo(self):
         if self.undoList:
         if self.undoList:
             # Get last item off of redo list
             # Get last item off of redo list
@@ -736,7 +736,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
         print posE, hprE
         print posE, hprE
         posInterval1 = base.camera.posInterval(time, posE, bakeInStart = 1)
         posInterval1 = base.camera.posInterval(time, posE, bakeInStart = 1)
         posInterval2 = base.camera.posInterval(time, posB, bakeInStart = 1)
         posInterval2 = base.camera.posInterval(time, posB, bakeInStart = 1)
-        
+
         hprInterval1 = base.camera.hprInterval(time, hprE, bakeInStart = 1)
         hprInterval1 = base.camera.hprInterval(time, hprE, bakeInStart = 1)
         hprInterval2 = base.camera.hprInterval(time, hprB, bakeInStart = 1)
         hprInterval2 = base.camera.hprInterval(time, hprB, bakeInStart = 1)
 
 
@@ -744,9 +744,9 @@ class SeSession(DirectObject):  ### Customized DirectSession
         parallel2 = Parallel(posInterval2, hprInterval2)
         parallel2 = Parallel(posInterval2, hprInterval2)
 
 
         Sequence(Wait(7), parallel1, Wait(1), parallel2).start()
         Sequence(Wait(7), parallel1, Wait(1), parallel2).start()
-        
+
         return
         return
-    
+
 
 
 class DisplayRegionContext(DirectObject):
 class DisplayRegionContext(DirectObject):
     regionCount = 0
     regionCount = 0
@@ -833,14 +833,14 @@ class DisplayRegionContext(DirectObject):
             return prop.getXSize()
             return prop.getXSize()
         else:
         else:
             return 640
             return 640
-            
+
     def getHeight(self):
     def getHeight(self):
         prop = base.win.getProperties()
         prop = base.win.getProperties()
         if prop.hasSize():
         if prop.hasSize():
             return prop.getYSize()
             return prop.getYSize()
         else:
         else:
             return 480
             return 480
-            
+
     def camUpdate(self, lens = None):
     def camUpdate(self, lens = None):
         # Window Data
         # Window Data
         self.near = self.camLens.getNear()
         self.near = self.camLens.getNear()
@@ -885,7 +885,7 @@ class DisplayRegionList(DirectObject):
         else:
         else:
             # MRM: Doesn't properly handle multiple camera groups anymore
             # MRM: Doesn't properly handle multiple camera groups anymore
             # Assumes everything is under main camera
             # Assumes everything is under main camera
-            
+
                 # This is following the old way of setting up
                 # This is following the old way of setting up
                 # display regions.  A display region is set up for
                 # display regions.  A display region is set up for
                 # each camera node in the scene graph.  This was done
                 # each camera node in the scene graph.  This was done
@@ -920,11 +920,11 @@ class DisplayRegionList(DirectObject):
     def setNearFar(self, near, far):
     def setNearFar(self, near, far):
         for dr in self.displayRegionList:
         for dr in self.displayRegionList:
             dr.camLens.setNearFar(near, far)
             dr.camLens.setNearFar(near, far)
-    
+
     def setNear(self, near):
     def setNear(self, near):
         for dr in self.displayRegionList:
         for dr in self.displayRegionList:
             dr.camLens.setNear(near)
             dr.camLens.setNear(near)
-    
+
     def setFar(self, far):
     def setFar(self, far):
         for dr in self.displayRegionList:
         for dr in self.displayRegionList:
             dr.camLens.setFar(far)
             dr.camLens.setFar(far)

+ 3 - 3
contrib/src/sceneeditor/seTree.py

@@ -54,7 +54,7 @@ class TreeNode:
                         value = i,
                         value = i,
                         indicatoron = 0,
                         indicatoron = 0,
                         command = self.popupMenuCommand)
                         command = self.popupMenuCommand)
-                    
+
     def destroy(self):
     def destroy(self):
         for key in self.kidKeys:
         for key in self.kidKeys:
             c = self.children[key]
             c = self.children[key]
@@ -257,7 +257,7 @@ class TreeNode:
         self.canvas.tag_bind(id, "<1>", self.select)
         self.canvas.tag_bind(id, "<1>", self.select)
         self.canvas.tag_bind(id, "<Double-1>", self.flip)
         self.canvas.tag_bind(id, "<Double-1>", self.flip)
         self.canvas.tag_bind(id, "<3>", self.popupMenu)
         self.canvas.tag_bind(id, "<3>", self.popupMenu)
-        
+
     def drawtext(self, text=None):
     def drawtext(self, text=None):
         textx = self.x+20-1
         textx = self.x+20-1
         texty = self.y-1
         texty = self.y-1
@@ -410,7 +410,7 @@ class TreeItem:
 
 
     def OnSelect(self):
     def OnSelect(self):
         """Called when item selected."""
         """Called when item selected."""
-        
+
     def GetTextForEdit(self):
     def GetTextForEdit(self):
         """Called before editting the item."""
         """Called before editting the item."""
 
 

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

@@ -25,7 +25,7 @@ class Actor(DirectObject, NodePath):
     validateSubparts = ConfigVariableBool('validate-subparts', True)
     validateSubparts = ConfigVariableBool('validate-subparts', True)
     mergeLODBundles = ConfigVariableBool('merge-lod-bundles', True)
     mergeLODBundles = ConfigVariableBool('merge-lod-bundles', True)
     allowAsyncBind = ConfigVariableBool('allow-async-bind', True)
     allowAsyncBind = ConfigVariableBool('allow-async-bind', True)
-    
+
     class PartDef:
     class PartDef:
 
 
         """Instances of this class are stored within the
         """Instances of this class are stored within the
@@ -34,7 +34,7 @@ class Actor(DirectObject, NodePath):
         model file is a different PartBundle.  This can include the
         model file is a different PartBundle.  This can include the
         multiple different LOD's, as well as the multiple different
         multiple different LOD's, as well as the multiple different
         pieces of a multipart Actor. """
         pieces of a multipart Actor. """
-        
+
         def __init__(self, partBundleNP, partBundleHandle, partModel):
         def __init__(self, partBundleNP, partBundleHandle, partModel):
             # We also save the ModelRoot node along with the
             # We also save the ModelRoot node along with the
             # PartBundle, so that the reference count in the ModelPool
             # PartBundle, so that the reference count in the ModelPool
@@ -45,7 +45,7 @@ class Actor(DirectObject, NodePath):
 
 
         def getBundle(self):
         def getBundle(self):
             return self.partBundleHandle.getBundle()
             return self.partBundleHandle.getBundle()
-        
+
         def __repr__(self):
         def __repr__(self):
             return 'Actor.PartDef(%s, %s)' % (repr(self.partBundleNP), repr(self.partModel))
             return 'Actor.PartDef(%s, %s)' % (repr(self.partBundleNP), repr(self.partModel))
 
 
@@ -59,7 +59,7 @@ class Actor(DirectObject, NodePath):
 
 
         There is a different AnimDef for each different part or
         There is a different AnimDef for each different part or
         sub-part, times each different animation in the AnimDict. """
         sub-part, times each different animation in the AnimDict. """
-        
+
         def __init__(self, filename = None, animBundle = None):
         def __init__(self, filename = None, animBundle = None):
             self.filename = filename
             self.filename = filename
             self.animBundle = None
             self.animBundle = None
@@ -86,8 +86,8 @@ class Actor(DirectObject, NodePath):
 
 
         def makeCopy(self):
         def makeCopy(self):
             return Actor.SubpartDef(self.truePartName, PartSubset(self.subset))
             return Actor.SubpartDef(self.truePartName, PartSubset(self.subset))
-            
-        
+
+
         def __repr__(self):
         def __repr__(self):
             return 'Actor.SubpartDef(%s, %s)' % (repr(self.truePartName), repr(self.subset))
             return 'Actor.SubpartDef(%s, %s)' % (repr(self.truePartName), repr(self.subset))
 
 
@@ -171,7 +171,7 @@ class Actor(DirectObject, NodePath):
         # When this flag is true, __animControlDict has only one key,
         # When this flag is true, __animControlDict has only one key,
         # ['common']; when it is false, __animControlDict has one key
         # ['common']; when it is false, __animControlDict has one key
         # per each LOD name.
         # per each LOD name.
-        
+
         if mergeLODBundles is None:
         if mergeLODBundles is None:
             # If this isn't specified, it comes from the Config.prc
             # If this isn't specified, it comes from the Config.prc
             # file.
             # file.
@@ -223,7 +223,7 @@ class Actor(DirectObject, NodePath):
                 root.setPreserveTransform(1)
                 root.setPreserveTransform(1)
                 self.assign(NodePath(root))
                 self.assign(NodePath(root))
                 self.setGeomNode(self.attachNewNode(ModelNode('actorGeom')))
                 self.setGeomNode(self.attachNewNode(ModelNode('actorGeom')))
-                
+
             self.__hasLOD = 0
             self.__hasLOD = 0
 
 
             # load models
             # load models
@@ -340,7 +340,7 @@ class Actor(DirectObject, NodePath):
     def copyActor(self, other, overwrite=False):
     def copyActor(self, other, overwrite=False):
             # act like a copy constructor
             # act like a copy constructor
             self.gotName = other.gotName
             self.gotName = other.gotName
-            
+
             # copy the scene graph elements of other
             # copy the scene graph elements of other
             if (overwrite):
             if (overwrite):
                 otherCopy = other.copyTo(NodePath())
                 otherCopy = other.copyTo(NodePath())
@@ -370,7 +370,7 @@ class Actor(DirectObject, NodePath):
             self.__copyPartBundles(other)
             self.__copyPartBundles(other)
             self.__copySubpartDict(other)
             self.__copySubpartDict(other)
             self.__subpartsComplete = other.__subpartsComplete
             self.__subpartsComplete = other.__subpartsComplete
-            
+
             # copy the anim dictionary from other
             # copy the anim dictionary from other
             self.__copyAnimControls(other)
             self.__copyAnimControls(other)
 
 
@@ -444,7 +444,7 @@ class Actor(DirectObject, NodePath):
         for lodName, partDict in self.__animControlDict.items():
         for lodName, partDict in self.__animControlDict.items():
             if self.mergeLODBundles:
             if self.mergeLODBundles:
                 lodName = self.__sortedLODNames[0]
                 lodName = self.__sortedLODNames[0]
-                
+
             partInfo = []
             partInfo = []
             for partName in partDict.keys():
             for partName in partDict.keys():
                 subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
                 subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
@@ -513,7 +513,7 @@ class Actor(DirectObject, NodePath):
         self.__subpartDict = {}
         self.__subpartDict = {}
         self.__sortedLODNames = []
         self.__sortedLODNames = []
         self.__animControlDict = {}
         self.__animControlDict = {}
-        
+
     def flush(self):
     def flush(self):
         """
         """
         Actor flush function
         Actor flush function
@@ -527,7 +527,7 @@ class Actor(DirectObject, NodePath):
         # remove all its children
         # remove all its children
         if self.__geomNode:
         if self.__geomNode:
             self.__geomNode.getChildren().detach()
             self.__geomNode.getChildren().detach()
-        
+
         self.__hasLOD = 0
         self.__hasLOD = 0
 
 
     # accessing
     # accessing
@@ -544,9 +544,9 @@ class Actor(DirectObject, NodePath):
     def getPartBundles(self, partName = None):
     def getPartBundles(self, partName = None):
         """ Returns a list of PartBundle objects for the entire Actor,
         """ Returns a list of PartBundle objects for the entire Actor,
         or for the indicated part only. """
         or for the indicated part only. """
-        
+
         bundles = []
         bundles = []
-        
+
         for lodName, partBundleDict in self.__partBundleDict.items():
         for lodName, partBundleDict in self.__partBundleDict.items():
             if partName == None:
             if partName == None:
                 for partDef in partBundleDict.values():
                 for partDef in partBundleDict.values():
@@ -635,7 +635,7 @@ class Actor(DirectObject, NodePath):
             self.__LODNode = self.__geomNode.attachNewNode(node)
             self.__LODNode = self.__geomNode.attachNewNode(node)
             self.__hasLOD = 1
             self.__hasLOD = 1
             self.switches = {}
             self.switches = {}
-        
+
 
 
     def useLOD(self, lodName):
     def useLOD(self, lodName):
         """
         """
@@ -646,7 +646,7 @@ class Actor(DirectObject, NodePath):
 ##         sortedKeys = self.switches.keys()
 ##         sortedKeys = self.switches.keys()
 ##         sortedKeys.sort()
 ##         sortedKeys.sort()
         child = self.__LODNode.find(str(lodName))
         child = self.__LODNode.find(str(lodName))
-        index = self.__LODNode.node().findChild(child.node())        
+        index = self.__LODNode.node().findChild(child.node())
         self.__LODNode.node().forceSwitch(index)
         self.__LODNode.node().forceSwitch(index)
 
 
     def printLOD(self):
     def printLOD(self):
@@ -705,7 +705,7 @@ class Actor(DirectObject, NodePath):
         safe method (but expensive) for retrieving the child index
         safe method (but expensive) for retrieving the child index
         """
         """
         return list(self.__LODNode.getChildren()).index(self.getLOD(lodName))
         return list(self.__LODNode.getChildren()).index(self.getLOD(lodName))
-        
+
     def getLOD(self, lodName):
     def getLOD(self, lodName):
         """getLOD(self, string)
         """getLOD(self, string)
         Get the named node under the LOD to which we parent all LOD
         Get the named node under the LOD to which we parent all LOD
@@ -754,7 +754,7 @@ class Actor(DirectObject, NodePath):
         away. """
         away. """
 
 
         self.__LODAnimation = (farDistance, nearDistance, delayFactor)
         self.__LODAnimation = (farDistance, nearDistance, delayFactor)
-        
+
         for lodData in self.__partBundleDict.values():
         for lodData in self.__partBundleDict.values():
             for partData in lodData.values():
             for partData in lodData.values():
                 char = partData.partBundleNP
                 char = partData.partBundleNP
@@ -781,7 +781,7 @@ class Actor(DirectObject, NodePath):
 
 
         If force is True, this will update every joint, even if we
         If force is True, this will update every joint, even if we
         don't believe it's necessary.
         don't believe it's necessary.
-        
+
         Returns True if any joint has changed as a result of this,
         Returns True if any joint has changed as a result of this,
         False otherwise. """
         False otherwise. """
 
 
@@ -907,7 +907,7 @@ class Actor(DirectObject, NodePath):
         """
         """
         if len(self.__animControlDict.items()) == 0:
         if len(self.__animControlDict.items()) == 0:
             return
             return
-        
+
         lodName, animControlDict = self.__animControlDict.items()[0]
         lodName, animControlDict = self.__animControlDict.items()[0]
         if partName == None:
         if partName == None:
             partName, animDict = animControlDict.items()[0]
             partName, animDict = animControlDict.items()[0]
@@ -1138,7 +1138,7 @@ class Actor(DirectObject, NodePath):
         """ Returns the list of all joints, from the named part or
         """ Returns the list of all joints, from the named part or
         from all parts, that match the indicated jointName.  The
         from all parts, that match the indicated jointName.  The
         jointName may include pattern characters like *. """
         jointName may include pattern characters like *. """
-        
+
         joints=[]
         joints=[]
         pattern = GlobPattern(jointName)
         pattern = GlobPattern(jointName)
 
 
@@ -1219,7 +1219,7 @@ class Actor(DirectObject, NodePath):
 
 
         for child in partNode.getChildren():
         for child in partNode.getChildren():
             self.__getPartJoints(joints, pattern, child, subset, isIncluded)
             self.__getPartJoints(joints, pattern, child, subset, isIncluded)
-    
+
     def getJointTransform(self, partName, jointName, lodName='lodRoot'):
     def getJointTransform(self, partName, jointName, lodName='lodRoot'):
         partBundleDict=self.__partBundleDict.get(lodName)
         partBundleDict=self.__partBundleDict.get(lodName)
         if not partBundleDict:
         if not partBundleDict:
@@ -1278,7 +1278,7 @@ class Actor(DirectObject, NodePath):
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         trueName = subpartDef.truePartName
         trueName = subpartDef.truePartName
         anyGood = False
         anyGood = False
-        for bundleDict in self.__partBundleDict.values():     
+        for bundleDict in self.__partBundleDict.values():
             bundle = bundleDict[trueName].getBundle()
             bundle = bundleDict[trueName].getBundle()
             if node == None:
             if node == None:
                 node = self.attachNewNode(ModelNode(jointName))
                 node = self.attachNewNode(ModelNode(jointName))
@@ -1308,20 +1308,20 @@ class Actor(DirectObject, NodePath):
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         trueName = subpartDef.truePartName
         trueName = subpartDef.truePartName
         anyGood = False
         anyGood = False
-        for bundleDict in self.__partBundleDict.values():     
+        for bundleDict in self.__partBundleDict.values():
             if bundleDict[trueName].getBundle().freezeJoint(jointName, transform):
             if bundleDict[trueName].getBundle().freezeJoint(jointName, transform):
                 anyGood = True
                 anyGood = True
 
 
         if not anyGood:
         if not anyGood:
             self.notify.warning("Cannot freeze joint %s" % (jointName))
             self.notify.warning("Cannot freeze joint %s" % (jointName))
-                
+
     def releaseJoint(self, partName, jointName):
     def releaseJoint(self, partName, jointName):
         """Undoes a previous call to controlJoint() or freezeJoint()
         """Undoes a previous call to controlJoint() or freezeJoint()
         and restores the named joint to its normal animation. """
         and restores the named joint to its normal animation. """
 
 
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         trueName = subpartDef.truePartName
         trueName = subpartDef.truePartName
-        for bundleDict in self.__partBundleDict.values():     
+        for bundleDict in self.__partBundleDict.values():
             bundleDict[trueName].getBundle().releaseJoint(jointName)
             bundleDict[trueName].getBundle().releaseJoint(jointName)
 
 
     def instance(self, path, partName, jointName, lodName="lodRoot"):
     def instance(self, path, partName, jointName, lodName="lodRoot"):
@@ -1477,8 +1477,8 @@ class Actor(DirectObject, NodePath):
                         for geomNum in xrange(numGeoms):
                         for geomNum in xrange(numGeoms):
                             thisGeom = thisGeomNode.node().getGeom(geomNum)
                             thisGeom = thisGeomNode.node().getGeom(geomNum)
                             thisGeom.markBoundsStale()
                             thisGeom.markBoundsStale()
-                        thisGeomNode.node().markInternalBoundsStale()            
-        
+                        thisGeomNode.node().markInternalBoundsStale()
+
     def fixBounds_old(self, part=None):
     def fixBounds_old(self, part=None):
         """fixBounds(self, nodePath=None)
         """fixBounds(self, nodePath=None)
         Force recomputation of bounding spheres for all geoms
         Force recomputation of bounding spheres for all geoms
@@ -1569,7 +1569,7 @@ class Actor(DirectObject, NodePath):
         is given then try to loop on all parts. NOTE: loops on
         is given then try to loop on all parts. NOTE: loops on
         all LOD's
         all LOD's
         """
         """
-    
+
         if fromFrame == None:
         if fromFrame == None:
             for control in self.getAnimControls(animName, partName):
             for control in self.getAnimControls(animName, partName):
                 control.loop(restart)
                 control.loop(restart)
@@ -1614,7 +1614,7 @@ class Actor(DirectObject, NodePath):
         The animBlend and frameBlend parameters are boolean flags.
         The animBlend and frameBlend parameters are boolean flags.
         You may set either or both to True or False.  If you do not
         You may set either or both to True or False.  If you do not
         specify them, they do not change from the previous value.
         specify them, they do not change from the previous value.
-        
+
         When animBlend is True, multiple different animations may
         When animBlend is True, multiple different animations may
         simultaneously be playing on the Actor.  This means you may
         simultaneously be playing on the Actor.  This means you may
         call play(), loop(), or pose() on multiple animations and have
         call play(), loop(), or pose() on multiple animations and have
@@ -1683,7 +1683,7 @@ class Actor(DirectObject, NodePath):
         the overall pose.  This controls blending of multiple
         the overall pose.  This controls blending of multiple
         animations; it only makes sense to call this after a previous
         animations; it only makes sense to call this after a previous
         call to setBlend(animBlend = True).
         call to setBlend(animBlend = True).
-        """        
+        """
         for control in self.getAnimControls(animName, partName, lodName):
         for control in self.getAnimControls(animName, partName, lodName):
             control.getPart().setControlEffect(control, effect)
             control.getPart().setControlEffect(control, effect)
 
 
@@ -1712,7 +1712,7 @@ class Actor(DirectObject, NodePath):
         a given anim and part. If none specified, try the first part and lod.
         a given anim and part. If none specified, try the first part and lod.
         Return the animControl if present, or None otherwise.
         Return the animControl if present, or None otherwise.
         """
         """
-    
+
         if not partName:
         if not partName:
             partName = 'modelRoot'
             partName = 'modelRoot'
 
 
@@ -1775,7 +1775,7 @@ class Actor(DirectObject, NodePath):
             # is specified, it really means to play the animation on
             # is specified, it really means to play the animation on
             # all subparts, not on the overall Actor.
             # all subparts, not on the overall Actor.
             partName = self.__subpartDict.keys()
             partName = self.__subpartDict.keys()
-            
+
         controls = []
         controls = []
         # build list of lodNames and corresponding animControlDicts
         # build list of lodNames and corresponding animControlDicts
         # requested.
         # requested.
@@ -1808,7 +1808,7 @@ class Actor(DirectObject, NodePath):
                     partNameList = partName
                     partNameList = partName
 
 
                 animDictItems = []
                 animDictItems = []
-                
+
                 for pName in partNameList:
                 for pName in partNameList:
                     animDict = partDict.get(pName)
                     animDict = partDict.get(pName)
                     if animDict == None:
                     if animDict == None:
@@ -1870,7 +1870,7 @@ class Actor(DirectObject, NodePath):
                                 # Force the animation to load if it's
                                 # Force the animation to load if it's
                                 # not already loaded.
                                 # not already loaded.
                                 animControl.waitPending()
                                 animControl.waitPending()
-                                
+
                             if animControl:
                             if animControl:
                                 controls.append(animControl)
                                 controls.append(animControl)
 
 
@@ -1900,7 +1900,7 @@ class Actor(DirectObject, NodePath):
                 # If copy = 0, then we should always hit the disk.
                 # If copy = 0, then we should always hit the disk.
                 loaderOptions = LoaderOptions(loaderOptions)
                 loaderOptions = LoaderOptions(loaderOptions)
                 loaderOptions.setFlags(loaderOptions.getFlags() & ~LoaderOptions.LFNoRamCache)
                 loaderOptions.setFlags(loaderOptions.getFlags() & ~LoaderOptions.LFNoRamCache)
-            
+
             # Pass loaderOptions to specify that we want to
             # Pass loaderOptions to specify that we want to
             # get the skeleton model.  This only matters to model
             # get the skeleton model.  This only matters to model
             # files (like .mb) for which we can choose to extract
             # files (like .mb) for which we can choose to extract
@@ -1914,7 +1914,7 @@ class Actor(DirectObject, NodePath):
             bundleNP = model
             bundleNP = model
         else:
         else:
             bundleNP = model.find("**/+Character")
             bundleNP = model.find("**/+Character")
-            
+
         if (bundleNP.isEmpty()):
         if (bundleNP.isEmpty()):
             Actor.notify.warning("%s is not a character!" % (modelPath))
             Actor.notify.warning("%s is not a character!" % (modelPath))
             model.reparentTo(self.__geomNode)
             model.reparentTo(self.__geomNode)
@@ -2048,7 +2048,7 @@ class Actor(DirectObject, NodePath):
                     joints = self.getOverlappingJoints(partName, otherPartName)
                     joints = self.getOverlappingJoints(partName, otherPartName)
                     if joints:
                     if joints:
                         raise StandardError, 'Overlapping joints: %s and %s' % (partName, otherPartName)
                         raise StandardError, 'Overlapping joints: %s and %s' % (partName, otherPartName)
-        
+
     def setSubpartsComplete(self, flag):
     def setSubpartsComplete(self, flag):
 
 
         """Sets the subpartsComplete flag.  This affects the behavior
         """Sets the subpartsComplete flag.  This affects the behavior
@@ -2070,7 +2070,7 @@ class Actor(DirectObject, NodePath):
         It makes sense to set this True when the union of all of your
         It makes sense to set this True when the union of all of your
         subparts completely defines the entire Actor.
         subparts completely defines the entire Actor.
         """
         """
-        
+
         self.__subpartsComplete = flag
         self.__subpartsComplete = flag
 
 
         if __dev__ and self.__subpartsComplete and self.validateSubparts.getValue():
         if __dev__ and self.__subpartsComplete and self.validateSubparts.getValue():
@@ -2078,11 +2078,11 @@ class Actor(DirectObject, NodePath):
             # specified all of them.
             # specified all of them.
             if self.__subpartDict:
             if self.__subpartDict:
                 self.verifySubpartsComplete()
                 self.verifySubpartsComplete()
-        
+
 
 
     def getSubpartsComplete(self):
     def getSubpartsComplete(self):
         """See setSubpartsComplete()."""
         """See setSubpartsComplete()."""
-        
+
         return self.__subpartsComplete
         return self.__subpartsComplete
 
 
     def verifySubpartsComplete(self, partName = None, lodName = None):
     def verifySubpartsComplete(self, partName = None, lodName = None):
@@ -2128,7 +2128,7 @@ class Actor(DirectObject, NodePath):
                 lodNames[i] = str(lodNames[i])
                 lodNames[i] = str(lodNames[i])
         else:
         else:
             lodNames = [lodName]
             lodNames = [lodName]
-            
+
         assert Actor.notify.debug("in loadAnims: %s, part: %s, lod: %s" %
         assert Actor.notify.debug("in loadAnims: %s, part: %s, lod: %s" %
                                   (anims, partName, lodNames[0]))
                                   (anims, partName, lodNames[0]))
 
 
@@ -2172,7 +2172,7 @@ class Actor(DirectObject, NodePath):
             lodNames = ['common']
             lodNames = ['common']
         else:
         else:
             lodNames = self.__partBundleDict.keys()
             lodNames = self.__partBundleDict.keys()
-        
+
         for lod in lodNames:
         for lod in lodNames:
             for part in partNames:
             for part in partNames:
                 self.__animControlDict.setdefault(lod,{})
                 self.__animControlDict.setdefault(lod,{})
@@ -2183,9 +2183,9 @@ class Actor(DirectObject, NodePath):
         #    for lod in self.__partBundleDict.keys():
         #    for lod in self.__partBundleDict.keys():
         #        # store the file path only; we will bind it (and produce
         #        # store the file path only; we will bind it (and produce
         #        # an AnimControl) when it is played
         #        # an AnimControl) when it is played
-        #        
+        #
         #        self.__animControlDict[lod][partName][animName] = Actor.AnimDef(filename)
         #        self.__animControlDict[lod][partName][animName] = Actor.AnimDef(filename)
-                
+
     def loadAnimsOnAllLODs(self, anims,partName="modelRoot"):
     def loadAnimsOnAllLODs(self, anims,partName="modelRoot"):
         """loadAnims(self, string:string{}, string='modelRoot',
         """loadAnims(self, string:string{}, string='modelRoot',
         string='lodRoot')
         string='lodRoot')
@@ -2198,13 +2198,13 @@ class Actor(DirectObject, NodePath):
             lodNames = ['common']
             lodNames = ['common']
         else:
         else:
             lodNames = self.__partBundleDict.keys()
             lodNames = self.__partBundleDict.keys()
-        
+
         for animName, filename in anims.items():
         for animName, filename in anims.items():
             # make sure this lod is in anim control dict
             # make sure this lod is in anim control dict
             for lod in lodNames:
             for lod in lodNames:
                 # store the file path only; we will bind it (and produce
                 # store the file path only; we will bind it (and produce
                 # an AnimControl) when it is played
                 # an AnimControl) when it is played
-                
+
                 self.__animControlDict[lod][partName][animName]= Actor.AnimDef(filename)
                 self.__animControlDict[lod][partName][animName]= Actor.AnimDef(filename)
 
 
     def postFlatten(self):
     def postFlatten(self):
@@ -2213,7 +2213,7 @@ class Actor(DirectObject, NodePath):
         especially necessary when mergeLODBundles is true, since this
         especially necessary when mergeLODBundles is true, since this
         kind of actor may be broken after a flatten operation; this
         kind of actor may be broken after a flatten operation; this
         method should restore proper Actor functionality. """
         method should restore proper Actor functionality. """
-        
+
         if self.mergeLODBundles:
         if self.mergeLODBundles:
             # Re-merge all bundles, and restore the common bundle map.
             # Re-merge all bundles, and restore the common bundle map.
             self.__commonBundleHandles = {}
             self.__commonBundleHandles = {}
@@ -2226,11 +2226,11 @@ class Actor(DirectObject, NodePath):
                         partDef.partBundleHandle = loadedBundleHandle
                         partDef.partBundleHandle = loadedBundleHandle
                     else:
                     else:
                         self.__commonBundleHandles[partName] = partDef.partBundleHandle
                         self.__commonBundleHandles[partName] = partDef.partBundleHandle
-                        
+
         # Since we may have merged together some bundles, all of
         # Since we may have merged together some bundles, all of
         # our anims are now suspect.  Force them to reload.
         # our anims are now suspect.  Force them to reload.
         self.unloadAnims()
         self.unloadAnims()
-        
+
     def unloadAnims(self, anims=None, partName=None, lodName=None):
     def unloadAnims(self, anims=None, partName=None, lodName=None):
         """unloadAnims(self, string:string{}, string='modelRoot',
         """unloadAnims(self, string:string{}, string='modelRoot',
         string='lodRoot')
         string='lodRoot')
@@ -2401,7 +2401,7 @@ class Actor(DirectObject, NodePath):
             for partName, partDef in other.__partBundleDict[lodName].items():
             for partName, partDef in other.__partBundleDict[lodName].items():
                 # We can really only copy from a non-flattened avatar.
                 # We can really only copy from a non-flattened avatar.
                 assert partDef.partBundleNP.node().getNumBundles() == 1
                 assert partDef.partBundleNP.node().getNumBundles() == 1
-                
+
                 # find the part in our tree
                 # find the part in our tree
                 bundleNP = partLod.find("**/%s%s"%(Actor.partPrefix,partName))
                 bundleNP = partLod.find("**/%s%s"%(Actor.partPrefix,partName))
                 if (bundleNP != None):
                 if (bundleNP != None):
@@ -2498,7 +2498,7 @@ class Actor(DirectObject, NodePath):
                 result.append((lodName, animList))
                 result.append((lodName, animList))
 
 
         return result
         return result
-    
+
     def printAnimBlends(self, animName=None, partName=None, lodName=None):
     def printAnimBlends(self, animName=None, partName=None, lodName=None):
         for lodName, animList in self.getAnimBlends(animName, partName, lodName):
         for lodName, animList in self.getAnimBlends(animName, partName, lodName):
             print 'LOD %s:' % (lodName)
             print 'LOD %s:' % (lodName)

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

@@ -11,11 +11,11 @@ class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
         try:
         try:
             self.DistributedActor_initialized
             self.DistributedActor_initialized
         except:
         except:
-            self.DistributedActor_initialized = 1   
-            Actor.Actor.__init__(self)     
+            self.DistributedActor_initialized = 1
+            Actor.Actor.__init__(self)
             DistributedNode.DistributedNode.__init__(self, cr)
             DistributedNode.DistributedNode.__init__(self, cr)
             # Since actors are probably fairly heavyweight, we'd
             # Since actors are probably fairly heavyweight, we'd
-            # rather cache them than delete them if possible.       
+            # rather cache them than delete them if possible.
             self.setCacheable(1)
             self.setCacheable(1)
 
 
     def disable(self):
     def disable(self):
@@ -28,10 +28,10 @@ class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
         try:
         try:
             self.DistributedActor_deleted
             self.DistributedActor_deleted
         except:
         except:
-            self.DistributedActor_deleted = 1       
+            self.DistributedActor_deleted = 1
             DistributedNode.DistributedNode.delete(self)
             DistributedNode.DistributedNode.delete(self)
             Actor.Actor.delete(self)
             Actor.Actor.delete(self)
 
 
 
 
-    def loop(self, animName, restart=1, partName=None, fromFrame=None, toFrame=None):       
+    def loop(self, animName, restart=1, partName=None, fromFrame=None, toFrame=None):
         return Actor.Actor.loop(self, animName, restart, partName, fromFrame, toFrame)
         return Actor.Actor.loop(self, animName, restart, partName, fromFrame, toFrame)

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

@@ -147,7 +147,7 @@ class ClusterClient(DirectObject.DirectObject):
 
 
         if (serverList == None):
         if (serverList == None):
             serverList = range(len(self.serverList))
             serverList = range(len(self.serverList))
-        
+
         for server in serverList:
         for server in serverList:
             self.serverList[server].sendNamedMovementDone()
             self.serverList[server].sendNamedMovementDone()
 
 
@@ -161,7 +161,7 @@ class ClusterClient(DirectObject.DirectObject):
                                                key])
                                                key])
 
 
         self.sortedControlMappings.sort()
         self.sortedControlMappings.sort()
-        
+
     def moveObject(self, nodePath, object, serverList, offset, hasColor = True):
     def moveObject(self, nodePath, object, serverList, offset, hasColor = True):
         self.notify.debug('moving object '+object)
         self.notify.debug('moving object '+object)
         xyz = nodePath.getPos(render) + offset
         xyz = nodePath.getPos(render) + offset
@@ -222,7 +222,7 @@ class ClusterClient(DirectObject.DirectObject):
                 serverList = range(len(self.serverList))
                 serverList = range(len(self.serverList))
             if (offset == None):
             if (offset == None):
                 offset = Vec3(0,0,0)
                 offset = Vec3(0,0,0)
-                
+
             self.controlMappings[objectName] = [controlledName,serverList]
             self.controlMappings[objectName] = [controlledName,serverList]
             self.controlOffsets[objectName]  = offset
             self.controlOffsets[objectName]  = offset
             self.controlPriorities[objectName] = priority
             self.controlPriorities[objectName] = priority
@@ -247,7 +247,7 @@ class ClusterClient(DirectObject.DirectObject):
 
 
             if (serverList == None):
             if (serverList == None):
                 self.controlMappings.pop(name)
                 self.controlMappings.pop(name)
-                self.controlPriorities.pop(name)                
+                self.controlPriorities.pop(name)
             else:
             else:
                 list = self.controlMappings[key][1]
                 list = self.controlMappings[key][1]
                 newList = []
                 newList = []
@@ -260,7 +260,7 @@ class ClusterClient(DirectObject.DirectObject):
                     self.controlPriorities.pop(name)
                     self.controlPriorities.pop(name)
         self.redoSortedPriorities()
         self.redoSortedPriorities()
 
 
-        
+
     def getNodePathFindCmd(self, nodePath):
     def getNodePathFindCmd(self, nodePath):
         import string
         import string
         pathString = repr(nodePath)
         pathString = repr(nodePath)
@@ -288,14 +288,14 @@ class ClusterClient(DirectObject.DirectObject):
         newTag["selectFunction"] = selectFunction
         newTag["selectFunction"] = selectFunction
         newTag["selectArgs"]     = selectArgs
         newTag["selectArgs"]     = selectArgs
         newTag["deselectFunction"] = deselectFunction
         newTag["deselectFunction"] = deselectFunction
-        newTag["deselectArgs"]     = deselectArgs        
+        newTag["deselectArgs"]     = deselectArgs
         self.taggedObjects[object] = newTag
         self.taggedObjects[object] = newTag
 
 
 
 
     def removeObjectTag(self,object):
     def removeObjectTag(self,object):
 
 
         self.taggedObjects.pop(object)
         self.taggedObjects.pop(object)
-    
+
 
 
     def selectNodePath(self, nodePath):
     def selectNodePath(self, nodePath):
         name = self.getNodePathName(nodePath)
         name = self.getNodePathName(nodePath)
@@ -308,14 +308,14 @@ class ClusterClient(DirectObject.DirectObject):
                 function(*args)
                 function(*args)
         else:
         else:
             self(self.getNodePathFindCmd(nodePath) + '.select()', 0)
             self(self.getNodePathFindCmd(nodePath) + '.select()', 0)
-        
+
 
 
     def deselectNodePath(self, nodePath):
     def deselectNodePath(self, nodePath):
         name = self.getNodePathName(nodePath)
         name = self.getNodePathName(nodePath)
         if name in self.taggedObjects:
         if name in self.taggedObjects:
             tag = self.taggedObjects[name]
             tag = self.taggedObjects[name]
             function = tag["deselectFunction"]
             function = tag["deselectFunction"]
-            args     = tag["deselectArgs"]        
+            args     = tag["deselectArgs"]
             if (function != None):
             if (function != None):
                 function(*args)
                 function(*args)
             self.startMoveSelectedTask()
             self.startMoveSelectedTask()
@@ -372,12 +372,12 @@ class ClusterClient(DirectObject.DirectObject):
 
 
         # clear the queue
         # clear the queue
         self.serverQueues[server] = []
         self.serverQueues[server] = []
-        
+
 
 
     def handleNamedMovement(self, data):
     def handleNamedMovement(self, data):
         """ Update cameraJig position to reflect latest position """
         """ Update cameraJig position to reflect latest position """
-    
-        (name,x, y, z, h, p, r, sx, sy, sz,red,g,b,a, hidden) = data 
+
+        (name,x, y, z, h, p, r, sx, sy, sz,red,g,b,a, hidden) = data
         #print "name"
         #print "name"
         #if (name == "camNode"):
         #if (name == "camNode"):
         #    print x,y,z,h,p,r, sx, sy, sz,red,g,b,a, hidden
         #    print x,y,z,h,p,r, sx, sy, sz,red,g,b,a, hidden

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

@@ -166,7 +166,7 @@ class ClusterMsgHandler:
         self.packetNumber = self.packetNumber + 1
         self.packetNumber = self.packetNumber + 1
         datagram.addUint8(CLUSTER_NAMED_MOVEMENT_DONE)
         datagram.addUint8(CLUSTER_NAMED_MOVEMENT_DONE)
         return datagram
         return datagram
-            
+
 
 
     def makeNamedObjectMovementDatagram(self, xyz, hpr, scale, color, hidden, name):
     def makeNamedObjectMovementDatagram(self, xyz, hpr, scale, color, hidden, name):
         datagram = PyDatagram()
         datagram = PyDatagram()
@@ -186,9 +186,9 @@ class ClusterMsgHandler:
         datagram.addFloat32(color[0])
         datagram.addFloat32(color[0])
         datagram.addFloat32(color[1])
         datagram.addFloat32(color[1])
         datagram.addFloat32(color[2])
         datagram.addFloat32(color[2])
-        datagram.addFloat32(color[3])        
+        datagram.addFloat32(color[3])
         datagram.addBool(hidden)
         datagram.addBool(hidden)
-        return datagram    
+        return datagram
 
 
     def parseCamMovementDatagram(self, dgi):
     def parseCamMovementDatagram(self, dgi):
         x=dgi.getFloat32()
         x=dgi.getFloat32()
@@ -215,7 +215,7 @@ class ClusterMsgHandler:
         red = dgi.getFloat32()
         red = dgi.getFloat32()
         g = dgi.getFloat32()
         g = dgi.getFloat32()
         b = dgi.getFloat32()
         b = dgi.getFloat32()
-        a = dgi.getFloat32()        
+        a = dgi.getFloat32()
         hidden = dgi.getBool()
         hidden = dgi.getBool()
         return (name,x, y, z, h, p, r, sx, sy, sz, red, g, b, a, hidden)
         return (name,x, y, z, h, p, r, sx, sy, sz, red, g, b, a, hidden)
 
 

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

@@ -138,7 +138,7 @@ class ClusterServer(DirectObject.DirectObject):
     def setControlMappingOffset(self,objectName,offset):
     def setControlMappingOffset(self,objectName,offset):
         if (objectName in self.controlMappings):
         if (objectName in self.controlMappings):
             self.controlOffsets[objectName] = offset
             self.controlOffsets[objectName] = offset
-    
+
 
 
     def removeControlMapping(self,name):
     def removeControlMapping(self,name):
         if (name in self.controlMappings):
         if (name in self.controlMappings):
@@ -146,7 +146,7 @@ class ClusterServer(DirectObject.DirectObject):
             self.controlPriorities.pop(name)
             self.controlPriorities.pop(name)
         self.redoSortedPriorities()
         self.redoSortedPriorities()
 
 
-            
+
     def startControlObjectTask(self):
     def startControlObjectTask(self):
         self.notify.debug("moving control objects")
         self.notify.debug("moving control objects")
         taskMgr.add(self.controlObjectTask,"controlObjectTask",50)
         taskMgr.add(self.controlObjectTask,"controlObjectTask",50)
@@ -155,7 +155,7 @@ class ClusterServer(DirectObject.DirectObject):
         #print "running control object task"
         #print "running control object task"
         for pair in self.sortedControlPriorities:
         for pair in self.sortedControlPriorities:
             object = pair[1]
             object = pair[1]
-            name   = self.controlMappings[object] 
+            name   = self.controlMappings[object]
             if (object in self.objectMappings):
             if (object in self.objectMappings):
                 self.moveObject(self.objectMappings[object],name,self.controlOffsets[object],
                 self.moveObject(self.objectMappings[object],name,self.controlOffsets[object],
                                 self.objectHasColor[object])
                                 self.objectHasColor[object])
@@ -169,7 +169,7 @@ class ClusterServer(DirectObject.DirectObject):
         self.notify.debug("named movement done")
         self.notify.debug("named movement done")
         datagram = self.msgHandler.makeNamedMovementDone()
         datagram = self.msgHandler.makeNamedMovementDone()
         self.cw.send(datagram,self.lastConnection)
         self.cw.send(datagram,self.lastConnection)
-    
+
     def moveObject(self, nodePath, object, offset, hasColor):
     def moveObject(self, nodePath, object, offset, hasColor):
         self.notify.debug('moving object '+object)
         self.notify.debug('moving object '+object)
         #print "moving object",object
         #print "moving object",object
@@ -322,7 +322,7 @@ class ClusterServer(DirectObject.DirectObject):
         """ Update cameraJig position to reflect latest position """
         """ Update cameraJig position to reflect latest position """
         (x, y, z, h, p, r) = self.msgHandler.parseCamMovementDatagram(dgi)
         (x, y, z, h, p, r) = self.msgHandler.parseCamMovementDatagram(dgi)
         self.cameraJig.setPosHpr(render, x, y, z, h, p, r)
         self.cameraJig.setPosHpr(render, x, y, z, h, p, r)
-        self.fPosReceived = 1        
+        self.fPosReceived = 1
 
 
     def handleSelectedMovement(self, dgi):
     def handleSelectedMovement(self, dgi):
         """ Update cameraJig position to reflect latest position """
         """ Update cameraJig position to reflect latest position """

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

@@ -36,12 +36,12 @@ class BattleWalker(GravityWalker.GravityWalker):
         slideLeft = inputState.isSet("slideLeft")
         slideLeft = inputState.isSet("slideLeft")
         slideRight = inputState.isSet("slideRight")
         slideRight = inputState.isSet("slideRight")
         jump = inputState.isSet("jump")
         jump = inputState.isSet("jump")
-        
+
         # Check for Auto-Run
         # Check for Auto-Run
         if base.localAvatar.getAutoRun():
         if base.localAvatar.getAutoRun():
             forward = 1
             forward = 1
             reverse = 0
             reverse = 0
-        
+
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.speed=(forward and self.avatarControlForwardSpeed or
         self.speed=(forward and self.avatarControlForwardSpeed or
                     reverse and -self.avatarControlReverseSpeed)
                     reverse and -self.avatarControlReverseSpeed)
@@ -58,7 +58,7 @@ class BattleWalker(GravityWalker.GravityWalker):
             self.speed*=base.debugRunningMultiplier
             self.speed*=base.debugRunningMultiplier
             self.slideSpeed*=base.debugRunningMultiplier
             self.slideSpeed*=base.debugRunningMultiplier
             self.rotationSpeed*=1.25
             self.rotationSpeed*=1.25
-            
+
         if self.needToDeltaPos:
         if self.needToDeltaPos:
             self.setPriorParentVector()
             self.setPriorParentVector()
             self.needToDeltaPos = 0
             self.needToDeltaPos = 0

+ 20 - 20
direct/src/controls/ControlManager.py

@@ -37,9 +37,9 @@ class ControlManager:
             self.enable()
             self.enable()
         #self.monitorTask = taskMgr.add(self.monitor, "ControlManager-%s"%(id(self)), priority=-1)
         #self.monitorTask = taskMgr.add(self.monitor, "ControlManager-%s"%(id(self)), priority=-1)
         self.forceAvJumpToken = None
         self.forceAvJumpToken = None
-        
-        
-        
+
+
+
         if self.passMessagesThrough: # for not breaking toontown
         if self.passMessagesThrough: # for not breaking toontown
             ist=self.inputStateTokens
             ist=self.inputStateTokens
             ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
@@ -50,7 +50,7 @@ class ControlManager:
 
 
     def __str__(self):
     def __str__(self):
         return 'ControlManager: using \'%s\'' % self.currentControlsName
         return 'ControlManager: using \'%s\'' % self.currentControlsName
-    
+
     def add(self, controls, name="basic"):
     def add(self, controls, name="basic"):
         """
         """
         controls is an avatar control system.
         controls is an avatar control system.
@@ -75,7 +75,7 @@ class ControlManager:
 
 
     def get(self, name):
     def get(self, name):
         return self.controls.get(name)
         return self.controls.get(name)
-        
+
     def remove(self, name):
     def remove(self, name):
         """
         """
         name is any key that was used to refer to the
         name is any key that was used to refer to the
@@ -166,7 +166,7 @@ class ControlManager:
         if self.currentControls:
         if self.currentControls:
             return self.currentControls.getIsAirborne()
             return self.currentControls.getIsAirborne()
         return False
         return False
-    
+
     def setTag(self, key, value):
     def setTag(self, key, value):
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
         for controls in self.controls.values():
         for controls in self.controls.values():
@@ -181,7 +181,7 @@ class ControlManager:
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
         if self.currentControls:
         if self.currentControls:
             self.currentControls.setCollisionsActive(1)
             self.currentControls.setCollisionsActive(1)
-            
+
     def collisionsOff(self):
     def collisionsOff(self):
         assert self.notify.debugCall(id(self))
         assert self.notify.debugCall(id(self))
         if self.currentControls:
         if self.currentControls:
@@ -198,25 +198,25 @@ class ControlManager:
         if self.isEnabled:
         if self.isEnabled:
             assert self.notify.debug('already isEnabled')
             assert self.notify.debug('already isEnabled')
             return
             return
-        
+
         self.isEnabled = 1
         self.isEnabled = 1
 
 
         # keep track of what we do on the inputState so we can undo it later on
         # keep track of what we do on the inputState so we can undo it later on
         #self.inputStateTokens = []
         #self.inputStateTokens = []
         ist = self.inputStateTokens
         ist = self.inputStateTokens
         ist.append(inputState.watch("run", 'runningEvent', "running-on", "running-off"))
         ist.append(inputState.watch("run", 'runningEvent', "running-on", "running-off"))
-        
+
         ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
         ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
         ist.append(inputState.watch("forward", "force-forward", "force-forward-stop"))
         ist.append(inputState.watch("forward", "force-forward", "force-forward-stop"))
-        
+
         ist.append(inputState.watchWithModifiers("reverse", "arrow_down", inputSource=inputState.ArrowKeys))
         ist.append(inputState.watchWithModifiers("reverse", "arrow_down", inputSource=inputState.ArrowKeys))
         ist.append(inputState.watchWithModifiers("reverse", "mouse4", inputSource=inputState.Mouse))
         ist.append(inputState.watchWithModifiers("reverse", "mouse4", inputSource=inputState.Mouse))
-        
+
         if self.wantWASD:
         if self.wantWASD:
             ist.append(inputState.watchWithModifiers("turnLeft", "arrow_left", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("turnLeft", "arrow_left", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watch("turnLeft", "mouse-look_left", "mouse-look_left-done"))
             ist.append(inputState.watch("turnLeft", "mouse-look_left", "mouse-look_left-done"))
             ist.append(inputState.watch("turnLeft", "force-turnLeft", "force-turnLeft-stop"))
             ist.append(inputState.watch("turnLeft", "force-turnLeft", "force-turnLeft-stop"))
-            
+
             ist.append(inputState.watchWithModifiers("turnRight", "arrow_right", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("turnRight", "arrow_right", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watch("turnRight", "mouse-look_right", "mouse-look_right-done"))
             ist.append(inputState.watch("turnRight", "mouse-look_right", "mouse-look_right-done"))
             ist.append(inputState.watch("turnRight", "force-turnRight", "force-turnRight-stop"))
             ist.append(inputState.watch("turnRight", "force-turnRight", "force-turnRight-stop"))
@@ -232,7 +232,7 @@ class ControlManager:
             ist.append(inputState.watchWithModifiers("turnLeft", "arrow_left", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("turnLeft", "arrow_left", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watch("turnLeft", "mouse-look_left", "mouse-look_left-done"))
             ist.append(inputState.watch("turnLeft", "mouse-look_left", "mouse-look_left-done"))
             ist.append(inputState.watch("turnLeft", "force-turnLeft", "force-turnLeft-stop"))
             ist.append(inputState.watch("turnLeft", "force-turnLeft", "force-turnLeft-stop"))
-            
+
             ist.append(inputState.watchWithModifiers("turnRight", "arrow_right", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("turnRight", "arrow_right", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watch("turnRight", "mouse-look_right", "mouse-look_right-done"))
             ist.append(inputState.watch("turnRight", "mouse-look_right", "mouse-look_right-done"))
             ist.append(inputState.watch("turnRight", "force-turnRight", "force-turnRight-stop"))
             ist.append(inputState.watch("turnRight", "force-turnRight", "force-turnRight-stop"))
@@ -242,7 +242,7 @@ class ControlManager:
             ist.append(inputState.watchWithModifiers("jump", "space"))
             ist.append(inputState.watchWithModifiers("jump", "space"))
         else:
         else:
             ist.append(inputState.watch("jump", "control", "control-up"))
             ist.append(inputState.watch("jump", "control", "control-up"))
-        
+
         if self.currentControls:
         if self.currentControls:
             self.currentControls.enableAvatarControls()
             self.currentControls.enableAvatarControls()
 
 
@@ -260,7 +260,7 @@ class ControlManager:
 
 
         if self.currentControls:
         if self.currentControls:
             self.currentControls.disableAvatarControls()
             self.currentControls.disableAvatarControls()
-            
+
         if self.passMessagesThrough: # for not breaking toontown
         if self.passMessagesThrough: # for not breaking toontown
             ist=self.inputStateTokens
             ist=self.inputStateTokens
             ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
             ist.append(inputState.watchWithModifiers("forward", "arrow_up", inputSource=inputState.ArrowKeys))
@@ -274,10 +274,10 @@ class ControlManager:
             self.currentControls.setCollisionsActive(0)
             self.currentControls.setCollisionsActive(0)
             self.currentControls.setAvatar(None)
             self.currentControls.setAvatar(None)
         self.currentControls = None
         self.currentControls = None
-        
+
     def disableAvatarJump(self):
     def disableAvatarJump(self):
         """
         """
-        prevent 
+        prevent
         """
         """
         assert self.forceAvJumpToken is None
         assert self.forceAvJumpToken is None
         self.forceAvJumpToken=inputState.force(
         self.forceAvJumpToken=inputState.force(
@@ -310,7 +310,7 @@ class ControlManager:
 
 
         if not self.isEnabled:
         if not self.isEnabled:
             return
             return
-        
+
         turnLeftWASDSet = inputState.isSet("turnLeft", inputSource=inputState.WASD)
         turnLeftWASDSet = inputState.isSet("turnLeft", inputSource=inputState.WASD)
         turnRightWASDSet = inputState.isSet("turnRight", inputSource=inputState.WASD)
         turnRightWASDSet = inputState.isSet("turnRight", inputSource=inputState.WASD)
         slideLeftWASDSet = inputState.isSet("slideLeft", inputSource=inputState.WASD)
         slideLeftWASDSet = inputState.isSet("slideLeft", inputSource=inputState.WASD)
@@ -339,7 +339,7 @@ class ControlManager:
 
 
             inputState.set("slideLeft", turnLeftWASDSet, inputSource=inputState.WASD)
             inputState.set("slideLeft", turnLeftWASDSet, inputSource=inputState.WASD)
             inputState.set("slideRight", turnRightWASDSet, inputSource=inputState.WASD)
             inputState.set("slideRight", turnRightWASDSet, inputSource=inputState.WASD)
-                
+
             inputState.set("turnLeft", False, inputSource=inputState.WASD)
             inputState.set("turnLeft", False, inputSource=inputState.WASD)
             inputState.set("turnRight", False, inputSource=inputState.WASD)
             inputState.set("turnRight", False, inputSource=inputState.WASD)
-                
+

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

@@ -116,7 +116,7 @@ class DevWalker(DirectObject.DirectObject):
         if base.localAvatar.getAutoRun():
         if base.localAvatar.getAutoRun():
             forward = 1
             forward = 1
             reverse = 0
             reverse = 0
-        
+
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.speed=(
         self.speed=(
                 (forward and self.avatarControlForwardSpeed or
                 (forward and self.avatarControlForwardSpeed or
@@ -183,7 +183,7 @@ class DevWalker(DirectObject.DirectObject):
 
 
     def flushEventHandlers(self):
     def flushEventHandlers(self):
         pass
         pass
-    
+
     if __debug__:
     if __debug__:
         def debugPrint(self, message):
         def debugPrint(self, message):
             """for debugging"""
             """for debugging"""

+ 5 - 5
direct/src/controls/NonPhysicsWalker.py

@@ -70,7 +70,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
 
 
         if self.cRayNodePath and not self.cRayNodePath.isEmpty():
         if self.cRayNodePath and not self.cRayNodePath.isEmpty():
             self.cRayNodePath.node().setFromCollideMask(self.cRayBitMask)
             self.cRayNodePath.node().setFromCollideMask(self.cRayBitMask)
-            
+
     def initializeCollisions(self, collisionTraverser, avatarNodePath,
     def initializeCollisions(self, collisionTraverser, avatarNodePath,
             avatarRadius = 1.4, floorOffset = 1.0, reach = 1.0):
             avatarRadius = 1.4, floorOffset = 1.0, reach = 1.0):
         """
         """
@@ -201,12 +201,12 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         turnRight = inputState.isSet("turnRight")
         turnRight = inputState.isSet("turnRight")
         slide = inputState.isSet(self.slideName) or 0
         slide = inputState.isSet(self.slideName) or 0
         #jump = inputState.isSet("jump")
         #jump = inputState.isSet("jump")
-        
+
         # Check for Auto-Run
         # Check for Auto-Run
         if base.localAvatar.getAutoRun():
         if base.localAvatar.getAutoRun():
             forward = 1
             forward = 1
             reverse = 0
             reverse = 0
-                
+
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.speed=(forward and self.avatarControlForwardSpeed or
         self.speed=(forward and self.avatarControlForwardSpeed or
                     reverse and -self.avatarControlReverseSpeed)
                     reverse and -self.avatarControlReverseSpeed)
@@ -218,7 +218,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         self.rotationSpeed=not slide and (
         self.rotationSpeed=not slide and (
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnRight and -self.avatarControlRotateSpeed))
                 (turnRight and -self.avatarControlRotateSpeed))
-        
+
     def handleAvatarControls(self, task):
     def handleAvatarControls(self, task):
         """
         """
         Check on the arrow keys and update the avatar.
         Check on the arrow keys and update the avatar.
@@ -311,7 +311,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         if hasattr(self, 'cTrav'):
         if hasattr(self, 'cTrav'):
             self.pusher.flush()
             self.pusher.flush()
         self.lifter.flush() # not currently defined or needed
         self.lifter.flush() # not currently defined or needed
-        
+
     if __debug__:
     if __debug__:
         def debugPrint(self, message):
         def debugPrint(self, message):
             """for debugging"""
             """for debugging"""

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

@@ -469,12 +469,12 @@ class PhysicsWalker(DirectObject.DirectObject):
         slideLeft = 0#inputState.isSet("slideLeft")
         slideLeft = 0#inputState.isSet("slideLeft")
         slideRight = 0#inputState.isSet("slideRight")
         slideRight = 0#inputState.isSet("slideRight")
         jump = inputState.isSet("jump")
         jump = inputState.isSet("jump")
-        
+
         # Check for Auto-Run
         # Check for Auto-Run
         if base.localAvatar.getAutoRun():
         if base.localAvatar.getAutoRun():
             forward = 1
             forward = 1
             reverse = 0
             reverse = 0
-                
+
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.__speed=(forward and self.avatarControlForwardSpeed or
         self.__speed=(forward and self.avatarControlForwardSpeed or
                 reverse and -self.avatarControlReverseSpeed)
                 reverse and -self.avatarControlReverseSpeed)

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

@@ -16,7 +16,7 @@ class SwimWalker(NonPhysicsWalker.NonPhysicsWalker):
         if base.localAvatar.getAutoRun():
         if base.localAvatar.getAutoRun():
             forward = 1
             forward = 1
             reverse = 0
             reverse = 0
-        
+
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.speed=(forward and self.avatarControlForwardSpeed or
         self.speed=(forward and self.avatarControlForwardSpeed or
                     reverse and -self.avatarControlReverseSpeed)
                     reverse and -self.avatarControlReverseSpeed)

+ 6 - 6
direct/src/controls/TwoDWalker.py

@@ -9,7 +9,7 @@ from panda3d.core import ConfigVariableBool
 class TwoDWalker(GravityWalker):
 class TwoDWalker(GravityWalker):
     """
     """
     The TwoDWalker is primarily for a 2D Scroller game environment. Eg - Toon Blitz minigame.
     The TwoDWalker is primarily for a 2D Scroller game environment. Eg - Toon Blitz minigame.
-    TODO: This class is still work in progress. 
+    TODO: This class is still work in progress.
     Currently Toon Blitz is using this only for jumping.
     Currently Toon Blitz is using this only for jumping.
     Moving the Toon left to right is handled by toontown/src/minigame/TwoDDrive.py.
     Moving the Toon left to right is handled by toontown/src/minigame/TwoDDrive.py.
     I eventually want this class to control all the 2 D movements, possibly with a
     I eventually want this class to control all the 2 D movements, possibly with a
@@ -26,13 +26,13 @@ class TwoDWalker(GravityWalker):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
         self.notify.debug('Constructing TwoDWalker')
         self.notify.debug('Constructing TwoDWalker')
         GravityWalker.__init__(self)
         GravityWalker.__init__(self)
-    
+
     def handleAvatarControls(self, task):
     def handleAvatarControls(self, task):
         """
         """
         Check on the arrow keys and update the avatar.
         Check on the arrow keys and update the avatar.
-        """                
+        """
         # get the button states:
         # get the button states:
-        jump = inputState.isSet("forward")            
+        jump = inputState.isSet("forward")
         if self.lifter.isOnGround():
         if self.lifter.isOnGround():
             if self.isAirborne:
             if self.isAirborne:
                 self.isAirborne = 0
                 self.isAirborne = 0
@@ -45,9 +45,9 @@ class TwoDWalker(GravityWalker):
             if self.isAirborne == 0:
             if self.isAirborne == 0:
                 assert self.debugPrint("isAirborne 1 due to isOnGround() false")
                 assert self.debugPrint("isAirborne 1 due to isOnGround() false")
             self.isAirborne = 1
             self.isAirborne = 1
-            
+
         return Task.cont
         return Task.cont
-    
+
     def jumpPressed(self):
     def jumpPressed(self):
         """This function should be called from TwoDDrive when the jump key is pressed."""
         """This function should be called from TwoDDrive when the jump key is pressed."""
         if self.lifter.isOnGround():
         if self.lifter.isOnGround():

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

@@ -280,8 +280,8 @@ class DirectJoybox(DirectObject):
                 self.floatingNP.setHpr(hpr)
                 self.floatingNP.setHpr(hpr)
                 self.nodePath.wrtReparentTo(parent)
                 self.nodePath.wrtReparentTo(parent)
                 hpr = Vec3(0,0,0)
                 hpr = Vec3(0,0,0)
-            
-            
+
+
         self.nodePath.setPosHpr(self.nodePath, pos, hpr)
         self.nodePath.setPosHpr(self.nodePath, pos, hpr)
 
 
     def joeMode(self):
     def joeMode(self):
@@ -382,10 +382,10 @@ class DirectJoybox(DirectObject):
 
 
         self.nodePath.setH(self.nodePath,dh)
         self.nodePath.setH(self.nodePath,dh)
         self.nodePath.setY(self.nodePath,dy)
         self.nodePath.setY(self.nodePath,dy)
-                                                
-        
-        
-        
+
+
+
+
 
 
     def spaceFly(self):
     def spaceFly(self):
         # Do nothing if no nodePath selected
         # Do nothing if no nodePath selected

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

@@ -99,7 +99,7 @@ class DirectNotify:
         else:
         else:
             print ("DirectNotify: unknown notify level: " + str(level)
             print ("DirectNotify: unknown notify level: " + str(level)
                    + " for category: " + str(categoryName))
                    + " for category: " + str(categoryName))
-            
+
 
 
     def setDconfigLevels(self):
     def setDconfigLevels(self):
         for categoryName in self.getCategories():
         for categoryName in self.getCategories():

+ 14 - 14
direct/src/directscripts/extract_docs.py

@@ -166,12 +166,12 @@ def processFunction(handle, function, isConstructor = False):
         wrapper = interrogate_function_python_wrapper(function, i_wrapper)
         wrapper = interrogate_function_python_wrapper(function, i_wrapper)
         if interrogate_wrapper_has_comment(wrapper):
         if interrogate_wrapper_has_comment(wrapper):
             print >>handle, block_comment(interrogate_wrapper_comment(wrapper))
             print >>handle, block_comment(interrogate_wrapper_comment(wrapper))
-        
+
         if not isConstructor:
         if not isConstructor:
             if interrogate_function_is_method(function):
             if interrogate_function_is_method(function):
                 if not interrogate_wrapper_number_of_parameters(wrapper) > 0 or not interrogate_wrapper_parameter_is_this(wrapper, 0):
                 if not interrogate_wrapper_number_of_parameters(wrapper) > 0 or not interrogate_wrapper_parameter_is_this(wrapper, 0):
                     print >>handle, "static",
                     print >>handle, "static",
-            
+
             if interrogate_wrapper_has_return_value(wrapper):
             if interrogate_wrapper_has_return_value(wrapper):
                 print >>handle, translated_type_name(interrogate_wrapper_return_type(wrapper)),
                 print >>handle, translated_type_name(interrogate_wrapper_return_type(wrapper)),
             else:
             else:
@@ -180,7 +180,7 @@ def processFunction(handle, function, isConstructor = False):
             print >>handle, translateFunctionName(interrogate_function_name(function)) + "(",
             print >>handle, translateFunctionName(interrogate_function_name(function)) + "(",
         else:
         else:
             print >>handle, "__init__(",
             print >>handle, "__init__(",
-        
+
         first = True
         first = True
         for i_param in range(interrogate_wrapper_number_of_parameters(wrapper)):
         for i_param in range(interrogate_wrapper_number_of_parameters(wrapper)):
             if not interrogate_wrapper_parameter_is_this(wrapper, i_param):
             if not interrogate_wrapper_parameter_is_this(wrapper, i_param):
@@ -190,16 +190,16 @@ def processFunction(handle, function, isConstructor = False):
                 if interrogate_wrapper_parameter_has_name(wrapper, i_param):
                 if interrogate_wrapper_parameter_has_name(wrapper, i_param):
                     print >>handle, interrogate_wrapper_parameter_name(wrapper, i_param),
                     print >>handle, interrogate_wrapper_parameter_name(wrapper, i_param),
                 first = False
                 first = False
-        
+
         print >>handle, ");"
         print >>handle, ");"
 
 
 def processType(handle, type):
 def processType(handle, type):
     typename = translated_type_name(type, scoped=False)
     typename = translated_type_name(type, scoped=False)
     derivations = [ translated_type_name(interrogate_type_get_derivation(type, n)) for n in range(interrogate_type_number_of_derivations(type)) ]
     derivations = [ translated_type_name(interrogate_type_get_derivation(type, n)) for n in range(interrogate_type_number_of_derivations(type)) ]
-    
+
     if interrogate_type_has_comment(type):
     if interrogate_type_has_comment(type):
         print >>handle, block_comment(interrogate_type_comment(type))
         print >>handle, block_comment(interrogate_type_comment(type))
-    
+
     if interrogate_type_is_enum(type):
     if interrogate_type_is_enum(type):
         print >>handle, "enum %s {" % typename
         print >>handle, "enum %s {" % typename
         for i_value in range(interrogate_type_number_of_enum_values(type)):
         for i_value in range(interrogate_type_number_of_enum_values(type)):
@@ -222,28 +222,28 @@ def processType(handle, type):
         else:
         else:
             print "I don't know what type %s is" % interrogate_type_true_name(type)
             print "I don't know what type %s is" % interrogate_type_true_name(type)
             return
             return
-        
+
         if len(derivations) > 0:
         if len(derivations) > 0:
             print >>handle, "%s %s : public %s {" % (classtype, typename, ", public ".join(derivations))
             print >>handle, "%s %s : public %s {" % (classtype, typename, ", public ".join(derivations))
         else:
         else:
             print >>handle, "%s %s {" % (classtype, typename)
             print >>handle, "%s %s {" % (classtype, typename)
         print >>handle, "public:"
         print >>handle, "public:"
-    
+
     for i_ntype in xrange(interrogate_type_number_of_nested_types(type)):
     for i_ntype in xrange(interrogate_type_number_of_nested_types(type)):
         processType(handle, interrogate_type_get_nested_type(type, i_ntype))
         processType(handle, interrogate_type_get_nested_type(type, i_ntype))
-    
+
     for i_method in xrange(interrogate_type_number_of_constructors(type)):
     for i_method in xrange(interrogate_type_number_of_constructors(type)):
         processFunction(handle, interrogate_type_get_constructor(type, i_method), True)
         processFunction(handle, interrogate_type_get_constructor(type, i_method), True)
-    
+
     for i_method in xrange(interrogate_type_number_of_methods(type)):
     for i_method in xrange(interrogate_type_number_of_methods(type)):
         processFunction(handle, interrogate_type_get_method(type, i_method))
         processFunction(handle, interrogate_type_get_method(type, i_method))
-    
+
     for i_method in xrange(interrogate_type_number_of_make_seqs(type)):
     for i_method in xrange(interrogate_type_number_of_make_seqs(type)):
         print >>handle, "list", translateFunctionName(interrogate_make_seq_seq_name(interrogate_type_get_make_seq(type, i_method))), "();"
         print >>handle, "list", translateFunctionName(interrogate_make_seq_seq_name(interrogate_type_get_make_seq(type, i_method))), "();"
 
 
     for i_element in xrange(interrogate_type_number_of_elements(type)):
     for i_element in xrange(interrogate_type_number_of_elements(type)):
         processElement(handle, interrogate_type_get_element(type, i_element))
         processElement(handle, interrogate_type_get_element(type, i_element))
-    
+
     print >>handle, "};"
     print >>handle, "};"
 
 
 def processModule(handle, package):
 def processModule(handle, package):
@@ -277,10 +277,10 @@ def processModule(handle, package):
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     handle = open("pandadoc.hpp", "w")
     handle = open("pandadoc.hpp", "w")
-    
+
     print >>handle, comment("Panda3D modules that are implemented in C++.")
     print >>handle, comment("Panda3D modules that are implemented in C++.")
     print >>handle, "namespace panda3d {"
     print >>handle, "namespace panda3d {"
-    
+
     # Determine the path to the interrogatedb files
     # Determine the path to the interrogatedb files
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "..", "..", "etc"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "..", "..", "etc"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "input"))
     interrogate_add_search_directory(os.path.join(os.path.dirname(pandac.__file__), "input"))

+ 6 - 6
direct/src/directscripts/packpanda.py

@@ -369,8 +369,8 @@ if (sys.platform == "win32"):
     CMD=CMD+'/DPPGAME="'+TMPGAME+'" '
     CMD=CMD+'/DPPGAME="'+TMPGAME+'" '
     CMD=CMD+'/DPPMAIN="'+MAIN+'" '
     CMD=CMD+'/DPPMAIN="'+MAIN+'" '
     CMD=CMD+'/DPPICON="'+PPICON+'" '
     CMD=CMD+'/DPPICON="'+PPICON+'" '
-    CMD=CMD+'"'+PSOURCE+'\\direct\\directscripts\\packpanda.nsi"' 
-    
+    CMD=CMD+'"'+PSOURCE+'\\direct\\directscripts\\packpanda.nsi"'
+
     print ""
     print ""
     print CMD
     print CMD
     print "packing..."
     print "packing..."
@@ -386,12 +386,12 @@ else:
     os.system("cp --recursive %s/Pmw             %s/usr/share/games/%s/Pmw" % (PANDA, TMPDIR, BASENAME))
     os.system("cp --recursive %s/Pmw             %s/usr/share/games/%s/Pmw" % (PANDA, TMPDIR, BASENAME))
     os.system("cp %s                             %s/usr/share/games/%s/LICENSE" % (LICENSE, TMPDIR, BASENAME))
     os.system("cp %s                             %s/usr/share/games/%s/LICENSE" % (LICENSE, TMPDIR, BASENAME))
     os.system("cp --recursive /usr/lib/panda3d/* %s/usr/lib/games/%s/" % (TMPDIR, BASENAME))
     os.system("cp --recursive /usr/lib/panda3d/* %s/usr/lib/games/%s/" % (TMPDIR, BASENAME))
-    
+
     # Make the script to run the game
     # Make the script to run the game
     txt = RUN_SCRIPT[1:].replace("BASENAME",BASENAME).replace("PYTHONV",PYTHONV).replace("MAIN",MAIN)
     txt = RUN_SCRIPT[1:].replace("BASENAME",BASENAME).replace("PYTHONV",PYTHONV).replace("MAIN",MAIN)
     WriteFile(TMPDIR+"/usr/bin/"+BASENAME, txt)
     WriteFile(TMPDIR+"/usr/bin/"+BASENAME, txt)
     os.system("chmod +x "+TMPDIR+"/usr/bin/"+BASENAME)
     os.system("chmod +x "+TMPDIR+"/usr/bin/"+BASENAME)
-    
+
     if (os.path.exists("/usr/bin/rpmbuild")):
     if (os.path.exists("/usr/bin/rpmbuild")):
         os.system("rm -rf %s/DEBIAN" % TMPDIR)
         os.system("rm -rf %s/DEBIAN" % TMPDIR)
         os.system("rpm -E '%_target_cpu' > packpanda-TMP.txt")
         os.system("rpm -E '%_target_cpu' > packpanda-TMP.txt")
@@ -404,7 +404,7 @@ else:
         os.system("mv "+ARCH+"/"+BASENAME+"-"+VER+"-1."+ARCH+".rpm .")
         os.system("mv "+ARCH+"/"+BASENAME+"-"+VER+"-1."+ARCH+".rpm .")
         os.rmdir(ARCH)
         os.rmdir(ARCH)
         os.remove("packpanda-TMP.spec")
         os.remove("packpanda-TMP.spec")
-    
+
     if (os.path.exists("/usr/bin/dpkg-deb")):
     if (os.path.exists("/usr/bin/dpkg-deb")):
         os.system("dpkg --print-architecture > packpanda-TMP.txt")
         os.system("dpkg --print-architecture > packpanda-TMP.txt")
         ARCH=ReadFile("packpanda-TMP.txt").strip()
         ARCH=ReadFile("packpanda-TMP.txt").strip()
@@ -415,7 +415,7 @@ else:
         os.system("cd %s ; (find usr -type f -exec md5sum {} \;) >  DEBIAN/md5sums" % TMPDIR)
         os.system("cd %s ; (find usr -type f -exec md5sum {} \;) >  DEBIAN/md5sums" % TMPDIR)
         WriteFile(TMPDIR+"/DEBIAN/control",txt)
         WriteFile(TMPDIR+"/DEBIAN/control",txt)
         os.system("dpkg-deb -b "+TMPDIR+" "+BASENAME+"_"+VER+"_"+ARCH+".deb")
         os.system("dpkg-deb -b "+TMPDIR+" "+BASENAME+"_"+VER+"_"+ARCH+".deb")
-    
+
     if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")):
     if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")):
         exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
         exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
 
 

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

@@ -12,9 +12,9 @@ COA_MARKER_SF = 0.0075
 Y_AXIS = Vec3(0, 1, 0)
 Y_AXIS = Vec3(0, 1, 0)
 
 
 class DirectCameraControl(DirectObject):
 class DirectCameraControl(DirectObject):
-    
+
     notify = DirectNotifyGlobal.directNotify.newCategory('DirectCameraControl')
     notify = DirectNotifyGlobal.directNotify.newCategory('DirectCameraControl')
-    
+
     def __init__(self):
     def __init__(self):
         # Create the grid
         # Create the grid
         self.startT = 0.0
         self.startT = 0.0
@@ -54,7 +54,7 @@ class DirectCameraControl(DirectObject):
 ##             ['c', self.centerCamIn, 0.5],
 ##             ['c', self.centerCamIn, 0.5],
 ##             ['f', self.fitOnWidget],                  # Note: This function doesn't work as intended
 ##             ['f', self.fitOnWidget],                  # Note: This function doesn't work as intended
 ##             ['h', self.homeCam],
 ##             ['h', self.homeCam],
-##             ['shift-v', self.toggleMarkerVis],          
+##             ['shift-v', self.toggleMarkerVis],
 ##             ['m', self.moveToFit],                      # Note: This function doesn't work as intended; the object dissappears and screen flashes
 ##             ['m', self.moveToFit],                      # Note: This function doesn't work as intended; the object dissappears and screen flashes
 ##             ['n', self.pickNextCOA],
 ##             ['n', self.pickNextCOA],
 ##             ['u', self.orbitUprightCam],
 ##             ['u', self.orbitUprightCam],
@@ -75,12 +75,12 @@ class DirectCameraControl(DirectObject):
 ##             ['-', self.zoomCam, -2.0, t],
 ##             ['-', self.zoomCam, -2.0, t],
 ##             ['_', self.zoomCam, -2.0, t],
 ##             ['_', self.zoomCam, -2.0, t],
 ##             ]
 ##             ]
-        
+
         self.keyEvents = [
         self.keyEvents = [
             ['DIRECT-centerCamIn', self.centerCamIn, 0.5],
             ['DIRECT-centerCamIn', self.centerCamIn, 0.5],
             ['DIRECT-fitOnWidget', self.fitOnWidget],                  # Note: This function doesn't work as intended
             ['DIRECT-fitOnWidget', self.fitOnWidget],                  # Note: This function doesn't work as intended
             ['DIRECT-homeCam', self.homeCam],
             ['DIRECT-homeCam', self.homeCam],
-            ['DIRECT-toggleMarkerVis', self.toggleMarkerVis],          
+            ['DIRECT-toggleMarkerVis', self.toggleMarkerVis],
             ['DIRECT-moveToFit', self.moveToFit],                      # Note: This function doesn't work as intended; the object dissappears and screen flashes
             ['DIRECT-moveToFit', self.moveToFit],                      # Note: This function doesn't work as intended; the object dissappears and screen flashes
             ['DIRECT-pickNextCOA', self.pickNextCOA],
             ['DIRECT-pickNextCOA', self.pickNextCOA],
             ['DIRECT-orbitUprightCam', self.orbitUprightCam],
             ['DIRECT-orbitUprightCam', self.orbitUprightCam],
@@ -106,13 +106,13 @@ class DirectCameraControl(DirectObject):
         self.altDown = 0
         self.altDown = 0
         self.perspCollPlane = None # [gjeon] used for new LE
         self.perspCollPlane = None # [gjeon] used for new LE
         self.perspCollPlane2 = None # [gjeon] used for new LE
         self.perspCollPlane2 = None # [gjeon] used for new LE
-        
+
     def toggleMarkerVis(self):
     def toggleMarkerVis(self):
 ##        if base.direct.cameraControl.coaMarker.isHidden():
 ##        if base.direct.cameraControl.coaMarker.isHidden():
 ##            base.direct.cameraControl.coaMarker.show()
 ##            base.direct.cameraControl.coaMarker.show()
 ##        else:
 ##        else:
 ##            base.direct.cameraControl.coaMarker.hide()
 ##            base.direct.cameraControl.coaMarker.hide()
-            
+
         if self.coaMarker.isHidden():
         if self.coaMarker.isHidden():
             self.coaMarker.show()
             self.coaMarker.show()
         else:
         else:
@@ -142,7 +142,7 @@ class DirectCameraControl(DirectObject):
         if self.manipulateCameraTask:
         if self.manipulateCameraTask:
             taskMgr.remove(self.manipulateCameraTask)
             taskMgr.remove(self.manipulateCameraTask)
             self.manipulateCameraTask = None
             self.manipulateCameraTask = None
-            
+
         if self.manipulateCameraInterval:
         if self.manipulateCameraInterval:
             self.manipulateCameraInterval.finish()
             self.manipulateCameraInterval.finish()
             self.manipulateCameraInterval = None
             self.manipulateCameraInterval = None
@@ -157,7 +157,7 @@ class DirectCameraControl(DirectObject):
         if ival:
         if ival:
             ival.start()
             ival.start()
             self.manipulateCameraInterval = ival
             self.manipulateCameraInterval = ival
-            
+
     def mouseDollyStop(self):
     def mouseDollyStop(self):
         self.__stopManipulateCamera()
         self.__stopManipulateCamera()
 
 
@@ -231,7 +231,7 @@ class DirectCameraControl(DirectObject):
         self.coaMarker.show()
         self.coaMarker.show()
         # Resize it
         # Resize it
         self.updateCoaMarkerSize()
         self.updateCoaMarkerSize()
-        
+
     def mouseFlyStartTopWin(self):
     def mouseFlyStartTopWin(self):
         print "Moving mouse 2 in new window"
         print "Moving mouse 2 in new window"
         #altIsDown = base.getAlt()
         #altIsDown = base.getAlt()
@@ -281,7 +281,7 @@ class DirectCameraControl(DirectObject):
         self.__stopManipulateCamera()
         self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
         t = Task.Task(self.OrthoZoomTask)
         t = Task.Task(self.OrthoZoomTask)
-        self.__startManipulateCamera(task = t)        
+        self.__startManipulateCamera(task = t)
 
 
     def spawnHPPan(self):
     def spawnHPPan(self):
         # Kill any existing tasks
         # Kill any existing tasks
@@ -349,7 +349,7 @@ class DirectCameraControl(DirectObject):
             moveDir = Vec3(Y_AXIS)
             moveDir = Vec3(Y_AXIS)
 
 
         if self.useMayaCamControls : # use maya controls
         if self.useMayaCamControls : # use maya controls
-            moveDir.assign(moveDir * ((base.direct.dr.mouseDeltaX -1.0 * base.direct.dr.mouseDeltaY) 
+            moveDir.assign(moveDir * ((base.direct.dr.mouseDeltaX -1.0 * base.direct.dr.mouseDeltaY)
                                     * state.zoomSF))
                                     * state.zoomSF))
             hVal = 0.0
             hVal = 0.0
         else:
         else:
@@ -382,7 +382,7 @@ class DirectCameraControl(DirectObject):
             base.direct.dr.orthoFactor = 0.0001
             base.direct.dr.orthoFactor = 0.0001
         base.direct.dr.updateFilmSize(x, y)
         base.direct.dr.updateFilmSize(x, y)
         return Task.cont
         return Task.cont
-    
+
     def HPPanTask(self, state):
     def HPPanTask(self, state):
         base.direct.camera.setHpr(base.direct.camera,
         base.direct.camera.setHpr(base.direct.camera,
                              (0.5 * base.direct.dr.mouseDeltaX *
                              (0.5 * base.direct.dr.mouseDeltaX *
@@ -403,7 +403,7 @@ class DirectCameraControl(DirectObject):
             if base.direct.camera.getPos().getZ() >=0:
             if base.direct.camera.getPos().getZ() >=0:
                 iRay.ct.traverse(self.perspCollPlane)
                 iRay.ct.traverse(self.perspCollPlane)
             else:
             else:
-                iRay.ct.traverse(self.perspCollPlane2)                
+                iRay.ct.traverse(self.perspCollPlane2)
 
 
             if iRay.getNumEntries() > 0:
             if iRay.getNumEntries() > 0:
                 entry = iRay.getEntry(0)
                 entry = iRay.getEntry(0)
@@ -814,7 +814,7 @@ class DirectCameraControl(DirectObject):
 
 
         # How far do you move the camera to be this distance from the node?
         # How far do you move the camera to be this distance from the node?
         deltaMove = vWidget2Camera - centerVec
         deltaMove = vWidget2Camera - centerVec
-        
+
         # Move a target there
         # Move a target there
         try:
         try:
             self.camManipRef.setPos(base.direct.camera, deltaMove)
             self.camManipRef.setPos(base.direct.camera, deltaMove)

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

@@ -59,4 +59,4 @@ def LE_showInOneCam(nodePath, thisCamName):
     for camName in LE_CAM_MASKS.keys():
     for camName in LE_CAM_MASKS.keys():
         if camName != thisCamName:
         if camName != thisCamName:
             nodePath.hide(LE_CAM_MASKS[camName])
             nodePath.hide(LE_CAM_MASKS[camName])
-    
+

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

@@ -55,7 +55,7 @@ class DirectGrid(NodePath, DirectObject):
             self.reparentTo(parent)
             self.reparentTo(parent)
         else:
         else:
             self.reparentTo(base.direct.group)
             self.reparentTo(base.direct.group)
-            
+
         self.updateGrid()
         self.updateGrid()
         self.fEnabled = 1
         self.fEnabled = 1
 
 

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

@@ -7,7 +7,7 @@ class DirectLight(NodePath):
         NodePath.__init__(self)
         NodePath.__init__(self)
         # Record light and name
         # Record light and name
         self.light = light
         self.light = light
-        
+
         # Attach node to self
         # Attach node to self
         self.assign(parent.attachNewNode(self.light))
         self.assign(parent.attachNewNode(self.light))
 
 

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

@@ -72,11 +72,11 @@ class DirectManipulationControl(DirectObject):
             base.direct.widget.multiplyScalingFactorBy(factor)
             base.direct.widget.multiplyScalingFactorBy(factor)
         else:
         else:
             self.objectHandles.multiplyScalingFactorBy(factor)
             self.objectHandles.multiplyScalingFactorBy(factor)
-        
+
     def supportMultiView(self):
     def supportMultiView(self):
         if self.fMultiView:
         if self.fMultiView:
             return
             return
-        
+
         self.objectHandles.hide(BitMask32.bit(0))
         self.objectHandles.hide(BitMask32.bit(0))
         self.objectHandles.hide(BitMask32.bit(1))
         self.objectHandles.hide(BitMask32.bit(1))
         self.objectHandles.hide(BitMask32.bit(2))
         self.objectHandles.hide(BitMask32.bit(2))
@@ -99,14 +99,14 @@ class DirectManipulationControl(DirectObject):
         self.leftViewWidget.hide(BitMask32.bit(3))
         self.leftViewWidget.hide(BitMask32.bit(3))
 
 
         self.fMultiView = 1
         self.fMultiView = 1
-        
+
     def manipulationStart(self, modifiers):
     def manipulationStart(self, modifiers):
         # Start out in select mode
         # Start out in select mode
         self.mode = 'select'
         self.mode = 'select'
 
 
         if base.direct.cameraControl.useMayaCamControls and modifiers == 4:
         if base.direct.cameraControl.useMayaCamControls and modifiers == 4:
             self.mode = 'camera'
             self.mode = 'camera'
-        
+
         if self.fAllowSelectionOnly:
         if self.fAllowSelectionOnly:
             return
             return
 
 
@@ -131,7 +131,7 @@ class DirectManipulationControl(DirectObject):
                     return
                     return
         else:
         else:
             entry = None
             entry = None
-            
+
         if not base.direct.gotAlt(modifiers):
         if not base.direct.gotAlt(modifiers):
             if entry:
             if entry:
                 # Check to see if we are moving the object
                 # Check to see if we are moving the object
@@ -158,10 +158,10 @@ class DirectManipulationControl(DirectObject):
 
 
     def switchToWorldSpaceMode(self):
     def switchToWorldSpaceMode(self):
         self.worldSpaceManip = True
         self.worldSpaceManip = True
-    
+
     def switchToLocalSpaceMode(self):
     def switchToLocalSpaceMode(self):
         self.worldSpaceManip = False
         self.worldSpaceManip = False
-                    
+
     def switchToMoveMode(self, state):
     def switchToMoveMode(self, state):
         taskMgr.remove('manip-watch-mouse')
         taskMgr.remove('manip-watch-mouse')
         self.mode = 'move'
         self.mode = 'move'
@@ -180,7 +180,7 @@ class DirectManipulationControl(DirectObject):
 
 
     def watchMarqueeTask(self, state):
     def watchMarqueeTask(self, state):
         taskMgr.remove('manip-watch-mouse')
         taskMgr.remove('manip-watch-mouse')
-        taskMgr.remove('manip-move-wait')  
+        taskMgr.remove('manip-move-wait')
         self.mode = 'select'
         self.mode = 'select'
         self.drawMarquee(state.initX, state.initY)
         self.drawMarquee(state.initX, state.initY)
         return Task.cont
         return Task.cont
@@ -287,7 +287,7 @@ class DirectManipulationControl(DirectObject):
                     nodePath = findTaggedNodePath(geom)
                     nodePath = findTaggedNodePath(geom)
                     if nodePath in selectionList:
                     if nodePath in selectionList:
                         continue
                         continue
-    
+
                     bb = geom.getBounds()
                     bb = geom.getBounds()
                     bbc = bb.makeCopy()
                     bbc = bb.makeCopy()
                     bbc.xform(geom.getParent().getNetTransform().getMat())
                     bbc.xform(geom.getParent().getNetTransform().getMat())
@@ -305,7 +305,7 @@ class DirectManipulationControl(DirectObject):
                             max = Point3(0)
                             max = Point3(0)
                             geom.calcTightBounds(min, max)
                             geom.calcTightBounds(min, max)
                             # Restore transform
                             # Restore transform
-                            geom.setMat(tMat)                                
+                            geom.setMat(tMat)
 
 
                             fll = Point3(min[0], max[1], min[2])
                             fll = Point3(min[0], max[1], min[2])
                             flr = Point3(max[0], max[1], min[2])
                             flr = Point3(max[0], max[1], min[2])
@@ -341,7 +341,7 @@ class DirectManipulationControl(DirectObject):
                     base.direct.deselectAll()
                     base.direct.deselectAll()
         #elif self.mode == 'move':
         #elif self.mode == 'move':
         self.manipulateObjectCleanup()
         self.manipulateObjectCleanup()
-            
+
         self.mode = None
         self.mode = None
 
 
     def manipulateObjectCleanup(self):
     def manipulateObjectCleanup(self):
@@ -460,7 +460,7 @@ class DirectManipulationControl(DirectObject):
             if hasattr(base.direct, 'widget'):
             if hasattr(base.direct, 'widget'):
                 base.direct.widget.coaModeColor()
                 base.direct.widget.coaModeColor()
             else:
             else:
-                self.objectHandles.coaModeColor()            
+                self.objectHandles.coaModeColor()
         else:
         else:
             if hasattr(base.direct, 'widget'):
             if hasattr(base.direct, 'widget'):
                 base.direct.widget.manipModeColor()
                 base.direct.widget.manipModeColor()
@@ -472,7 +472,7 @@ class DirectManipulationControl(DirectObject):
         if hasattr(base.direct, 'widget'):
         if hasattr(base.direct, 'widget'):
             base.direct.widget.disabledModeColor()
             base.direct.widget.disabledModeColor()
         else:
         else:
-            self.objectHandles.disabledModeColor()        
+            self.objectHandles.disabledModeColor()
 
 
     #--------------------------------------------------------------------------
     #--------------------------------------------------------------------------
     # Function:   get edit types list for specified objects which indicate
     # Function:   get edit types list for specified objects which indicate
@@ -589,7 +589,7 @@ class DirectManipulationControl(DirectObject):
                         else:
                         else:
                             # [gjeon] uniform scaling
                             # [gjeon] uniform scaling
                             self.fScaling3D = 1
                             self.fScaling3D = 1
-                            self.scale3D(state)                    
+                            self.scale3D(state)
                     else:
                     else:
                         if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
                         if type == 'post' and not self.currEditTypes & EDIT_TYPE_UNMOVABLE:
                             self.xlate1D(state)
                             self.xlate1D(state)
@@ -714,7 +714,7 @@ class DirectManipulationControl(DirectObject):
                 if self.fGridSnap:
                 if self.fGridSnap:
                     base.direct.widget.setPos(self.gridSnapping(base.direct.widget, offset))
                     base.direct.widget.setPos(self.gridSnapping(base.direct.widget, offset))
                 else:
                 else:
-                    base.direct.widget.setPos(base.direct.widget, offset)                
+                    base.direct.widget.setPos(base.direct.widget, offset)
 
 
     def xlate2D(self, state):
     def xlate2D(self, state):
         # Constrained 2D (planar) translation
         # Constrained 2D (planar) translation
@@ -744,7 +744,7 @@ class DirectManipulationControl(DirectObject):
                 if self.fGridSnap:
                 if self.fGridSnap:
                     base.direct.widget.setPos(self.gridSnapping(base.direct.widget, offset))
                     base.direct.widget.setPos(self.gridSnapping(base.direct.widget, offset))
                 else:
                 else:
-                    base.direct.widget.setPos(base.direct.widget, offset)  
+                    base.direct.widget.setPos(base.direct.widget, offset)
 
 
     def rotate1D(self, state):
     def rotate1D(self, state):
         # Constrained 1D rotation about the widget's main axis (X, Y, or Z)
         # Constrained 1D rotation about the widget's main axis (X, Y, or Z)
@@ -940,7 +940,7 @@ class DirectManipulationControl(DirectObject):
                 elif self.constraint[:1] == 'z':
                 elif self.constraint[:1] == 'z':
                     currScale = Vec3(currScale.getX(), currScale.getY(), currScale.getZ() * d1/d0)
                     currScale = Vec3(currScale.getX(), currScale.getY(), currScale.getZ() * d1/d0)
                 base.direct.widget.setScale(currScale)
                 base.direct.widget.setScale(currScale)
-            return                
+            return
 
 
         # [gjeon] Constrained 1D scale of the selected node based upon up down mouse motion
         # [gjeon] Constrained 1D scale of the selected node based upon up down mouse motion
         if self.fScaleInit:
         if self.fScaleInit:
@@ -957,7 +957,7 @@ class DirectManipulationControl(DirectObject):
 
 
         # Scale factor is ratio current mag with init mag
         # Scale factor is ratio current mag with init mag
         if self.constraint[:1] == 'x':
         if self.constraint[:1] == 'x':
-            currScale = Vec3(self.initScale.getX() * 
+            currScale = Vec3(self.initScale.getX() *
                              self.objectHandles.getAxisIntersectPt('x').length() / self.initScaleMag,
                              self.objectHandles.getAxisIntersectPt('x').length() / self.initScaleMag,
                              self.initScale.getY(), self.initScale.getZ())
                              self.initScale.getY(), self.initScale.getZ())
         elif self.constraint[:1] == 'y':
         elif self.constraint[:1] == 'y':
@@ -992,7 +992,7 @@ class DirectManipulationControl(DirectObject):
                     # Scale factor is ratio current mag with init mag
                     # Scale factor is ratio current mag with init mag
                     currScale = Vec3(currScale.getX() * d1/d0, currScale.getY() * d1/d0, currScale.getZ() * d1/d0)
                     currScale = Vec3(currScale.getX() * d1/d0, currScale.getY() * d1/d0, currScale.getZ() * d1/d0)
                     base.direct.widget.setScale(currScale)
                     base.direct.widget.setScale(currScale)
-                return      
+                return
             else:
             else:
                 self.hitPtScale.assign(self.objectHandles.getMouseIntersectPt())
                 self.hitPtScale.assign(self.objectHandles.getMouseIntersectPt())
 
 
@@ -1134,29 +1134,29 @@ class ObjectHandles(NodePath, DirectObject):
 
 
         # tag with name so they can skipped during iRay selection
         # tag with name so they can skipped during iRay selection
         self.xPostCollision.setTag('WidgetName',name)
         self.xPostCollision.setTag('WidgetName',name)
-        self.yPostCollision.setTag('WidgetName',name)        
+        self.yPostCollision.setTag('WidgetName',name)
         self.zPostCollision.setTag('WidgetName',name)
         self.zPostCollision.setTag('WidgetName',name)
 
 
         self.xRingCollision.setTag('WidgetName',name)
         self.xRingCollision.setTag('WidgetName',name)
-        self.yRingCollision.setTag('WidgetName',name)        
+        self.yRingCollision.setTag('WidgetName',name)
         self.zRingCollision.setTag('WidgetName',name)
         self.zRingCollision.setTag('WidgetName',name)
 
 
         self.xDiscCollision.setTag('WidgetName',name)
         self.xDiscCollision.setTag('WidgetName',name)
-        self.yDiscCollision.setTag('WidgetName',name)        
+        self.yDiscCollision.setTag('WidgetName',name)
         self.zDiscCollision.setTag('WidgetName',name)
         self.zDiscCollision.setTag('WidgetName',name)
-        
+
         self.xScaleCollision.setTag('WidgetName',name)
         self.xScaleCollision.setTag('WidgetName',name)
-        self.yScaleCollision.setTag('WidgetName',name)        
+        self.yScaleCollision.setTag('WidgetName',name)
         self.zScaleCollision.setTag('WidgetName',name)
         self.zScaleCollision.setTag('WidgetName',name)
 
 
         # name disc geoms so they can be added to unpickables
         # name disc geoms so they can be added to unpickables
         self.xDisc.find("**/+GeomNode").setName('x-disc-geom')
         self.xDisc.find("**/+GeomNode").setName('x-disc-geom')
         self.yDisc.find("**/+GeomNode").setName('y-disc-geom')
         self.yDisc.find("**/+GeomNode").setName('y-disc-geom')
-        self.zDisc.find("**/+GeomNode").setName('z-disc-geom')        
+        self.zDisc.find("**/+GeomNode").setName('z-disc-geom')
 
 
         #turn scale off by default
         #turn scale off by default
         self.disableHandles('scale')
         self.disableHandles('scale')
-        
+
         # Start with widget handles hidden
         # Start with widget handles hidden
         self.fActive = 1
         self.fActive = 1
         self.toggleWidget()
         self.toggleWidget()
@@ -1172,7 +1172,7 @@ class ObjectHandles(NodePath, DirectObject):
 
 
     def manipModeColor(self):
     def manipModeColor(self):
         self.clearColor()
         self.clearColor()
-            
+
     def toggleWidget(self):
     def toggleWidget(self):
         if self.fActive:
         if self.fActive:
             if hasattr(base.direct, "manipulationControl") and base.direct.manipulationControl.fMultiView:
             if hasattr(base.direct, "manipulationControl") and base.direct.manipulationControl.fMultiView:
@@ -1187,7 +1187,7 @@ class ObjectHandles(NodePath, DirectObject):
                     widget.showWidgetIfActive()
                     widget.showWidgetIfActive()
             else:
             else:
                 self.activate()
                 self.activate()
-                    
+
     def activate(self):
     def activate(self):
         self.scalingNode.reparentTo(self)
         self.scalingNode.reparentTo(self)
         self.fActive = 1
         self.fActive = 1
@@ -1195,7 +1195,7 @@ class ObjectHandles(NodePath, DirectObject):
     def deactivate(self):
     def deactivate(self):
         self.scalingNode.reparentTo(hidden)
         self.scalingNode.reparentTo(hidden)
         self.fActive = 0
         self.fActive = 0
-                
+
     def showWidgetIfActive(self):
     def showWidgetIfActive(self):
         if self.fActive:
         if self.fActive:
             self.reparentTo(base.direct.group)
             self.reparentTo(base.direct.group)
@@ -1205,7 +1205,7 @@ class ObjectHandles(NodePath, DirectObject):
 
 
     def hideWidget(self):
     def hideWidget(self):
         self.reparentTo(hidden)
         self.reparentTo(hidden)
-                
+
     def enableHandles(self, handles):
     def enableHandles(self, handles):
         if type(handles) == types.ListType:
         if type(handles) == types.ListType:
             for handle in handles:
             for handle in handles:
@@ -1389,7 +1389,7 @@ class ObjectHandles(NodePath, DirectObject):
     def multiplyScalingFactorBy(self, factor):
     def multiplyScalingFactorBy(self, factor):
         self.ohScalingFactor = self.ohScalingFactor * factor
         self.ohScalingFactor = self.ohScalingFactor * factor
         sf = self.ohScalingFactor * self.directScalingFactor
         sf = self.ohScalingFactor * self.directScalingFactor
-        ival = self.scalingNode.scaleInterval(0.5, (sf, sf, sf), 
+        ival = self.scalingNode.scaleInterval(0.5, (sf, sf, sf),
                                               blendType = 'easeInOut',
                                               blendType = 'easeInOut',
                                               name = 'resizeObjectHandles')
                                               name = 'resizeObjectHandles')
         ival.start()
         ival.start()
@@ -1436,7 +1436,7 @@ class ObjectHandles(NodePath, DirectObject):
 
 
         lines.create()
         lines.create()
         lines.setName('x-post-line')
         lines.setName('x-post-line')
-        
+
         #X scale
         #X scale
         self.xScale = self.xScaleGroup.attachNewNode('x-scale-visible')
         self.xScale = self.xScaleGroup.attachNewNode('x-scale-visible')
         lines = LineNodePath(self.xScale)
         lines = LineNodePath(self.xScale)
@@ -1444,9 +1444,9 @@ class ObjectHandles(NodePath, DirectObject):
         lines.setThickness(5)
         lines.setThickness(5)
         lines.moveTo(1.3, 0, 0)
         lines.moveTo(1.3, 0, 0)
         lines.drawTo(-1.5, 0, 0)
         lines.drawTo(-1.5, 0, 0)
-        
+
         drawBox(lines, (1.3, 0, 0), 0.2)
         drawBox(lines, (1.3, 0, 0), 0.2)
-        
+
         lines.create()
         lines.create()
         lines.setName('x-scale-line')
         lines.setName('x-scale-line')
 
 
@@ -1497,12 +1497,12 @@ class ObjectHandles(NodePath, DirectObject):
         lines.setThickness(5)
         lines.setThickness(5)
         lines.moveTo(0, 1.3, 0)
         lines.moveTo(0, 1.3, 0)
         lines.drawTo(0, -1.5, 0)
         lines.drawTo(0, -1.5, 0)
-        
+
         drawBox(lines, (0, 1.4, 0), 0.2)
         drawBox(lines, (0, 1.4, 0), 0.2)
-        
+
         lines.create()
         lines.create()
         lines.setName('y-scale-line')
         lines.setName('y-scale-line')
-        
+
         # Y ring
         # Y ring
         self.yRing = self.yRingGroup.attachNewNode('y-ring-visible')
         self.yRing = self.yRingGroup.attachNewNode('y-ring-visible')
         lines = LineNodePath(self.yRing)
         lines = LineNodePath(self.yRing)
@@ -1515,7 +1515,7 @@ class ObjectHandles(NodePath, DirectObject):
                           math.sin(deg2Rad(ang)))
                           math.sin(deg2Rad(ang)))
         lines.create()
         lines.create()
         lines.setName('y-ring-line')
         lines.setName('y-ring-line')
-        
+
         # Z post
         # Z post
         self.zPost = self.zPostGroup.attachNewNode('z-post-visible')
         self.zPost = self.zPostGroup.attachNewNode('z-post-visible')
         lines = LineNodePath(self.zPost)
         lines = LineNodePath(self.zPost)
@@ -1551,12 +1551,12 @@ class ObjectHandles(NodePath, DirectObject):
         lines.setThickness(5)
         lines.setThickness(5)
         lines.moveTo(0, 0, 1.3)
         lines.moveTo(0, 0, 1.3)
         lines.drawTo(0, 0, -1.5)
         lines.drawTo(0, 0, -1.5)
-        
+
         drawBox(lines, (0, 0, 1.4), 0.2)
         drawBox(lines, (0, 0, 1.4), 0.2)
-        
+
         lines.create()
         lines.create()
         lines.setName('y-scale-line')
         lines.setName('y-scale-line')
-        
+
         # Z ring
         # Z ring
         self.zRing = self.zRingGroup.attachNewNode('z-ring-visible')
         self.zRing = self.zRingGroup.attachNewNode('z-ring-visible')
         lines = LineNodePath(self.zRing)
         lines = LineNodePath(self.zRing)
@@ -1601,7 +1601,7 @@ class ObjectHandles(NodePath, DirectObject):
 
 
     def getAxisIntersectPt(self, axis):
     def getAxisIntersectPt(self, axis):
         if hasattr(base.direct, "manipulationControl") and base.direct.manipulationControl.fMultiView and\
         if hasattr(base.direct, "manipulationControl") and base.direct.manipulationControl.fMultiView and\
-           base.direct.camera.getName() != 'persp':           
+           base.direct.camera.getName() != 'persp':
             # create ray from the camera to detect 3d position
             # create ray from the camera to detect 3d position
             iRay = SelectionRay(base.direct.camera)
             iRay = SelectionRay(base.direct.camera)
             iRay.collider.setFromLens(base.direct.camNode, base.direct.dr.mouseX, base.direct.dr.mouseY)
             iRay.collider.setFromLens(base.direct.camNode, base.direct.dr.mouseX, base.direct.dr.mouseY)
@@ -1622,12 +1622,12 @@ class ObjectHandles(NodePath, DirectObject):
                 self.hitPt.setZ(0)
                 self.hitPt.setZ(0)
             elif axis == 'y':
             elif axis == 'y':
                 self.hitPt.setX(0)
                 self.hitPt.setX(0)
-                self.hitPt.setZ(0)                
+                self.hitPt.setZ(0)
             elif axis == 'z':
             elif axis == 'z':
                 self.hitPt.setX(0)
                 self.hitPt.setX(0)
-                self.hitPt.setY(0)                
+                self.hitPt.setY(0)
             return self.hitPt
             return self.hitPt
-        
+
         # Calc the xfrom from camera to widget
         # Calc the xfrom from camera to widget
         mCam2Widget = base.direct.camera.getMat(base.direct.widget)
         mCam2Widget = base.direct.camera.getMat(base.direct.widget)
         lineDir = Vec3(mCam2Widget.xformVec(base.direct.dr.nearVec))
         lineDir = Vec3(mCam2Widget.xformVec(base.direct.dr.nearVec))
@@ -1683,7 +1683,7 @@ class ObjectHandles(NodePath, DirectObject):
         if iRay.getNumEntries() == 0:
         if iRay.getNumEntries() == 0:
             del iRay
             del iRay
             return Point3(0)
             return Point3(0)
-        
+
         entry = iRay.getEntry(0)
         entry = iRay.getEntry(0)
         hitPt = entry.getSurfacePoint(entry.getFromNodePath())
         hitPt = entry.getSurfacePoint(entry.getFromNodePath())
 
 
@@ -1701,7 +1701,7 @@ class ObjectHandles(NodePath, DirectObject):
            base.direct.camera.getName() != 'persp':
            base.direct.camera.getName() != 'persp':
             self.hitPt.assign(self.getMouseIntersectPt())
             self.hitPt.assign(self.getMouseIntersectPt())
             return self.hitPt
             return self.hitPt
-        
+
         # Find out the point of interection of the ray passing though the mouse
         # Find out the point of interection of the ray passing though the mouse
         # with the plane containing the 2D xlation or 1D rotation widgets
         # with the plane containing the 2D xlation or 1D rotation widgets
 
 
@@ -1739,31 +1739,31 @@ def drawBox(lines, center, sideLength):
         lines.drawTo(center[0] + l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
-        
+
         lines.moveTo(center[0] - l, center[1] + l, center[2] + l)
         lines.moveTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
-        
+
         lines.moveTo(center[0] + l, center[1] + l, center[2] + l)
         lines.moveTo(center[0] + l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
-        
+
         lines.moveTo(center[0] + l, center[1] - l, center[2] + l)
         lines.moveTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
-        
+
         lines.moveTo(center[0] + l, center[1] + l, center[2] + l)
         lines.moveTo(center[0] + l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] - l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
         lines.drawTo(center[0] + l, center[1] + l, center[2] + l)
-        
+
         lines.moveTo(center[0] + l, center[1] + l, center[2] - l)
         lines.moveTo(center[0] + l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] + l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)
         lines.drawTo(center[0] - l, center[1] - l, center[2] - l)

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

@@ -616,7 +616,7 @@ class SelectionRay(SelectionQueue):
         if direct:
         if direct:
             self.collider.setFromLens(base.direct.camNode, mx, my)
             self.collider.setFromLens(base.direct.camNode, mx, my)
         else:
         else:
-            self.collider.setFromLens(base.camNode, mx, my)            
+            self.collider.setFromLens(base.camNode, mx, my)
         self.ct.traverse(targetNodePath)
         self.ct.traverse(targetNodePath)
         self.sortEntries()
         self.sortEntries()
 
 

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

@@ -186,7 +186,7 @@ class DirectSession(DirectObject):
         if base.wantTk:
         if base.wantTk:
             from direct.tkpanels import Placer
             from direct.tkpanels import Placer
             from direct.tkwidgets import Slider
             from direct.tkwidgets import Slider
-            from direct.tkwidgets import SceneGraphExplorer            
+            from direct.tkwidgets import SceneGraphExplorer
             self.actionEvents.extend([
             self.actionEvents.extend([
             ['SGE_Place', Placer.place],
             ['SGE_Place', Placer.place],
             ['SGE_Set Color', Slider.rgbPanel],
             ['SGE_Set Color', Slider.rgbPanel],
@@ -210,7 +210,7 @@ class DirectSession(DirectObject):
 
 
         self.keyEvents = keyList[:]
         self.keyEvents = keyList[:]
         self.keyEvents.extend(list(map(addCtrl, keyList)))
         self.keyEvents.extend(list(map(addCtrl, keyList)))
-        self.keyEvents.extend(list(map(addShift, keyList)))        
+        self.keyEvents.extend(list(map(addShift, keyList)))
         self.keyEvents.extend(self.specialKeys)
         self.keyEvents.extend(self.specialKeys)
 
 
         self.mouseEvents = ['mouse1', 'mouse1-up',
         self.mouseEvents = ['mouse1', 'mouse1-up',
@@ -291,7 +291,7 @@ class DirectSession(DirectObject):
                               'enter': 'DIRECT-enter',
                               'enter': 'DIRECT-enter',
                              }
                              }
 
 
-        self.passThroughKeys = ['v','b','l','p', 'r', 'shift-r', 's', 't','shift-a', 'w'] 
+        self.passThroughKeys = ['v','b','l','p', 'r', 'shift-r', 's', 't','shift-a', 'w']
 
 
         if base.wantTk:
         if base.wantTk:
             from direct.showbase import TkGlobal
             from direct.showbase import TkGlobal
@@ -403,7 +403,7 @@ class DirectSession(DirectObject):
             # Position a target point to lerp the oobe camera to
             # Position a target point to lerp the oobe camera to
             base.direct.cameraControl.camManipRef.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0)
             base.direct.cameraControl.camManipRef.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0)
             ival = self.oobeCamera.posHprInterval(
             ival = self.oobeCamera.posHprInterval(
-                2.0, pos = Point3(0), hpr = Vec3(0), 
+                2.0, pos = Point3(0), hpr = Vec3(0),
                 other = base.direct.cameraControl.camManipRef,
                 other = base.direct.cameraControl.camManipRef,
                 blendType = 'easeInOut')
                 blendType = 'easeInOut')
             ival = Sequence(ival, Func(self.endOOBE), name = 'oobeTransition')
             ival = Sequence(ival, Func(self.endOOBE), name = 'oobeTransition')
@@ -425,7 +425,7 @@ class DirectSession(DirectObject):
                 self.trueCamera, Vec3(-2, -20, 5))
                 self.trueCamera, Vec3(-2, -20, 5))
             base.direct.cameraControl.camManipRef.lookAt(self.trueCamera)
             base.direct.cameraControl.camManipRef.lookAt(self.trueCamera)
             ival = self.oobeCamera.posHprInterval(
             ival = self.oobeCamera.posHprInterval(
-                2.0, pos = Point3(0), hpr = Vec3(0), 
+                2.0, pos = Point3(0), hpr = Vec3(0),
                 other = base.direct.cameraControl.camManipRef,
                 other = base.direct.cameraControl.camManipRef,
                 blendType = 'easeInOut')
                 blendType = 'easeInOut')
             ival = Sequence(ival, Func(self.beginOOBE), name = 'oobeTransition')
             ival = Sequence(ival, Func(self.beginOOBE), name = 'oobeTransition')
@@ -498,19 +498,19 @@ class DirectSession(DirectObject):
                     if input.endswith('-up') or\
                     if input.endswith('-up') or\
                        input not in self.modifierEvents:
                        input not in self.modifierEvents:
                         # to handle orphan events
                         # to handle orphan events
-                        return                        
+                        return
 
 
                 if (self.fMouse1 == 0 and 'mouse1-up' in input) or\
                 if (self.fMouse1 == 0 and 'mouse1-up' in input) or\
                    (self.fMouse2 == 0 and 'mouse2-up' in input) or\
                    (self.fMouse2 == 0 and 'mouse2-up' in input) or\
                    (self.fMouse3 == 0 and 'mouse3-up' in input):
                    (self.fMouse3 == 0 and 'mouse3-up' in input):
                     # to handle orphan events
                     # to handle orphan events
-                    return 
+                    return
 
 
                 if (self.fMouse1 or self.fMouse2 or self.fMouse3) and\
                 if (self.fMouse1 or self.fMouse2 or self.fMouse3) and\
                    input[4:7] != base.direct.camera.getName()[:3] and\
                    input[4:7] != base.direct.camera.getName()[:3] and\
                    input.endswith('-up'):
                    input.endswith('-up'):
                     # to handle orphan events
                     # to handle orphan events
-                    return  
+                    return
 
 
                 winCtrl = None
                 winCtrl = None
                 possibleWinCtrls = []
                 possibleWinCtrls = []
@@ -530,7 +530,7 @@ class DirectSession(DirectObject):
                                 winCtrl = cWinCtrl
                                 winCtrl = cWinCtrl
                         else:
                         else:
                             if input[4:7] != cWinCtrl.camera.getName()[:3]:
                             if input[4:7] != cWinCtrl.camera.getName()[:3]:
-                                winCtrl = cWinCtrl                                
+                                winCtrl = cWinCtrl
                 if winCtrl is None:
                 if winCtrl is None:
                     return
                     return
                 if input not in self.modifierEvents:
                 if input not in self.modifierEvents:
@@ -667,7 +667,7 @@ class DirectSession(DirectObject):
             taskMgr.add(self.widgetResizeTask, 'DIRECTWidgetResize')
             taskMgr.add(self.widgetResizeTask, 'DIRECTWidgetResize')
         else:
         else:
             taskMgr.remove('DIRECTWidgetResize')
             taskMgr.remove('DIRECTWidgetResize')
-            
+
     def widgetResizeTask(self, state):
     def widgetResizeTask(self, state):
         if not taskMgr.hasTaskNamed('resizeObjectHandles'):
         if not taskMgr.hasTaskNamed('resizeObjectHandles'):
             dnp = self.selected.last
             dnp = self.selected.last
@@ -680,7 +680,7 @@ class DirectSession(DirectObject):
                     nodeCamDist = Vec3(dnp.getPos(base.camList[3])).length()
                     nodeCamDist = Vec3(dnp.getPos(base.camList[3])).length()
                     sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList[3].fovV))
                     sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList[3].fovV))
                     self.manipulationControl.widgetList[3].setDirectScalingFactor(sf)
                     self.manipulationControl.widgetList[3].setDirectScalingFactor(sf)
-                        
+
                 else:
                 else:
                     nodeCamDist = Vec3(dnp.getPos(direct.camera)).length()
                     nodeCamDist = Vec3(dnp.getPos(direct.camera)).length()
                     sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV))
                     sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV))
@@ -757,7 +757,7 @@ class DirectSession(DirectObject):
                 for widget in self.manipulationControl.widgetList:
                 for widget in self.manipulationControl.widgetList:
                     widget.hideWidget()
                     widget.hideWidget()
             else:
             else:
-                self.widget.hideWidget()                
+                self.widget.hideWidget()
             self.selectedNPReadout.reparentTo(hidden)
             self.selectedNPReadout.reparentTo(hidden)
             self.selectedNPReadout.setText(' ')
             self.selectedNPReadout.setText(' ')
             taskMgr.remove('followSelectedNodePath')
             taskMgr.remove('followSelectedNodePath')
@@ -1311,10 +1311,10 @@ class DisplayRegionList(DirectObject):
         self.mouseUpdate()
         self.mouseUpdate()
         # hack to test movement
         # hack to test movement
         return Task.cont
         return Task.cont
-        
+
     def addDisplayRegionContext(self, cam):
     def addDisplayRegionContext(self, cam):
         self.displayRegionList.append(DisplayRegionContext(cam))
         self.displayRegionList.append(DisplayRegionContext(cam))
-        
+
     def removeDisplayRegionContext(self, cam):
     def removeDisplayRegionContext(self, cam):
         for drc in self.displayRegionList:
         for drc in self.displayRegionList:
             if drc.cam == cam:
             if drc.cam == cam:

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

@@ -36,7 +36,7 @@ class DirectMySQLdbConnection(Connection):
             client_flag |= CLIENT.MULTI_STATEMENTS
             client_flag |= CLIENT.MULTI_STATEMENTS
         if client_version >= (5, 0):
         if client_version >= (5, 0):
             client_flag |= CLIENT.MULTI_RESULTS
             client_flag |= CLIENT.MULTI_RESULTS
-            
+
         kwargs2['client_flag'] = client_flag
         kwargs2['client_flag'] = client_flag
 
 
         ### DCR: skip over the Connection __init__
         ### DCR: skip over the Connection __init__
@@ -45,7 +45,7 @@ class DirectMySQLdbConnection(Connection):
 
 
         self.encoders = dict([ (k, v) for k, v in conv.items()
         self.encoders = dict([ (k, v) for k, v in conv.items()
                                if type(k) is not int ])
                                if type(k) is not int ])
-        
+
         self._server_version = tuple([ int(n) for n in self.get_server_info().split('.')[:2] ])
         self._server_version = tuple([ int(n) for n in self.get_server_info().split('.')[:2] ])
 
 
         db = proxy(self)
         db = proxy(self)

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

@@ -185,6 +185,6 @@ class Mopath(DirectObject):
             tp = self.calcTime(t)
             tp = self.calcTime(t)
             self.xyzNurbsCurve.getPoint(tp, p)
             self.xyzNurbsCurve.getPoint(tp, p)
             ls.drawTo(p)
             ls.drawTo(p)
-        
+
         return NodePath(ls.create())
         return NodePath(ls.create())
-    
+

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

@@ -112,4 +112,4 @@ if __debug__:
     dc._stopMemLeakCheck()
     dc._stopMemLeakCheck()
     dc.destroy()
     dc.destroy()
     del dc
     del dc
-    
+

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

@@ -14,7 +14,7 @@ class CachedDOData:
     def destroy(self):
     def destroy(self):
         # override and handle this object being destroyed
         # override and handle this object being destroyed
         # this is destruction of this object, not the cached data (see flush)
         # this is destruction of this object, not the cached data (see flush)
-        pass 
+        pass
 
 
     def flush(self):
     def flush(self):
         # override and destroy the cached data
         # override and destroy the cached data

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

@@ -50,7 +50,7 @@ class CartesianGridBase:
         xMax = abs(spherePos[0])+sphereRadius
         xMax = abs(spherePos[0])+sphereRadius
         yMax = abs(spherePos[1])+sphereRadius
         yMax = abs(spherePos[1])+sphereRadius
         sphereRadius = Vec3(xMax,yMax,0).length()
         sphereRadius = Vec3(xMax,yMax,0).length()
-        
+
         # sphereRadius = max(sphereRadius, gridRadius*cellWidth)
         # sphereRadius = max(sphereRadius, gridRadius*cellWidth)
         return max(2 * (sphereRadius // cellWidth), 1)
         return max(2 * (sphereRadius // cellWidth), 1)
 
 

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

@@ -23,7 +23,7 @@ class ClientRepository(ClientRepositoryBase):
     GameGlobalsId = 0
     GameGlobalsId = 0
 
 
     doNotDeallocateChannel = True
     doNotDeallocateChannel = True
-    
+
     def __init__(self, dcFileNames = None, dcSuffix = '', connectMethod = None,
     def __init__(self, dcFileNames = None, dcSuffix = '', connectMethod = None,
                  threadedNet = None):
                  threadedNet = None):
         ClientRepositoryBase.__init__(self, dcFileNames = dcFileNames, dcSuffix = dcSuffix, connectMethod = connectMethod, threadedNet = threadedNet)
         ClientRepositoryBase.__init__(self, dcFileNames = dcFileNames, dcSuffix = dcSuffix, connectMethod = connectMethod, threadedNet = threadedNet)
@@ -168,7 +168,7 @@ class ClientRepository(ClientRepositoryBase):
         on the network or previously passed through
         on the network or previously passed through
         createDistributedObject.)  In either case, the new
         createDistributedObject.)  In either case, the new
         DistributedObject is returned from this method.
         DistributedObject is returned from this method.
-        
+
         This method will issue the appropriate network commands to
         This method will issue the appropriate network commands to
         make this object appear on all of the other clients.
         make this object appear on all of the other clients.
 
 
@@ -195,7 +195,7 @@ class ClientRepository(ClientRepositoryBase):
             doId = self.allocateDoId()
             doId = self.allocateDoId()
         elif reserveDoId:
         elif reserveDoId:
             self.reserveDoId(doId)
             self.reserveDoId(doId)
-            
+
         dclass = self.dclassesByName.get(className)
         dclass = self.dclassesByName.get(className)
         if not dclass:
         if not dclass:
             self.notify.error("Unknown distributed class: %s" % (distObj.__class__))
             self.notify.error("Unknown distributed class: %s" % (distObj.__class__))
@@ -288,13 +288,13 @@ class ClientRepository(ClientRepositoryBase):
     def isLocalId(self, doId):
     def isLocalId(self, doId):
         """ Returns true if this doId is one that we're the owner of,
         """ Returns true if this doId is one that we're the owner of,
         false otherwise. """
         false otherwise. """
-        
+
         return ((doId >= self.doIdBase) and (doId < self.doIdLast))
         return ((doId >= self.doIdBase) and (doId < self.doIdLast))
 
 
     def haveCreateAuthority(self):
     def haveCreateAuthority(self):
         """ Returns true if this client has been assigned a range of
         """ Returns true if this client has been assigned a range of
         doId's it may use to create objects, false otherwise. """
         doId's it may use to create objects, false otherwise. """
-        
+
         return (self.doIdLast > self.doIdBase)
         return (self.doIdLast > self.doIdBase)
 
 
     def getAvatarIdFromSender(self):
     def getAvatarIdFromSender(self):
@@ -418,7 +418,7 @@ class ClientRepository(ClientRepositoryBase):
         # Reformat the packed datagram to change the message type and
         # Reformat the packed datagram to change the message type and
         # add the target id.
         # add the target id.
         dgi.getUint16()
         dgi.getUint16()
-        
+
         dg = PyDatagram()
         dg = PyDatagram()
         dg.addUint16(CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU)
         dg.addUint16(CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU)
         dg.addUint32(channelId & 0xffffffff)
         dg.addUint32(channelId & 0xffffffff)

+ 14 - 14
direct/src/distributed/ClientRepositoryBase.py

@@ -73,7 +73,7 @@ class ClientRepositoryBase(ConnectionRepository):
         self.lastHeartbeat = 0
         self.lastHeartbeat = 0
 
 
         self._delayDeletedDOs = {}
         self._delayDeletedDOs = {}
-        
+
         self.specialNameNumber = 0
         self.specialNameNumber = 0
 
 
     def setDeferInterval(self, deferInterval):
     def setDeferInterval(self, deferInterval):
@@ -103,7 +103,7 @@ class ClientRepositoryBase(ConnectionRepository):
         ## self.send(datagram)
         ## self.send(datagram)
         ## # Make sure the message gets there.
         ## # Make sure the message gets there.
         ## self.flush()
         ## self.flush()
-        
+
     def specialName(self, label):
     def specialName(self, label):
         name = ("SpecialName %s %s" % (self.specialNameNumber, label))
         name = ("SpecialName %s %s" % (self.specialNameNumber, label))
         self.specialNameNumber += 1
         self.specialNameNumber += 1
@@ -205,7 +205,7 @@ class ClientRepositoryBase(ConnectionRepository):
     def doDeferredGenerate(self, task):
     def doDeferredGenerate(self, task):
         """ This is the task that generates an object on the deferred
         """ This is the task that generates an object on the deferred
         queue. """
         queue. """
-        
+
         now = globalClock.getFrameTime()
         now = globalClock.getFrameTime()
         while self.deferredGenerates:
         while self.deferredGenerates:
             if now - self.lastGenerate < self.deferInterval:
             if now - self.lastGenerate < self.deferInterval:
@@ -386,7 +386,7 @@ class ClientRepositoryBase(ConnectionRepository):
             del self.deferredGenerates[i]
             del self.deferredGenerates[i]
             if len(self.deferredGenerates) == 0:
             if len(self.deferredGenerates) == 0:
                 taskMgr.remove('deferredGenerate')
                 taskMgr.remove('deferredGenerate')
-            
+
         else:
         else:
             self._logFailedDisable(doId, ownerView)
             self._logFailedDisable(doId, ownerView)
 
 
@@ -422,7 +422,7 @@ class ClientRepositoryBase(ConnectionRepository):
         doId = di.getUint32()
         doId = di.getUint32()
 
 
         ovUpdated = self.__doUpdateOwner(doId, di)
         ovUpdated = self.__doUpdateOwner(doId, di)
-        
+
         if doId in self.deferredDoIds:
         if doId in self.deferredDoIds:
             # This object hasn't really been generated yet.  Sit on
             # This object hasn't really been generated yet.  Sit on
             # the update.
             # the update.
@@ -436,8 +436,8 @@ class ClientRepositoryBase(ConnectionRepository):
         else:
         else:
             # This object has been fully generated.  It's OK to update.
             # This object has been fully generated.  It's OK to update.
             self.__doUpdate(doId, di, ovUpdated)
             self.__doUpdate(doId, di, ovUpdated)
-            
-            
+
+
     def __doUpdate(self, doId, di, ovUpdated):
     def __doUpdate(self, doId, di, ovUpdated):
         # Find the DO
         # Find the DO
         do = self.doId2do.get(doId)
         do = self.doId2do.get(doId)
@@ -445,9 +445,9 @@ class ClientRepositoryBase(ConnectionRepository):
             # Let the dclass finish the job
             # Let the dclass finish the job
             do.dclass.receiveUpdate(do, di)
             do.dclass.receiveUpdate(do, di)
         elif not ovUpdated:
         elif not ovUpdated:
-            # this next bit is looking for avatar handles so that if you get an update 
-            # for an avatar that isn't in your doId2do table but there is a 
-            # avatar handle for that object then it's messages will be forwarded to that 
+            # this next bit is looking for avatar handles so that if you get an update
+            # for an avatar that isn't in your doId2do table but there is a
+            # avatar handle for that object then it's messages will be forwarded to that
             # object. We are currently using that for whisper echoing
             # object. We are currently using that for whisper echoing
             # if you need a more general perpose system consider registering proxy objects on
             # if you need a more general perpose system consider registering proxy objects on
             # a dict and adding the avatar handles to that dict when they are created
             # a dict and adding the avatar handles to that dict when they are created
@@ -458,14 +458,14 @@ class ClientRepositoryBase(ConnectionRepository):
                 if handle:
                 if handle:
                     dclass = self.dclassesByName[handle.dclassName]
                     dclass = self.dclassesByName[handle.dclassName]
                     dclass.receiveUpdate(handle, di)
                     dclass.receiveUpdate(handle, di)
-                    
+
                 else:
                 else:
                     self.notify.warning(
                     self.notify.warning(
                         "Asked to update non-existent DistObj " + str(doId))
                         "Asked to update non-existent DistObj " + str(doId))
             except:
             except:
                 self.notify.warning(
                 self.notify.warning(
                         "Asked to update non-existent DistObj " + str(doId) + "and failed to find it")
                         "Asked to update non-existent DistObj " + str(doId) + "and failed to find it")
- 
+
     def __doUpdateOwner(self, doId, di):
     def __doUpdateOwner(self, doId, di):
         ovObj = self.doId2ownerView.get(doId)
         ovObj = self.doId2ownerView.get(doId)
         if ovObj:
         if ovObj:
@@ -489,7 +489,7 @@ class ClientRepositoryBase(ConnectionRepository):
             self.bootedText = None
             self.bootedText = None
             self.notify.warning(
             self.notify.warning(
                 "Server is booting us out with no explanation.")
                 "Server is booting us out with no explanation.")
-        
+
         # disconnect now, don't wait for send/recv to fail
         # disconnect now, don't wait for send/recv to fail
         self.stopReaderPollTask()
         self.stopReaderPollTask()
         self.lostConnection()
         self.lostConnection()
@@ -504,7 +504,7 @@ class ClientRepositoryBase(ConnectionRepository):
         message = di.getString()
         message = di.getString()
         self.notify.info('Message from server: %s' % (message))
         self.notify.info('Message from server: %s' % (message))
         return message
         return message
-        
+
     def handleSystemMessageAknowledge(self, di):
     def handleSystemMessageAknowledge(self, di):
         # Got a system message from the server.
         # Got a system message from the server.
         message = di.getString()
         message = di.getString()

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

@@ -192,7 +192,7 @@ class ClockDelta(DirectObject.DirectObject):
         oldUncertainty = self.getUncertainty()
         oldUncertainty = self.getUncertainty()
         if oldUncertainty != None:
         if oldUncertainty != None:
             self.notify.info(
             self.notify.info(
-                'previous delta at %.3f s, +/- %.3f s.' % 
+                'previous delta at %.3f s, +/- %.3f s.' %
                 (self.delta, oldUncertainty))
                 (self.delta, oldUncertainty))
             self.notify.info(
             self.notify.info(
                 'new delta at %.3f s, +/- %.3f s.' %
                 'new delta at %.3f s, +/- %.3f s.' %

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

@@ -13,7 +13,7 @@ import gc
 
 
 
 
 
 
-class ConnectionRepository( 
+class ConnectionRepository(
         DoInterestManager, DoCollectionManager, CConnectionRepository):
         DoInterestManager, DoCollectionManager, CConnectionRepository):
     """
     """
     This is a base class for things that know how to establish a
     This is a base class for things that know how to establish a
@@ -39,7 +39,7 @@ class ConnectionRepository(
         if threadedNet is None:
         if threadedNet is None:
             # Default value.
             # Default value.
             threadedNet = config.GetBool('threaded-net', False)
             threadedNet = config.GetBool('threaded-net', False)
-            
+
         # let the C connection repository know whether we're supporting
         # let the C connection repository know whether we're supporting
         # 'owner' views of distributed objects (i.e. 'receives ownrecv',
         # 'owner' views of distributed objects (i.e. 'receives ownrecv',
         # 'I own this object and have a separate view of it regardless of
         # 'I own this object and have a separate view of it regardless of
@@ -60,7 +60,7 @@ class ConnectionRepository(
         # events in the main thread, instead of within the network
         # events in the main thread, instead of within the network
         # thread (if there is one).
         # thread (if there is one).
         self.accept(self._getLostConnectionEvent(), self.lostConnection)
         self.accept(self._getLostConnectionEvent(), self.lostConnection)
-        
+
         self.config = config
         self.config = config
 
 
         if self.config.GetBool('verbose-repository'):
         if self.config.GetBool('verbose-repository'):
@@ -103,7 +103,7 @@ class ConnectionRepository(
             self.notify.info("Using connect method 'net'")
             self.notify.info("Using connect method 'net'")
         elif self.connectMethod == self.CM_NATIVE:
         elif self.connectMethod == self.CM_NATIVE:
             self.notify.info("Using connect method 'native'")
             self.notify.info("Using connect method 'native'")
-        
+
         self.connectHttp = None
         self.connectHttp = None
         self.http = None
         self.http = None
 
 
@@ -134,7 +134,7 @@ class ConnectionRepository(
             # periodically increase gc threshold if there is no garbage
             # periodically increase gc threshold if there is no garbage
             taskMgr.doMethodLater(self.config.GetFloat('garbage-threshold-adjust-delay', 5 * 60.),
             taskMgr.doMethodLater(self.config.GetFloat('garbage-threshold-adjust-delay', 5 * 60.),
                                   self._adjustGcThreshold, self.GarbageThresholdTaskName)
                                   self._adjustGcThreshold, self.GarbageThresholdTaskName)
-            
+
         self._gcDefaultThreshold = gc.get_threshold()
         self._gcDefaultThreshold = gc.get_threshold()
 
 
     def _getLostConnectionEvent(self):
     def _getLostConnectionEvent(self):

+ 20 - 20
direct/src/distributed/DistributedCamera.py

@@ -1,5 +1,5 @@
 from pandac.PandaModules import *
 from pandac.PandaModules import *
-from direct.fsm.FSM import FSM 
+from direct.fsm.FSM import FSM
 from direct.interval.IntervalGlobal import *
 from direct.interval.IntervalGlobal import *
 from direct.distributed.DistributedObject import DistributedObject
 from direct.distributed.DistributedObject import DistributedObject
 
 
@@ -10,7 +10,7 @@ class Fixture(NodePath, FSM):
         self.id = id
         self.id = id
         self.lens = PerspectiveLens()
         self.lens = PerspectiveLens()
         self.lens.setFov(base.camLens.getFov())
         self.lens.setFov(base.camLens.getFov())
-        
+
         model = loader.loadModel('models/misc/camera', okMissing = True)
         model = loader.loadModel('models/misc/camera', okMissing = True)
         model.reparentTo(self)
         model.reparentTo(self)
 
 
@@ -46,17 +46,17 @@ class Fixture(NodePath, FSM):
         fov = self.lens.getFov()
         fov = self.lens.getFov()
         self.lens.setFov(fov[0]+x, fov[1]+y)
         self.lens.setFov(fov[0]+x, fov[1]+y)
         self.dirty = True
         self.dirty = True
-    
+
     def getFov(self):
     def getFov(self):
         return self.lens.getFov()
         return self.lens.getFov()
-    
+
     def setupFrustum(self):
     def setupFrustum(self):
         oldFrustum = self.find('frustum')
         oldFrustum = self.find('frustum')
         if oldFrustum:
         if oldFrustum:
             oldFrustum.detachNode()
             oldFrustum.detachNode()
-        
+
         self.attachNewNode(GeomNode('frustum')).node().addGeom(self.lens.makeGeometry())
         self.attachNewNode(GeomNode('frustum')).node().addGeom(self.lens.makeGeometry())
-        
+
     def setRecordingInProgress(self, inProgress):
     def setRecordingInProgress(self, inProgress):
         self.recordingInProgress = inProgress
         self.recordingInProgress = inProgress
         if self.recordingInProgress and \
         if self.recordingInProgress and \
@@ -64,7 +64,7 @@ class Fixture(NodePath, FSM):
             self.hide()
             self.hide()
         else:
         else:
             self.show()
             self.show()
-        
+
     def show(self):
     def show(self):
         if base.config.GetBool('aware-of-cameras',0) and \
         if base.config.GetBool('aware-of-cameras',0) and \
            not self.recordingInProgress:
            not self.recordingInProgress:
@@ -75,7 +75,7 @@ class Fixture(NodePath, FSM):
             self.scaleIval = Sequence(LerpScaleInterval(self.getChild(0), 0.25, 2, startScale = 1, blendType = 'easeInOut'),
             self.scaleIval = Sequence(LerpScaleInterval(self.getChild(0), 0.25, 2, startScale = 1, blendType = 'easeInOut'),
                                       LerpScaleInterval(self.getChild(0), 0.25, 1, startScale = 2, blendType = 'easeInOut'))
                                       LerpScaleInterval(self.getChild(0), 0.25, 1, startScale = 2, blendType = 'easeInOut'))
         return self.scaleIval
         return self.scaleIval
-    
+
     def setState(self, state):
     def setState(self, state):
         self.request(state)
         self.request(state)
 
 
@@ -95,7 +95,7 @@ class Fixture(NodePath, FSM):
             self.scaleIval = None
             self.scaleIval = None
 
 
         self.hide()
         self.hide()
-        
+
     def enterStandby(self):
     def enterStandby(self):
         self.show()
         self.show()
         if self.id == base.config.GetInt('camera-id', -1):
         if self.id == base.config.GetInt('camera-id', -1):
@@ -104,7 +104,7 @@ class Fixture(NodePath, FSM):
         else:
         else:
             self.setColorScale(3,3,0,1)
             self.setColorScale(3,3,0,1)
             self.getScaleIval().finish()
             self.getScaleIval().finish()
-    
+
     def enterBlinking(self):
     def enterBlinking(self):
         self.show()
         self.show()
         self.setColorScale(0,3,0,1)
         self.setColorScale(0,3,0,1)
@@ -150,8 +150,8 @@ class Fixture(NodePath, FSM):
         lodNodes = render.findAllMatches('**/+LODNode')
         lodNodes = render.findAllMatches('**/+LODNode')
         for i in xrange(0,lodNodes.getNumPaths()):
         for i in xrange(0,lodNodes.getNumPaths()):
             lodNodes[i].node().forceSwitch(lodNodes[i].node().getHighestSwitch())
             lodNodes[i].node().forceSwitch(lodNodes[i].node().getHighestSwitch())
-    
-    
+
+
     def exitUsing(self):
     def exitUsing(self):
         self.ignore('arrow_left')
         self.ignore('arrow_left')
         self.ignore('arrow_left-repeat')
         self.ignore('arrow_left-repeat')
@@ -169,7 +169,7 @@ class Fixture(NodePath, FSM):
         if self.dirty:
         if self.dirty:
             messenger.send('refresh-fixture', [self.id, self.pack()])
             messenger.send('refresh-fixture', [self.id, self.pack()])
             self.dirty = False
             self.dirty = False
-    
+
 
 
 class DistributedCamera(DistributedObject):
 class DistributedCamera(DistributedObject):
     def __init__(self, cr):
     def __init__(self, cr):
@@ -192,17 +192,17 @@ class DistributedCamera(DistributedObject):
         for fixture in self.fixtures.itervalues():
         for fixture in self.fixtures.itervalues():
             out = '%s\n%s' % (out, fixture.pack())
             out = '%s\n%s' % (out, fixture.pack())
         return out[1:]
         return out[1:]
-            
+
     def disable(self):
     def disable(self):
         self.ignore('escape')
         self.ignore('escape')
-        
+
         self.parent = None
         self.parent = None
-        
+
         for fixture in self.fixtures.itervalues():
         for fixture in self.fixtures.itervalues():
             fixture.cleanup()
             fixture.cleanup()
             fixture.detachNode()
             fixture.detachNode()
         self.fixtures = {}
         self.fixtures = {}
-        
+
         DistributedObject.disable(self)
         DistributedObject.disable(self)
 
 
     def getOV(self):
     def getOV(self):
@@ -220,7 +220,7 @@ class DistributedCamera(DistributedObject):
 
 
     def getCamParent(self):
     def getCamParent(self):
         return self.parent
         return self.parent
-    
+
     def setFixtures(self, fixtures):
     def setFixtures(self, fixtures):
         for x in range(len(fixtures), len(self.fixtures)):
         for x in range(len(fixtures), len(self.fixtures)):
             fixture = self.fixtures.pop(x)
             fixture = self.fixtures.pop(x)
@@ -236,14 +236,14 @@ class DistributedCamera(DistributedObject):
 
 
             if x not in self.fixtures:
             if x not in self.fixtures:
                 self.fixtures[x] = Fixture(x, self.parent, Point3(0), hpr = Point3(0), fov = VBase2(0))
                 self.fixtures[x] = Fixture(x, self.parent, Point3(0), hpr = Point3(0), fov = VBase2(0))
-            
+
             fix = self.fixtures.get(x)
             fix = self.fixtures.get(x)
             fix.setId(x)
             fix.setId(x)
             fix.setPosHpr(pos,hpr)
             fix.setPosHpr(pos,hpr)
             fix.setState(state)
             fix.setState(state)
             fix.setFov(fov)
             fix.setFov(fov)
             recordingInProgress |= state == 'Recording'
             recordingInProgress |= state == 'Recording'
-        
+
         messenger.send('recordingInProgress', [recordingInProgress])
         messenger.send('recordingInProgress', [recordingInProgress])
 
 
     def testFixture(self, index):
     def testFixture(self, index):

+ 6 - 6
direct/src/distributed/DistributedCameraOV.py

@@ -12,13 +12,13 @@ class DistributedCameraOV(DistributedObjectOV):
         self.ignore('escape')
         self.ignore('escape')
         self.ignore('refresh-fixture')
         self.ignore('refresh-fixture')
         DistributedObjectOV.delete(self)
         DistributedObjectOV.delete(self)
-        
+
     def getObject(self):
     def getObject(self):
         return self.cr.getDo(self.getDoId())
         return self.cr.getDo(self.getDoId())
-        
+
     def setCamParent(self, doId):
     def setCamParent(self, doId):
         self.parent = doId
         self.parent = doId
-    
+
     def setFixtures(self, fixtures):
     def setFixtures(self, fixtures):
         self.fixtures = fixtures
         self.fixtures = fixtures
 
 
@@ -31,7 +31,7 @@ class DistributedCameraOV(DistributedObjectOV):
         data = data.strip().replace('Camera','')
         data = data.strip().replace('Camera','')
         pos,hpr,fov = eval(data)
         pos,hpr,fov = eval(data)
         return pos,hpr,fov
         return pos,hpr,fov
-    
+
     def loadFromFile(self, name):
     def loadFromFile(self, name):
         self.b_setFixtures([])
         self.b_setFixtures([])
         f = file('cameras-%s.txt' % name, 'r');
         f = file('cameras-%s.txt' % name, 'r');
@@ -53,7 +53,7 @@ class DistributedCameraOV(DistributedObjectOV):
 
 
         # distributed only
         # distributed only
         self.d_setFixtures(self.fixtures)
         self.d_setFixtures(self.fixtures)
-        
+
     def b_setFixtures(self, fixtures):
     def b_setFixtures(self, fixtures):
         self.getObject().setFixtures(fixtures)
         self.getObject().setFixtures(fixtures)
         self.setFixtures(fixtures)
         self.setFixtures(fixtures)
@@ -101,7 +101,7 @@ class DistributedCameraOV(DistributedObjectOV):
                                 hpr[0], hpr[1], hpr[2],
                                 hpr[0], hpr[1], hpr[2],
                                 'Standby'],
                                 'Standby'],
                                index)
                                index)
-    
+
     def startRecording(self):
     def startRecording(self):
         self.accept('escape', self.stopRecording)
         self.accept('escape', self.stopRecording)
         for fixture in self.fixtures:
         for fixture in self.fixtures:

+ 11 - 11
direct/src/distributed/DistributedCartesianGrid.py

@@ -24,7 +24,7 @@ GRID_Z_OFFSET = 0.0
 class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
 class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
     notify = directNotify.newCategory("DistributedCartesianGrid")
     notify = directNotify.newCategory("DistributedCartesianGrid")
     notify.setDebug(0)
     notify.setDebug(0)
-    
+
     VisualizeGrid = ConfigVariableBool("visualize-cartesian-grid", False)
     VisualizeGrid = ConfigVariableBool("visualize-cartesian-grid", False)
 
 
     RuleSeparator = ":"
     RuleSeparator = ":"
@@ -102,14 +102,14 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
         if child.gridParent:
         if child.gridParent:
             child.gridParent.delete()
             child.gridParent.delete()
             child.gridParent = None
             child.gridParent = None
-            
+
     @report(types = ['deltaStamp', 'avLocation', 'args'], dConfigParam = ['connector','shipboard'])
     @report(types = ['deltaStamp', 'avLocation', 'args'], dConfigParam = ['connector','shipboard'])
     def startProcessVisibility(self, avatar):
     def startProcessVisibility(self, avatar):
         if not self._onOffState:
         if not self._onOffState:
             # if we've been told that we're OFF, don't try
             # if we've been told that we're OFF, don't try
             # to process visibilty
             # to process visibilty
             return
             return
-        
+
         assert not self.cr._noNewInterests
         assert not self.cr._noNewInterests
         if self.cr.noNewInterests():
         if self.cr.noNewInterests():
             self.notify.warning(
             self.notify.warning(
@@ -168,7 +168,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
             return Task.done
             return Task.done
         if self.visAvatar.gameFSM.state == 'Cutscene':
         if self.visAvatar.gameFSM.state == 'Cutscene':
             return Task.cont
             return Task.cont
-        
+
         pos = self.visAvatar.getPos(self)
         pos = self.visAvatar.getPos(self)
         # Check to make sure our x and y are positive
         # Check to make sure our x and y are positive
         dx = self.cellWidth * self.gridSize * .5
         dx = self.cellWidth * self.gridSize * .5
@@ -211,14 +211,14 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
                 assert self.notify.debug(
                 assert self.notify.debug(
                     "processVisibility: %s: altering interest to zoneId: %s" %
                     "processVisibility: %s: altering interest to zoneId: %s" %
                     (self.doId, zoneId))
                     (self.doId, zoneId))
-                
+
                 event = None
                 event = None
                 if self.visDirty:
                 if self.visDirty:
-                    event = self.uniqueName("visibility")                    
+                    event = self.uniqueName("visibility")
                 self.cr.alterInterest(
                 self.cr.alterInterest(
                     self.gridVisContext, self.getDoId(), self.visZone,
                     self.gridVisContext, self.getDoId(), self.visZone,
                     event = event)
                     event = event)
-                
+
                 # If the visAvatar is parented to this grid, also do a
                 # If the visAvatar is parented to this grid, also do a
                 # setLocation
                 # setLocation
                 parentId = self.visAvatar.parentId
                 parentId = self.visAvatar.parentId
@@ -236,7 +236,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
             return Task.cont
             return Task.cont
 
 
     # Update our location based on our avatar's position on the grid
     # Update our location based on our avatar's position on the grid
-    # Assumes our position is correct, relative to the grid    
+    # Assumes our position is correct, relative to the grid
     def addObjectToGrid(self, av):
     def addObjectToGrid(self, av):
         assert self.notify.debug("addObjectToGrid %s" % av)
         assert self.notify.debug("addObjectToGrid %s" % av)
         # Get our pos relative to the island grid
         # Get our pos relative to the island grid
@@ -273,12 +273,12 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
     def turnOff(self):
     def turnOff(self):
         self._onOffState = False
         self._onOffState = False
         self.stopProcessVisibility()
         self.stopProcessVisibility()
-        
+
     def turnOn(self, av = None):
     def turnOn(self, av = None):
         self._onOffState = True
         self._onOffState = True
         if av:
         if av:
             self.startProcessVisibility(av)
             self.startProcessVisibility(av)
-        
+
     ##################################################
     ##################################################
     # Visualization Tools
     # Visualization Tools
     ##################################################
     ##################################################
@@ -416,6 +416,6 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
 
 
     def setWorldContext(self, worldContext):
     def setWorldContext(self, worldContext):
         pass
         pass
-    
+
     def clearWorldContext(self, event = None):
     def clearWorldContext(self, event = None):
         pass
         pass

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

@@ -34,7 +34,7 @@ class DistributedCartesianGridAI(DistributedNodeAI, CartesianGridBase):
 
 
     def getCellWidth(self):
     def getCellWidth(self):
         return self.cellWidth
         return self.cellWidth
-    
+
     def getParentingRules(self):
     def getParentingRules(self):
         self.notify.debug("calling getter")
         self.notify.debug("calling getter")
         rule = ("%i%s%i%s%i" % (self.startingZone, self.RuleSeparator,
         rule = ("%i%s%i%s%i" % (self.startingZone, self.RuleSeparator,
@@ -127,7 +127,7 @@ class DistributedCartesianGridAI(DistributedNodeAI, CartesianGridBase):
 
 
         if not self.isValidZone(zoneId):
         if not self.isValidZone(zoneId):
             self.notify.warning(
             self.notify.warning(
-                "%s handleAvatarZoneChange %s: not a valid zone (%s) for pos %s" %(self.doId, av.doId, zoneId, pos))                     
+                "%s handleAvatarZoneChange %s: not a valid zone (%s) for pos %s" %(self.doId, av.doId, zoneId, pos))
             return
             return
 
 
         # Set the location on the server.
         # Set the location on the server.

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

@@ -326,12 +326,12 @@ class DistributedObject(DistributedObjectBase):
 
 
 
 
     #This message was moved out of announce generate
     #This message was moved out of announce generate
-    #to avoid ordering issues.  
+    #to avoid ordering issues.
     def postGenerateMessage(self):
     def postGenerateMessage(self):
         if self.activeState != ESGenerated:
         if self.activeState != ESGenerated:
             self.activeState = ESGenerated
             self.activeState = ESGenerated
             messenger.send(self.uniqueName("generate"), [self])
             messenger.send(self.uniqueName("generate"), [self])
-            
+
     def updateRequiredFields(self, dclass, di):
     def updateRequiredFields(self, dclass, di):
         dclass.receiveUpdateBroadcastRequired(self, di)
         dclass.receiveUpdateBroadcastRequired(self, di)
         self.announceGenerate()
         self.announceGenerate()
@@ -341,7 +341,7 @@ class DistributedObject(DistributedObjectBase):
         dclass.receiveUpdateAllRequired(self, di)
         dclass.receiveUpdateAllRequired(self, di)
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
     def updateRequiredOtherFields(self, dclass, di):
     def updateRequiredOtherFields(self, dclass, di):
         # First, update the required fields
         # First, update the required fields
         dclass.receiveUpdateBroadcastRequired(self, di)
         dclass.receiveUpdateBroadcastRequired(self, di)
@@ -350,7 +350,7 @@ class DistributedObject(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def sendUpdate(self, fieldName, args = [], sendToId = None):
     def sendUpdate(self, fieldName, args = [], sendToId = None):

+ 8 - 8
direct/src/distributed/DistributedObjectAI.py

@@ -242,13 +242,13 @@ class DistributedObjectAI(DistributedObjectBase):
 
 
     def postGenerateMessage(self):
     def postGenerateMessage(self):
         self.__generated = True
         self.__generated = True
-        messenger.send(self.uniqueName("generate"), [self])        
+        messenger.send(self.uniqueName("generate"), [self])
 
 
     def updateRequiredFields(self, dclass, di):
     def updateRequiredFields(self, dclass, di):
         dclass.receiveUpdateBroadcastRequired(self, di)
         dclass.receiveUpdateBroadcastRequired(self, di)
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
     def updateAllRequiredFields(self, dclass, di):
     def updateAllRequiredFields(self, dclass, di):
         dclass.receiveUpdateAllRequired(self, di)
         dclass.receiveUpdateAllRequired(self, di)
         self.announceGenerate()
         self.announceGenerate()
@@ -260,7 +260,7 @@ class DistributedObjectAI(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def updateAllRequiredOtherFields(self, dclass, di):
     def updateAllRequiredOtherFields(self, dclass, di):
@@ -269,7 +269,7 @@ class DistributedObjectAI(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def sendSetZone(self, zoneId):
     def sendSetZone(self, zoneId):
@@ -387,7 +387,7 @@ class DistributedObjectAI(DistributedObjectBase):
         self.generate()
         self.generate()
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
     # this is a special generate used for estates, or anything else that
     # this is a special generate used for estates, or anything else that
     # needs to have a hard coded doId as assigned by the server
     # needs to have a hard coded doId as assigned by the server
     def generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields=[]):
     def generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields=[]):
@@ -402,7 +402,7 @@ class DistributedObjectAI(DistributedObjectBase):
         self.generate()
         self.generate()
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
     def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
     def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
         # have we already allocated a doId?
         # have we already allocated a doId?
@@ -574,8 +574,8 @@ class DistributedObjectAI(DistributedObjectBase):
 
 
     def execCommand(self, string, mwMgrId, avId, zoneId):
     def execCommand(self, string, mwMgrId, avId, zoneId):
         pass
         pass
-    
+
     def _retrieveCachedData(self):
     def _retrieveCachedData(self):
         """ This is a no-op on the AI. """
         """ This is a no-op on the AI. """
         pass
         pass
-    
+

+ 5 - 5
direct/src/distributed/DistributedObjectGlobalAI.py

@@ -9,17 +9,17 @@ class DistributedObjectGlobalAI(DistributedObjectAI):
     doNotDeallocateChannel = 1
     doNotDeallocateChannel = 1
     isGlobalDistObj = 1
     isGlobalDistObj = 1
 
 
-    def __init__(self, air): 
+    def __init__(self, air):
         DistributedObjectAI.__init__(self, air)
         DistributedObjectAI.__init__(self, air)
 
 
     def announceGenerate(self):
     def announceGenerate(self):
         DistributedObjectAI.announceGenerate(self)
         DistributedObjectAI.announceGenerate(self)
         try:
         try:
             if not self.doNotListenToChannel:
             if not self.doNotListenToChannel:
-                self.air.registerForChannel(self.doId)            
+                self.air.registerForChannel(self.doId)
         except AttributeError:
         except AttributeError:
-                self.air.registerForChannel(self.doId)            
-        return False        
+                self.air.registerForChannel(self.doId)
+        return False
 
 
     def delete(self):
     def delete(self):
        DistributedObjectAI.delete(self)
        DistributedObjectAI.delete(self)
@@ -29,4 +29,4 @@ class DistributedObjectGlobalAI(DistributedObjectAI):
        except AttributeError:
        except AttributeError:
            self.air.unregisterForChannel(self.doId)
            self.air.unregisterForChannel(self.doId)
         ## self.air.removeDOFromTables(self)
         ## self.air.removeDOFromTables(self)
- 
+

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

@@ -14,11 +14,11 @@ class DistributedObjectGlobalUD(DistributedObjectUD):
     def __init__(self, air):
     def __init__(self, air):
         DistributedObjectUD.__init__(self, air)
         DistributedObjectUD.__init__(self, air)
         self.ExecNamespace = {"self":self}
         self.ExecNamespace = {"self":self}
-    
+
     def announceGenerate(self):
     def announceGenerate(self):
         self.air.registerForChannel(self.doId)
         self.air.registerForChannel(self.doId)
         DistributedObjectUD.announceGenerate(self)
         DistributedObjectUD.announceGenerate(self)
-    
+
     def delete(self):
     def delete(self):
         self.air.unregisterForChannel(self.doId)
         self.air.unregisterForChannel(self.doId)
         ## self.air.removeDOFromTables(self)
         ## self.air.removeDOFromTables(self)
@@ -26,7 +26,7 @@ class DistributedObjectGlobalUD(DistributedObjectUD):
 
 
     def execCommand(self, command, mwMgrId, avId, zoneId):
     def execCommand(self, command, mwMgrId, avId, zoneId):
         text = str(self.__execMessage(command))[:config.GetInt("ai-debug-length",300)]
         text = str(self.__execMessage(command))[:config.GetInt("ai-debug-length",300)]
-        
+
         dclass = uber.air.dclassesByName.get("PiratesMagicWordManagerAI")
         dclass = uber.air.dclassesByName.get("PiratesMagicWordManagerAI")
         dg = dclass.aiFormatUpdate(
         dg = dclass.aiFormatUpdate(
             "setMagicWordResponse", mwMgrId, (1<<32)+avId, uber.air.ourChannel, [text])
             "setMagicWordResponse", mwMgrId, (1<<32)+avId, uber.air.ourChannel, [text])

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

@@ -169,7 +169,7 @@ class DistributedObjectOV(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def getCacheable(self):
     def getCacheable(self):

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

@@ -213,7 +213,7 @@ class DistributedObjectUD(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def updateAllRequiredOtherFields(self, dclass, di):
     def updateAllRequiredOtherFields(self, dclass, di):
@@ -222,7 +222,7 @@ class DistributedObjectUD(DistributedObjectBase):
         # but before we update the non-required fields.
         # but before we update the non-required fields.
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
         dclass.receiveUpdateOther(self, di)
         dclass.receiveUpdateOther(self, di)
 
 
     def sendSetZone(self, zoneId):
     def sendSetZone(self, zoneId):
@@ -233,7 +233,7 @@ class DistributedObjectUD(DistributedObjectBase):
         # arguments are newZoneId, oldZoneId
         # arguments are newZoneId, oldZoneId
         # includes the quiet zone.
         # includes the quiet zone.
         return 'DOChangeZone-%s' % self.doId
         return 'DOChangeZone-%s' % self.doId
-    
+
     def getLogicalZoneChangeEvent(self):
     def getLogicalZoneChangeEvent(self):
         # this event is generated whenever this object changes to a
         # this event is generated whenever this object changes to a
         # non-quiet-zone zone.
         # non-quiet-zone zone.
@@ -324,7 +324,7 @@ class DistributedObjectUD(DistributedObjectBase):
         self.generate()
         self.generate()
         self.announceGenerate()
         self.announceGenerate()
         self.postGenerateMessage()
         self.postGenerateMessage()
-        
+
     def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
     def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
         # have we already allocated a doId?
         # have we already allocated a doId?

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

@@ -113,7 +113,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
         to specialize the behavior.
         to specialize the behavior.
         """
         """
         self.smoother.computeAndApplySmoothPosHpr(self, self)
         self.smoother.computeAndApplySmoothPosHpr(self, self)
-            
+
     def doSmoothTask(self, task):
     def doSmoothTask(self, task):
         self.smoothPosition()
         self.smoothPosition()
         return cont
         return cont
@@ -205,7 +205,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
                 self.smoother.markPosition()
                 self.smoother.markPosition()
 
 
         self.stopped = False
         self.stopped = False
-        
+
     # distributed set pos and hpr functions
     # distributed set pos and hpr functions
     # 'send' versions are inherited from DistributedSmoothNodeBase
     # 'send' versions are inherited from DistributedSmoothNodeBase
     def setSmStop(self, timestamp=None):
     def setSmStop(self, timestamp=None):
@@ -398,7 +398,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
         return self.getR()
         return self.getR()
     def getComponentT(self):
     def getComponentT(self):
         return 0
         return 0
-                
+
     @report(types = ['args'], dConfigParam = 'smoothnode')
     @report(types = ['args'], dConfigParam = 'smoothnode')
     def clearSmoothing(self, bogus = None):
     def clearSmoothing(self, bogus = None):
         # Call this to invalidate all the old position reports
         # Call this to invalidate all the old position reports
@@ -442,7 +442,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
         self.sendUpdate("suggestResync", [avId, timestampA, timestampB,
         self.sendUpdate("suggestResync", [avId, timestampA, timestampB,
                                           serverTimeSec, serverTimeUSec,
                                           serverTimeSec, serverTimeUSec,
                                           uncertainty])
                                           uncertainty])
-        
+
     def suggestResync(self, avId, timestampA, timestampB,
     def suggestResync(self, avId, timestampA, timestampB,
                       serverTimeSec, serverTimeUSec, uncertainty):
                       serverTimeSec, serverTimeUSec, uncertainty):
         """
         """
@@ -471,14 +471,14 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
                     self.cr.localAvatarDoId, timestampB,
                     self.cr.localAvatarDoId, timestampB,
                     serverTime,
                     serverTime,
                     globalClockDelta.getUncertainty())
                     globalClockDelta.getUncertainty())
-        
+
 
 
     def d_returnResync(self, avId, timestampB, serverTime, uncertainty):
     def d_returnResync(self, avId, timestampB, serverTime, uncertainty):
         serverTimeSec = math.floor(serverTime)
         serverTimeSec = math.floor(serverTime)
         serverTimeUSec = (serverTime - serverTimeSec) * 10000.0
         serverTimeUSec = (serverTime - serverTimeSec) * 10000.0
         self.sendUpdate("returnResync", [
         self.sendUpdate("returnResync", [
             avId, timestampB, serverTimeSec, serverTimeUSec, uncertainty])
             avId, timestampB, serverTimeSec, serverTimeUSec, uncertainty])
-        
+
     def returnResync(self, avId, timestampB, serverTimeSec, serverTimeUSec,
     def returnResync(self, avId, timestampB, serverTimeSec, serverTimeUSec,
             uncertainty):
             uncertainty):
         """
         """

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

@@ -9,7 +9,7 @@ class DummyTaskClass:
         pass
         pass
 
 
 DummyTask = DummyTaskClass()
 DummyTask = DummyTaskClass()
-    
+
 class DistributedSmoothNodeBase:
 class DistributedSmoothNodeBase:
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI
     """
     """
@@ -65,7 +65,7 @@ class DistributedSmoothNodeBase:
     def startPosHprBroadcast(self, period=.2, stagger=0, type=None):
     def startPosHprBroadcast(self, period=.2, stagger=0, type=None):
         if self.cnode == None:
         if self.cnode == None:
             self.initializeCnode()
             self.initializeCnode()
-        
+
         BT = DistributedSmoothNodeBase.BroadcastTypes
         BT = DistributedSmoothNodeBase.BroadcastTypes
         if type is None:
         if type is None:
             type = BT.FULL
             type = BT.FULL
@@ -79,7 +79,7 @@ class DistributedSmoothNodeBase:
             }
             }
         # this comment is here so it will show up in a grep for 'def d_broadcastPosHpr'
         # this comment is here so it will show up in a grep for 'def d_broadcastPosHpr'
         self.d_broadcastPosHpr = broadcastFuncs[self.broadcastType]
         self.d_broadcastPosHpr = broadcastFuncs[self.broadcastType]
-        
+
         # Set stagger to non-zero to randomly delay the initial task execution
         # Set stagger to non-zero to randomly delay the initial task execution
         # over 'period' seconds, to spread out task processing over time
         # over 'period' seconds, to spread out task processing over time
         # when a large number of SmoothNodes are created simultaneously.
         # when a large number of SmoothNodes are created simultaneously.

+ 7 - 7
direct/src/distributed/DoCollectionManager.py

@@ -79,10 +79,10 @@ class DoCollectionManager:
             if re.search(str,repr(value)):
             if re.search(str,repr(value)):
                 matches.append(value)
                 matches.append(value)
         return matches
         return matches
-        
+
     def doFindAllOfType(self, query):
     def doFindAllOfType(self, query):
         """
         """
-        Useful method for searching through the Distributed Object collection 
+        Useful method for searching through the Distributed Object collection
         for objects of a particular type
         for objects of a particular type
         """
         """
         matches = []
         matches = []
@@ -185,7 +185,7 @@ class DoCollectionManager:
             strToReturn = '%s\n== doId2ownerView\n' % (strToReturn)
             strToReturn = '%s\n== doId2ownerView\n' % (strToReturn)
             strToReturn = '%s%s' % (strToReturn, self._returnObjects(self.getDoTable(ownerView=False)))
             strToReturn = '%s%s' % (strToReturn, self._returnObjects(self.getDoTable(ownerView=False)))
         return strToReturn
         return strToReturn
-        
+
 
 
     def printObjectCount(self):
     def printObjectCount(self):
         # print object counts by distributed object type
         # print object counts by distributed object type
@@ -220,7 +220,7 @@ class DoCollectionManager:
     def hasOwnerViewDoId(self, doId):
     def hasOwnerViewDoId(self, doId):
         assert self.hasOwnerView()
         assert self.hasOwnerView()
         return doId in self.doId2ownerView
         return doId in self.doId2ownerView
-    
+
     def getOwnerViewDoList(self, classType):
     def getOwnerViewDoList(self, classType):
         assert self.hasOwnerView()
         assert self.hasOwnerView()
         l = []
         l = []
@@ -295,7 +295,7 @@ class DoCollectionManager:
                 (doId, parentId, zoneId))
                 (doId, parentId, zoneId))
             # Let the object finish the job
             # Let the object finish the job
             # calls storeObjectLocation()
             # calls storeObjectLocation()
-            obj.setLocation(parentId, zoneId) 
+            obj.setLocation(parentId, zoneId)
         else:
         else:
             self.notify.warning(
             self.notify.warning(
                 "handleObjectLocation: Asked to update non-existent obj: %s" % (doId))
                 "handleObjectLocation: Asked to update non-existent obj: %s" % (doId))
@@ -322,7 +322,7 @@ class DoCollectionManager:
             if oldParentObj is not None:
             if oldParentObj is not None:
                 oldParentObj.handleChildLeave(object, oldZoneId)
                 oldParentObj.handleChildLeave(object, oldZoneId)
             self.deleteObjectLocation(object, oldParentId, oldZoneId)
             self.deleteObjectLocation(object, oldParentId, oldZoneId)
-            
+
         elif (oldZoneId != zoneId):
         elif (oldZoneId != zoneId):
             # Remove old location
             # Remove old location
             oldParentObj = self.doId2do.get(oldParentId)
             oldParentObj = self.doId2do.get(oldParentId)
@@ -367,7 +367,7 @@ class DoCollectionManager:
             elif parentId not in (None, 0, self.getGameDoId()):
             elif parentId not in (None, 0, self.getGameDoId()):
                 self.notify.warning('storeObjectLocation(%s): parent %s not present' %
                 self.notify.warning('storeObjectLocation(%s): parent %s not present' %
                                     (object.doId, parentId))
                                     (object.doId, parentId))
-            
+
     def deleteObjectLocation(self, object, parentId, zoneId):
     def deleteObjectLocation(self, object, parentId, zoneId):
         # Do not worry about null values
         # Do not worry about null values
         if ((parentId is None) or (zoneId is None) or
         if ((parentId is None) or (zoneId is None) or

+ 9 - 9
direct/src/distributed/DoInterestManager.py

@@ -173,14 +173,14 @@ class DoInterestManager(DirectObject.DirectObject):
                         'addInterest: no setParentingRules defined in the DC for object %s (%s)'
                         'addInterest: no setParentingRules defined in the DC for object %s (%s)'
                         '' % (parentId, parent.__class__.__name__))
                         '' % (parentId, parent.__class__.__name__))
 
 
-                    
-        
+
+
         if event:
         if event:
             contextId = self._getNextContextId()
             contextId = self._getNextContextId()
         else:
         else:
             contextId = 0
             contextId = 0
             # event = self._getAnonymousEvent('addInterest')
             # event = self._getAnonymousEvent('addInterest')
-            
+
         DoInterestManager._interests[handle] = InterestState(
         DoInterestManager._interests[handle] = InterestState(
             description, InterestState.StateActive, contextId, event, parentId, zoneIdList, self._completeEventCount)
             description, InterestState.StateActive, contextId, event, parentId, zoneIdList, self._completeEventCount)
         if self.__verbose():
         if self.__verbose():
@@ -273,7 +273,7 @@ class DoInterestManager(DirectObject.DirectObject):
                 "removeInterest: handle not found: %s" % (handle))
                 "removeInterest: handle not found: %s" % (handle))
         assert self.printInterestsIfDebug()
         assert self.printInterestsIfDebug()
         return existed
         return existed
-    
+
     def removeAutoInterest(self, handle):
     def removeAutoInterest(self, handle):
         """
         """
         Stop looking in a (set of) zone(s)
         Stop looking in a (set of) zone(s)
@@ -352,7 +352,7 @@ class DoInterestManager(DirectObject.DirectObject):
 
 
             contextId = self._getNextContextId()
             contextId = self._getNextContextId()
             DoInterestManager._interests[handle].context = contextId
             DoInterestManager._interests[handle].context = contextId
-            DoInterestManager._interests[handle].parentId = parentId            
+            DoInterestManager._interests[handle].parentId = parentId
             DoInterestManager._interests[handle].zoneIdList = zoneIdList
             DoInterestManager._interests[handle].zoneIdList = zoneIdList
             DoInterestManager._interests[handle].addEvent(event)
             DoInterestManager._interests[handle].addEvent(event)
 
 
@@ -421,7 +421,7 @@ class DoInterestManager(DirectObject.DirectObject):
         Consider whether we should cull the interest set.
         Consider whether we should cull the interest set.
         """
         """
         assert DoInterestManager.notify.debugCall()
         assert DoInterestManager.notify.debugCall()
-        
+
         if handle in DoInterestManager._interests:
         if handle in DoInterestManager._interests:
             if DoInterestManager._interests[handle].isPendingDelete():
             if DoInterestManager._interests[handle].isPendingDelete():
                 # make sure there is no pending event for this interest
                 # make sure there is no pending event for this interest
@@ -454,12 +454,12 @@ class DoInterestManager(DirectObject.DirectObject):
                 print format % tuple(i)
                 print format % tuple(i)
             print "Note: interests with a Context of 0 do not get" \
             print "Note: interests with a Context of 0 do not get" \
                 " done/finished notices."
                 " done/finished notices."
-            
+
         def printInterestSets(self):
         def printInterestSets(self):
             print "******************* Interest Sets **************"
             print "******************* Interest Sets **************"
             format = '%6s %' + str(DoInterestManager._debug_maxDescriptionLen) + 's %11s %11s %8s %8s %8s'
             format = '%6s %' + str(DoInterestManager._debug_maxDescriptionLen) + 's %11s %11s %8s %8s %8s'
             print format % (
             print format % (
-                "Handle", "Description", 
+                "Handle", "Description",
                 "ParentId", "ZoneIdList",
                 "ParentId", "ZoneIdList",
                 "State", "Context",
                 "State", "Context",
                 "Event")
                 "Event")
@@ -479,7 +479,7 @@ class DoInterestManager(DirectObject.DirectObject):
         def printInterests(self):
         def printInterests(self):
             self.printInterestHistory()
             self.printInterestHistory()
             self.printInterestSets()
             self.printInterestSets()
-            
+
     def _sendAddInterest(self, handle, contextId, parentId, zoneIdList, description,
     def _sendAddInterest(self, handle, contextId, parentId, zoneIdList, description,
                          action=None):
                          action=None):
         """
         """

+ 5 - 5
direct/src/distributed/GridChild.py

@@ -41,7 +41,7 @@ class GridChild:
         # than just one)
         # than just one)
         #if self._gridInterestEnabled:
         #if self._gridInterestEnabled:
         self.__setGridInterest(grid, zoneId)
         self.__setGridInterest(grid, zoneId)
-        
+
     def enableGridInterest(self, enabled = True):
     def enableGridInterest(self, enabled = True):
         self._gridInterestEnabled = enabled
         self._gridInterestEnabled = enabled
         if enabled and self.isOnAGrid():
         if enabled and self.isOnAGrid():
@@ -72,13 +72,13 @@ class GridChild:
             return self._gridParent.getGridZone()
             return self._gridParent.getGridZone()
         else:
         else:
             return None
             return None
-        
+
     def __setGridParent(self, gridParent):
     def __setGridParent(self, gridParent):
         if self._gridParent and self._gridParent is not gridParent:
         if self._gridParent and self._gridParent is not gridParent:
             self._gridParent.delete()
             self._gridParent.delete()
         self._gridParent = gridParent
         self._gridParent = gridParent
 
 
-    
+
     def __setGridInterest(self, grid, zoneId):
     def __setGridInterest(self, grid, zoneId):
         assert not self.cr.noNewInterests()
         assert not self.cr.noNewInterests()
         if self.cr.noNewInterests():
         if self.cr.noNewInterests():
@@ -146,11 +146,11 @@ class SmoothGridChild(GridChild):
     @report(types = ['args'], dConfigParam = 'smoothnode')
     @report(types = ['args'], dConfigParam = 'smoothnode')
     def transformTelemetry(self, x, y, z, h, p, r, e):
     def transformTelemetry(self, x, y, z, h, p, r, e):
         # We don't really need to transform telemetry, but
         # We don't really need to transform telemetry, but
-        # we do update our grid cell such that the new 
+        # we do update our grid cell such that the new
         # telemetry is correct now.
         # telemetry is correct now.
         # We do this instead of overriding setSmPosHprE()
         # We do this instead of overriding setSmPosHprE()
         # because we're a mixin class.
         # because we're a mixin class.
         if self.isOnAGrid():
         if self.isOnAGrid():
-            self.setGridCell(self.getGrid(), e) # causes a wrtReparent() which updates 
+            self.setGridCell(self.getGrid(), e) # causes a wrtReparent() which updates
                                                 # all previous smooth positions
                                                 # all previous smooth positions
         return x, y, z, h, p, r
         return x, y, z, h, p, r

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

@@ -6,7 +6,7 @@ class InterestWatcher(DirectObject):
     """Object that observes all interests adds/removes over a period of time,
     """Object that observes all interests adds/removes over a period of time,
     and sends out an event when all of those interests have closed"""
     and sends out an event when all of those interests have closed"""
     notify = directNotify.newCategory('InterestWatcher')
     notify = directNotify.newCategory('InterestWatcher')
-    
+
     def __init__(self, interestMgr, name, doneEvent=None,
     def __init__(self, interestMgr, name, doneEvent=None,
                  recurse=True, start=True, mustCollect=False, doCollectionMgr=None):
                  recurse=True, start=True, mustCollect=False, doCollectionMgr=None):
         DirectObject.__init__(self)
         DirectObject.__init__(self)
@@ -29,7 +29,7 @@ class InterestWatcher(DirectObject):
 
 
         self.accept(self._interestMgr._getAddInterestEvent(), self._handleInterestOpenEvent)
         self.accept(self._interestMgr._getAddInterestEvent(), self._handleInterestOpenEvent)
         self.accept(self._interestMgr._getRemoveInterestEvent(), self._handleInterestCloseEvent)
         self.accept(self._interestMgr._getRemoveInterestEvent(), self._handleInterestCloseEvent)
-        
+
     def stopCollect(self):
     def stopCollect(self):
         self.ignore(self._interestMgr._getAddInterestEvent())
         self.ignore(self._interestMgr._getAddInterestEvent())
         self.ignore(self._interestMgr._getRemoveInterestEvent())
         self.ignore(self._interestMgr._getRemoveInterestEvent())

+ 7 - 7
direct/src/distributed/MsgTypes.py

@@ -4,7 +4,7 @@ from direct.showbase.PythonUtil import invertDictLossless
 
 
 MsgName2Id = {
 MsgName2Id = {
     # 2 new params: passwd, char bool 0/1 1 = new account
     # 2 new params: passwd, char bool 0/1 1 = new account
-    # 2 new return values: 129 = not found, 12 = bad passwd, 
+    # 2 new return values: 129 = not found, 12 = bad passwd,
     'CLIENT_LOGIN':                                  1,
     'CLIENT_LOGIN':                                  1,
     'CLIENT_LOGIN_RESP':                             2,
     'CLIENT_LOGIN_RESP':                             2,
     'CLIENT_GET_AVATARS':                            3,
     'CLIENT_GET_AVATARS':                            3,
@@ -85,15 +85,15 @@ MsgName2Id = {
     'CLIENT_GET_FRIEND_LIST_EXTENDED_RESP':          116,
     'CLIENT_GET_FRIEND_LIST_EXTENDED_RESP':          116,
 
 
     'CLIENT_SET_FIELD_SENDABLE':                     120,
     'CLIENT_SET_FIELD_SENDABLE':                     120,
-    
+
     'CLIENT_SYSTEMMESSAGE_AKNOWLEDGE':               123,
     'CLIENT_SYSTEMMESSAGE_AKNOWLEDGE':               123,
     'CLIENT_CHANGE_GENERATE_ORDER':                  124,
     'CLIENT_CHANGE_GENERATE_ORDER':                  124,
 
 
     # new toontown specific login message, adds last logged in, and if child account has parent acount
     # new toontown specific login message, adds last logged in, and if child account has parent acount
     'CLIENT_LOGIN_TOONTOWN':                         125,
     'CLIENT_LOGIN_TOONTOWN':                         125,
-    'CLIENT_LOGIN_TOONTOWN_RESP':                    126,  
-    
-    
+    'CLIENT_LOGIN_TOONTOWN_RESP':                    126,
+
+
 
 
     'STATESERVER_OBJECT_GENERATE_WITH_REQUIRED':           2001,
     'STATESERVER_OBJECT_GENERATE_WITH_REQUIRED':           2001,
     'STATESERVER_OBJECT_GENERATE_WITH_REQUIRED_OTHER':     2003,
     'STATESERVER_OBJECT_GENERATE_WITH_REQUIRED_OTHER':     2003,
@@ -105,7 +105,7 @@ MsgName2Id = {
 
 
 # create id->name table for debugging
 # create id->name table for debugging
 MsgId2Names = invertDictLossless(MsgName2Id)
 MsgId2Names = invertDictLossless(MsgName2Id)
-    
+
 # put msg names in module scope, assigned to msg value
 # put msg names in module scope, assigned to msg value
 globals().update(MsgName2Id)
 globals().update(MsgName2Id)
 
 
@@ -115,7 +115,7 @@ QUIET_ZONE_IGNORED_LIST = [
     # We mustn't ignore updates, because some updates for localToon
     # We mustn't ignore updates, because some updates for localToon
     # are always important.
     # are always important.
     #CLIENT_OBJECT_UPDATE_FIELD,
     #CLIENT_OBJECT_UPDATE_FIELD,
-    
+
     # These are now handled. If it is a create for a class that is in the
     # These are now handled. If it is a create for a class that is in the
     # uber zone, we should create it.
     # uber zone, we should create it.
     #CLIENT_CREATE_OBJECT_REQUIRED,
     #CLIENT_CREATE_OBJECT_REQUIRED,

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

@@ -24,6 +24,6 @@ MsgName2Id = {
 
 
 # create id->name table for debugging
 # create id->name table for debugging
 MsgId2Names = invertDictLossless(MsgName2Id)
 MsgId2Names = invertDictLossless(MsgName2Id)
-    
+
 # put msg names in module scope, assigned to msg value
 # put msg names in module scope, assigned to msg value
 globals().update(MsgName2Id)
 globals().update(MsgName2Id)

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

@@ -80,7 +80,7 @@ class ParentMgr:
             # there is no longer any valid place for the child in the
             # there is no longer any valid place for the child in the
             # scenegraph; put it under hidden
             # scenegraph; put it under hidden
             child.reparentTo(hidden)
             child.reparentTo(hidden)
-            
+
     def registerParent(self, token, parent):
     def registerParent(self, token, parent):
         if token in self.token2nodepath:
         if token in self.token2nodepath:
             self.notify.error(
             self.notify.error(

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

@@ -32,29 +32,29 @@ class PyDatagram(Datagram):
     #def addChannel(self, channelId):
     #def addChannel(self, channelId):
     #    ...
     #    ...
     addChannel = Datagram.addUint64
     addChannel = Datagram.addUint64
-    
+
     def addServerHeader(self, channel, sender, code):
     def addServerHeader(self, channel, sender, code):
         self.addInt8(1)
         self.addInt8(1)
         self.addChannel(channel)
         self.addChannel(channel)
         self.addChannel(sender)
         self.addChannel(sender)
         self.addUint16(code)
         self.addUint16(code)
-    
-    
+
+
     def addOldServerHeader(self, channel, sender, code):
     def addOldServerHeader(self, channel, sender, code):
         self.addChannel(channel)
         self.addChannel(channel)
         self.addChannel(sender)
         self.addChannel(sender)
         self.addChannel('A')
         self.addChannel('A')
         self.addUint16(code)
         self.addUint16(code)
-    
-    
+
+
 #    def addServerControlHeader(self,   code):
 #    def addServerControlHeader(self,   code):
 #        self.addInt8(1)
 #        self.addInt8(1)
 #        self.addChannel(CONTROL_MESSAGE)
 #        self.addChannel(CONTROL_MESSAGE)
-#        self.addUint16(code)    
+#        self.addUint16(code)
 #    def addOldServerControlHeader(self,   code):
 #    def addOldServerControlHeader(self,   code):
 #        self.addChannel(CONTROL_MESSAGE)
 #        self.addChannel(CONTROL_MESSAGE)
 #        self.addUint16(code)
 #        self.addUint16(code)
-    
+
     def putArg(self, arg, subatomicType, divisor=1):
     def putArg(self, arg, subatomicType, divisor=1):
         if (divisor == 1):
         if (divisor == 1):
             funcSpecs = self.FuncDict.get(subatomicType)
             funcSpecs = self.FuncDict.get(subatomicType)

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

@@ -22,7 +22,7 @@ class PyDatagramIterator(DatagramIterator):
         STUint32: DatagramIterator.getUint32,
         STUint32: DatagramIterator.getUint32,
         STUint64: DatagramIterator.getUint64,
         STUint64: DatagramIterator.getUint64,
         STFloat64: DatagramIterator.getFloat64,
         STFloat64: DatagramIterator.getFloat64,
-        STString: DatagramIterator.getString, 
+        STString: DatagramIterator.getString,
         STBlob: DatagramIterator.getString,
         STBlob: DatagramIterator.getString,
         STBlob32: DatagramIterator.getString32,
         STBlob32: DatagramIterator.getString32,
         }
         }
@@ -77,7 +77,7 @@ class PyDatagramIterator(DatagramIterator):
             else:
             else:
                 raise Exception("Error: No such type as: " + str(subAtomicType))
                 raise Exception("Error: No such type as: " + str(subAtomicType))
         else:
         else:
-            # See if it is in the handy dict            
+            # See if it is in the handy dict
             getFunc = self.FuncDict.get(subatomicType)
             getFunc = self.FuncDict.get(subatomicType)
             if getFunc:
             if getFunc:
                 retVal = (getFunc(self)/float(divisor))
                 retVal = (getFunc(self)/float(divisor))

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

@@ -27,7 +27,7 @@ class RelatedObjectMgr(DirectObject.DirectObject):
     notify = DirectNotifyGlobal.directNotify.newCategory('RelatedObjectMgr')
     notify = DirectNotifyGlobal.directNotify.newCategory('RelatedObjectMgr')
 
 
     doLaterSequence = 1
     doLaterSequence = 1
-    
+
     def __init__(self, cr):
     def __init__(self, cr):
         self.cr = cr
         self.cr = cr
         self.pendingObjects = {}
         self.pendingObjects = {}
@@ -64,14 +64,14 @@ class RelatedObjectMgr(DirectObject.DirectObject):
         The return value may be saved and passed to a future call to
         The return value may be saved and passed to a future call to
         abortRequest(), in order to abort a pending request before the
         abortRequest(), in order to abort a pending request before the
         timeout expires.
         timeout expires.
-        
+
         Actually, you should be careful to call abortRequest() if you
         Actually, you should be careful to call abortRequest() if you
         have made a call to requestObjects() that has not been resolved.
         have made a call to requestObjects() that has not been resolved.
-        To find examples, do a search for abortRequest() to find out 
-        how other code is using it.  A common idiom is to store the 
+        To find examples, do a search for abortRequest() to find out
+        how other code is using it.  A common idiom is to store the
         result from requestObjects() and call abortRequest() if delete()
         result from requestObjects() and call abortRequest() if delete()
         or destroy() is called on the requesting object.
         or destroy() is called on the requesting object.
-        
+
         See Also: abortRequest()
         See Also: abortRequest()
         """
         """
         assert self.notify.debug("requestObjects(%s, timeout=%s)" % (doIdList, timeout))
         assert self.notify.debug("requestObjects(%s, timeout=%s)" % (doIdList, timeout))
@@ -107,7 +107,7 @@ class RelatedObjectMgr(DirectObject.DirectObject):
         if timeout != None:
         if timeout != None:
             doLaterName = "RelatedObject-%s" % (RelatedObjectMgr.doLaterSequence)
             doLaterName = "RelatedObject-%s" % (RelatedObjectMgr.doLaterSequence)
             assert self.notify.debug("doLaterName = %s" % (doLaterName))
             assert self.notify.debug("doLaterName = %s" % (doLaterName))
-            
+
             RelatedObjectMgr.doLaterSequence += 1
             RelatedObjectMgr.doLaterSequence += 1
 
 
         tuple = (allCallback, eachCallback, timeoutCallback,
         tuple = (allCallback, eachCallback, timeoutCallback,
@@ -134,7 +134,7 @@ class RelatedObjectMgr(DirectObject.DirectObject):
         Aborts a previous request.  The parameter is the return value
         Aborts a previous request.  The parameter is the return value
         from a previous call to requestObjects().  The pending request
         from a previous call to requestObjects().  The pending request
         is removed from the queue and no further callbacks will be called.
         is removed from the queue and no further callbacks will be called.
-        
+
         See Also: requestObjects()
         See Also: requestObjects()
         """
         """
         if tuple:
         if tuple:
@@ -164,14 +164,14 @@ class RelatedObjectMgr(DirectObject.DirectObject):
                     taskMgr.remove(doLaterName)
                     taskMgr.remove(doLaterName)
 
 
         self.pendingObjects = {}
         self.pendingObjects = {}
-        
+
 
 
     def __timeoutExpired(self, tuple):
     def __timeoutExpired(self, tuple):
         allCallback, eachCallback, timeoutCallback, doIdsPending, doIdList, doLaterName = tuple
         allCallback, eachCallback, timeoutCallback, doIdsPending, doIdList, doLaterName = tuple
         assert self.notify.debug("timeout expired for %s (remaining: %s)" % (doIdList, doIdsPending))
         assert self.notify.debug("timeout expired for %s (remaining: %s)" % (doIdList, doIdsPending))
 
 
         self.__removePending(tuple, doIdsPending)
         self.__removePending(tuple, doIdsPending)
-        
+
         if timeoutCallback:
         if timeoutCallback:
             timeoutCallback(doIdList)
             timeoutCallback(doIdList)
         else:
         else:
@@ -191,7 +191,7 @@ class RelatedObjectMgr(DirectObject.DirectObject):
             if len(pendingList) == 0:
             if len(pendingList) == 0:
                 del self.pendingObjects[doId]
                 del self.pendingObjects[doId]
                 self.__noListenFor(doId)
                 self.__noListenFor(doId)
-        
+
 
 
     def __listenFor(self, doId):
     def __listenFor(self, doId):
         # Start listening for the indicated object to be generated.
         # Start listening for the indicated object to be generated.
@@ -230,7 +230,7 @@ class RelatedObjectMgr(DirectObject.DirectObject):
                 assert self.notify.debug("All objects generated on list: %s" % (doIdList,))
                 assert self.notify.debug("All objects generated on list: %s" % (doIdList,))
                 if doLaterName:
                 if doLaterName:
                     taskMgr.remove(doLaterName)
                     taskMgr.remove(doLaterName)
-            
+
                 objects, doIdsPending = self.__generateObjectList(doIdList)
                 objects, doIdsPending = self.__generateObjectList(doIdList)
                 if None in objects:
                 if None in objects:
                     assert self.notify.warning('calling %s with None.\n objects=%s\n doIdsPending=%s\n doIdList=%s\n' % (allCallback,objects,doIdsPending,doIdList))
                     assert self.notify.warning('calling %s with None.\n objects=%s\n doIdsPending=%s\n doIdList=%s\n' % (allCallback,objects,doIdsPending,doIdList))
@@ -252,6 +252,6 @@ class RelatedObjectMgr(DirectObject.DirectObject):
                     doIdsPending.append(doId)
                     doIdsPending.append(doId)
             else:
             else:
                 objects.append(None)
                 objects.append(None)
-        
+
         return objects, doIdsPending
         return objects, doIdsPending
 
 

+ 19 - 19
direct/src/distributed/ServerRepository.py

@@ -49,7 +49,7 @@ class ServerRepository:
             # or moving objects between zones, might influence this
             # or moving objects between zones, might influence this
             # set.
             # set.
             self.currentInterestZoneIds = set()
             self.currentInterestZoneIds = set()
-            
+
             # A dictionary of doId -> Object, for distributed objects
             # A dictionary of doId -> Object, for distributed objects
             # currently in existence that were created by the client.
             # currently in existence that were created by the client.
             self.objectsByDoId = {}
             self.objectsByDoId = {}
@@ -76,7 +76,7 @@ class ServerRepository:
             # Note that the server does not store any other data about
             # Note that the server does not store any other data about
             # the distributed objects; in particular, it doesn't
             # the distributed objects; in particular, it doesn't
             # record its current fields.  That is left to the clients.
             # record its current fields.  That is left to the clients.
-            
+
 
 
     def __init__(self, tcpPort, serverAddress = None,
     def __init__(self, tcpPort, serverAddress = None,
                  udpPort = None, dcFileNames = None,
                  udpPort = None, dcFileNames = None,
@@ -137,7 +137,7 @@ class ServerRepository:
         # An allocator object that assigns the next doIdBase to each
         # An allocator object that assigns the next doIdBase to each
         # client.
         # client.
         self.idAllocator = UniqueIdAllocator(0, 0xffffffff / self.doIdRange)
         self.idAllocator = UniqueIdAllocator(0, 0xffffffff / self.doIdRange)
-        
+
         self.dcFile = DCFile()
         self.dcFile = DCFile()
         self.dcSuffix = ''
         self.dcSuffix = ''
         self.readDCFile(dcFileNames)
         self.readDCFile(dcFileNames)
@@ -168,7 +168,7 @@ class ServerRepository:
         """Returns the current setting of TCP header size. See
         """Returns the current setting of TCP header size. See
         setTcpHeaderSize(). """
         setTcpHeaderSize(). """
         return self.qcr.getTcpHeaderSize()
         return self.qcr.getTcpHeaderSize()
-        
+
 
 
     def importModule(self, dcImports, moduleName, importSymbols):
     def importModule(self, dcImports, moduleName, importSymbols):
         """ Imports the indicated moduleName and all of its symbols
         """ Imports the indicated moduleName and all of its symbols
@@ -317,10 +317,10 @@ class ServerRepository:
 
 
             # Now we can start listening to that new connection.
             # Now we can start listening to that new connection.
             self.qcr.addConnection(newConnection)
             self.qcr.addConnection(newConnection)
-            
+
             self.lastConnection = newConnection
             self.lastConnection = newConnection
             self.sendDoIdRange(client)
             self.sendDoIdRange(client)
-            
+
         return task.cont
         return task.cont
 
 
     def readerPollUntilEmpty(self, task):
     def readerPollUntilEmpty(self, task):
@@ -415,7 +415,7 @@ class ServerRepository:
                 self.notify.debug(
                 self.notify.debug(
                     "Creating object %s of type %s by client %s" % (
                     "Creating object %s of type %s by client %s" % (
                     doId, dclass.getName(), client.doIdBase))
                     doId, dclass.getName(), client.doIdBase))
-                    
+
             object = self.Object(doId, zoneId, dclass)
             object = self.Object(doId, zoneId, dclass)
             client.objectsByDoId[doId] = object
             client.objectsByDoId[doId] = object
             client.objectsByZoneId.setdefault(zoneId, set()).add(object)
             client.objectsByZoneId.setdefault(zoneId, set()).add(object)
@@ -433,7 +433,7 @@ class ServerRepository:
         dg.addUint16(classId)
         dg.addUint16(classId)
         dg.addUint32(doId)
         dg.addUint32(doId)
         dg.appendData(dgi.getRemainingBytes())
         dg.appendData(dgi.getRemainingBytes())
-        
+
         self.sendToZoneExcept(zoneId, dg, [client])
         self.sendToZoneExcept(zoneId, dg, [client])
 
 
     def handleClientObjectUpdateField(self, datagram, dgi, targeted = False):
     def handleClientObjectUpdateField(self, datagram, dgi, targeted = False):
@@ -454,7 +454,7 @@ class ServerRepository:
                 "Ignoring update for unknown object %s from client %s" % (
                 "Ignoring update for unknown object %s from client %s" % (
                 doId, client.doIdBase))
                 doId, client.doIdBase))
             return
             return
-        
+
         dcfield = object.dclass.getFieldByIndex(fieldId)
         dcfield = object.dclass.getFieldByIndex(fieldId)
         if dcfield == None:
         if dcfield == None:
             self.notify.warning(
             self.notify.warning(
@@ -489,16 +489,16 @@ class ServerRepository:
                 return
                 return
             self.cw.send(dg, target.connection)
             self.cw.send(dg, target.connection)
             self.needsFlush.add(target)
             self.needsFlush.add(target)
-            
+
         elif dcfield.hasKeyword('p2p'):
         elif dcfield.hasKeyword('p2p'):
             # p2p: to object owner only
             # p2p: to object owner only
             self.cw.send(dg, owner.connection)
             self.cw.send(dg, owner.connection)
             self.needsFlush.add(owner)
             self.needsFlush.add(owner)
-                        
+
         elif dcfield.hasKeyword('broadcast'):
         elif dcfield.hasKeyword('broadcast'):
             # Broadcast: to everyone except orig sender
             # Broadcast: to everyone except orig sender
             self.sendToZoneExcept(object.zoneId, dg, [client])
             self.sendToZoneExcept(object.zoneId, dg, [client])
-            
+
         elif dcfield.hasKeyword('reflect'):
         elif dcfield.hasKeyword('reflect'):
             # Reflect: broadcast to everyone including orig sender
             # Reflect: broadcast to everyone including orig sender
             self.sendToZoneExcept(object.zoneId, dg, [])
             self.sendToZoneExcept(object.zoneId, dg, [])
@@ -528,7 +528,7 @@ class ServerRepository:
             return
             return
 
 
         self.sendToZoneExcept(object.zoneId, datagram, [])
         self.sendToZoneExcept(object.zoneId, datagram, [])
-        
+
         self.objectsByZoneId[object.zoneId].remove(object)
         self.objectsByZoneId[object.zoneId].remove(object)
         if not self.objectsByZoneId[object.zoneId]:
         if not self.objectsByZoneId[object.zoneId]:
             del self.objectsByZoneId[object.zoneId]
             del self.objectsByZoneId[object.zoneId]
@@ -632,7 +632,7 @@ class ServerRepository:
 
 
         self.qcr.removeConnection(client.connection)
         self.qcr.removeConnection(client.connection)
         self.qcm.closeConnection(client.connection)
         self.qcm.closeConnection(client.connection)
-        
+
 
 
     def handleClientSetInterest(self, client, dgi):
     def handleClientSetInterest(self, client, dgi):
         """ The client is specifying a particular set of zones it is
         """ The client is specifying a particular set of zones it is
@@ -645,11 +645,11 @@ class ServerRepository:
 
 
         client.explicitInterestZoneIds = zoneIds
         client.explicitInterestZoneIds = zoneIds
         self.updateClientInterestZones(client)
         self.updateClientInterestZones(client)
-        
+
     def updateClientInterestZones(self, client):
     def updateClientInterestZones(self, client):
         """ Something about the client has caused its set of interest
         """ Something about the client has caused its set of interest
         zones to potentially change.  Recompute them. """
         zones to potentially change.  Recompute them. """
-        
+
         origZoneIds = client.currentInterestZoneIds
         origZoneIds = client.currentInterestZoneIds
         newZoneIds = client.explicitInterestZoneIds | set(client.objectsByZoneId.keys())
         newZoneIds = client.explicitInterestZoneIds | set(client.objectsByZoneId.keys())
         if origZoneIds == newZoneIds:
         if origZoneIds == newZoneIds:
@@ -683,7 +683,7 @@ class ServerRepository:
         self.cw.send(datagram, client.connection)
         self.cw.send(datagram, client.connection)
 
 
         self.needsFlush.add(client)
         self.needsFlush.add(client)
-            
+
 
 
     def clientHardDisconnectTask(self, task):
     def clientHardDisconnectTask(self, task):
         """ client did not tell us he was leaving but we lost connection to
         """ client did not tell us he was leaving but we lost connection to
@@ -696,7 +696,7 @@ class ServerRepository:
     def sendToZoneExcept(self, zoneId, datagram, exceptionList):
     def sendToZoneExcept(self, zoneId, datagram, exceptionList):
         """sends a message to everyone who has interest in the
         """sends a message to everyone who has interest in the
         indicated zone, except for the clients on exceptionList."""
         indicated zone, except for the clients on exceptionList."""
-        
+
         if self.notify.getDebug():
         if self.notify.getDebug():
             self.notify.debug(
             self.notify.debug(
                 "ServerRepository sending to all in zone %s except %s:" % (zoneId, [c.doIdBase for c in exceptionList]))
                 "ServerRepository sending to all in zone %s except %s:" % (zoneId, [c.doIdBase for c in exceptionList]))
@@ -713,7 +713,7 @@ class ServerRepository:
     def sendToAllExcept(self, datagram, exceptionList):
     def sendToAllExcept(self, datagram, exceptionList):
         """ sends a message to all connected clients, except for
         """ sends a message to all connected clients, except for
         clients on exceptionList. """
         clients on exceptionList. """
-        
+
         if self.notify.getDebug():
         if self.notify.getDebug():
             self.notify.debug(
             self.notify.debug(
                 "ServerRepository sending to all except %s:" % ([c.doIdBase for c in exceptionList],))
                 "ServerRepository sending to all except %s:" % ([c.doIdBase for c in exceptionList],))

+ 7 - 7
direct/src/distributed/StagedObject.py

@@ -6,7 +6,7 @@ class StagedObject:
     The idea here is that a DistributedObject could be present and active due to
     The idea here is that a DistributedObject could be present and active due to
     simple visibility, but we want to hide or otherwise disable it for some reason.
     simple visibility, but we want to hide or otherwise disable it for some reason.
     """
     """
-    
+
     UNKNOWN = -1
     UNKNOWN = -1
     OFF     = 0
     OFF     = 0
     ON      = 1
     ON      = 1
@@ -31,16 +31,16 @@ class StagedObject:
             self.handleOnStage(*args, **kw)
             self.handleOnStage(*args, **kw)
             pass
             pass
         pass
         pass
-    
+
     def handleOnStage(self):
     def handleOnStage(self):
         """
         """
         Override this function to provide your on/off stage funcitionality.
         Override this function to provide your on/off stage funcitionality.
-        
+
         Don't forget to call down to this one, though.
         Don't forget to call down to this one, though.
         """
         """
         self.__state = StagedObject.ON
         self.__state = StagedObject.ON
         pass
         pass
-    
+
     def goOffStage(self, *args, **kw):
     def goOffStage(self, *args, **kw):
         """
         """
         If a stage switch is needed, the correct "handle" function
         If a stage switch is needed, the correct "handle" function
@@ -53,16 +53,16 @@ class StagedObject:
             self.handleOffStage(*args, **kw)
             self.handleOffStage(*args, **kw)
             pass
             pass
         pass
         pass
-    
+
     def handleOffStage(self):
     def handleOffStage(self):
         """
         """
         Override this function to provide your on/off stage funcitionality.
         Override this function to provide your on/off stage funcitionality.
-        
+
         Don't forget to call down to this one, though.
         Don't forget to call down to this one, though.
         """
         """
         self.__state = StagedObject.OFF
         self.__state = StagedObject.OFF
         pass
         pass
-    
+
     def isOnStage(self):
     def isOnStage(self):
         return self.__state == StagedObject.ON
         return self.__state == StagedObject.ON
 
 

+ 6 - 6
direct/src/distributed/TimeManager.py

@@ -4,7 +4,7 @@ from direct.task import Task
 from direct.distributed import DistributedObject
 from direct.distributed import DistributedObject
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
 from direct.distributed.ClockDelta import globalClockDelta
 from direct.distributed.ClockDelta import globalClockDelta
-        
+
 class TimeManager(DistributedObject.DistributedObject):
 class TimeManager(DistributedObject.DistributedObject):
     """
     """
     This DistributedObject lives on the AI and on the client side, and
     This DistributedObject lives on the AI and on the client side, and
@@ -113,7 +113,7 @@ class TimeManager(DistributedObject.DistributedObject):
         self.synchronize("clock error")
         self.synchronize("clock error")
 
 
     ### Synchronization methods ###
     ### Synchronization methods ###
-        
+
     def synchronize(self, description):
     def synchronize(self, description):
         """synchronize(self, string description)
         """synchronize(self, string description)
 
 
@@ -132,7 +132,7 @@ class TimeManager(DistributedObject.DistributedObject):
         if now - self.lastAttempt < self.minWait:
         if now - self.lastAttempt < self.minWait:
             self.notify.debug("Not resyncing (too soon): %s" % (description))
             self.notify.debug("Not resyncing (too soon): %s" % (description))
             return 0
             return 0
-            
+
         self.talkResult = 0
         self.talkResult = 0
         self.thisContext = self.nextContext
         self.thisContext = self.nextContext
         self.attemptCount = 0
         self.attemptCount = 0
@@ -144,7 +144,7 @@ class TimeManager(DistributedObject.DistributedObject):
 
 
         return 1
         return 1
 
 
-    
+
     def serverTime(self, context, timestamp):
     def serverTime(self, context, timestamp):
         """serverTime(self, int8 context, int32 timestamp)
         """serverTime(self, int8 context, int32 timestamp)
 
 
@@ -162,7 +162,7 @@ class TimeManager(DistributedObject.DistributedObject):
         if context != self.thisContext:
         if context != self.thisContext:
             self.notify.info("Ignoring TimeManager response for old context %d" % (context))
             self.notify.info("Ignoring TimeManager response for old context %d" % (context))
             return
             return
-        
+
         elapsed = end - self.start
         elapsed = end - self.start
         self.attemptCount += 1
         self.attemptCount += 1
         self.notify.info("Clock sync roundtrip took %0.3f ms" % (elapsed * 1000.0))
         self.notify.info("Clock sync roundtrip took %0.3f ms" % (elapsed * 1000.0))
@@ -181,7 +181,7 @@ class TimeManager(DistributedObject.DistributedObject):
                 self.sendUpdate("requestServerTime", [self.thisContext])
                 self.sendUpdate("requestServerTime", [self.thisContext])
                 return
                 return
             self.notify.info("Giving up on uncertainty requirement.")
             self.notify.info("Giving up on uncertainty requirement.")
-        
+
         messenger.send("gotTimeSync", taskChain = 'default')
         messenger.send("gotTimeSync", taskChain = 'default')
         messenger.send(self.cr.uniqueName("gotTimeSync"), taskChain = 'default')
         messenger.send(self.cr.uniqueName("gotTimeSync"), taskChain = 'default')
 
 

+ 2 - 2
direct/src/extensions_native/HTTPChannel_extensions.py

@@ -1,5 +1,5 @@
 ####################################################################
 ####################################################################
-#Dtool_funcToMethod(func, class)        
+#Dtool_funcToMethod(func, class)
 #del func
 #del func
 #####################################################################
 #####################################################################
 
 
@@ -32,7 +32,7 @@ if hasattr(core, 'HTTPChannel'):
     Dtool_funcToMethod(spawnTask, core.HTTPChannel)
     Dtool_funcToMethod(spawnTask, core.HTTPChannel)
 del spawnTask
 del spawnTask
 #####################################################################
 #####################################################################
-        
+
 def doTask(self, task):
 def doTask(self, task):
         from direct.task import Task
         from direct.task import Task
         if self.run():
         if self.run():

+ 2 - 2
direct/src/extensions_native/Mat3_extensions.py

@@ -1,5 +1,5 @@
 ####################################################################
 ####################################################################
-#Dtool_funcToMethod(func, class)        
+#Dtool_funcToMethod(func, class)
 #del func
 #del func
 #####################################################################
 #####################################################################
 
 
@@ -17,6 +17,6 @@ def pPrintValues(self):
         """
         """
         return "\n%s\n%s\n%s" % (
         return "\n%s\n%s\n%s" % (
             self.getRow(0).pPrintValues(), self.getRow(1).pPrintValues(), self.getRow(2).pPrintValues())
             self.getRow(0).pPrintValues(), self.getRow(1).pPrintValues(), self.getRow(2).pPrintValues())
-Dtool_funcToMethod(pPrintValues, Mat3)        
+Dtool_funcToMethod(pPrintValues, Mat3)
 del pPrintValues
 del pPrintValues
 #####################################################################
 #####################################################################

+ 6 - 6
direct/src/filter/CommonFilters.py

@@ -10,7 +10,7 @@ the composition process isn't simply a question of concatenating them:
 you have to somehow make them work together.  I suspect that there
 you have to somehow make them work together.  I suspect that there
 exists some fairly simple framework that would make this automatable.
 exists some fairly simple framework that would make this automatable.
 However, until I write some more filters myself, I won't know what
 However, until I write some more filters myself, I won't know what
-that framework is.  Until then, I'll settle for this 
+that framework is.  Until then, I'll settle for this
 clunky approach.  - Josh
 clunky approach.  - Josh
 
 
 """
 """
@@ -337,13 +337,13 @@ class CommonFilters:
             if ("Inverted" in configuration):
             if ("Inverted" in configuration):
                 text += "  o_color = float4(1, 1, 1, 1) - o_color;\n"
                 text += "  o_color = float4(1, 1, 1, 1) - o_color;\n"
             text += "}\n"
             text += "}\n"
-            
+
             self.finalQuad.setShader(Shader.make(text, Shader.SL_Cg))
             self.finalQuad.setShader(Shader.make(text, Shader.SL_Cg))
             for tex in self.textures:
             for tex in self.textures:
                 self.finalQuad.setShaderInput("tx"+tex, self.textures[tex])
                 self.finalQuad.setShaderInput("tx"+tex, self.textures[tex])
-            
+
             self.task = taskMgr.add(self.update, "common-filters-update")
             self.task = taskMgr.add(self.update, "common-filters-update")
-        
+
         if (changed == "CartoonInk") or fullrebuild:
         if (changed == "CartoonInk") or fullrebuild:
             if ("CartoonInk" in configuration):
             if ("CartoonInk" in configuration):
                 c = configuration["CartoonInk"]
                 c = configuration["CartoonInk"]
@@ -363,13 +363,13 @@ class CommonFilters:
                 self.bloom[0].setShaderInput("trigger", bloomconf.mintrigger, 1.0/(bloomconf.maxtrigger-bloomconf.mintrigger), 0.0, 0.0)
                 self.bloom[0].setShaderInput("trigger", bloomconf.mintrigger, 1.0/(bloomconf.maxtrigger-bloomconf.mintrigger), 0.0, 0.0)
                 self.bloom[0].setShaderInput("desat", bloomconf.desat)
                 self.bloom[0].setShaderInput("desat", bloomconf.desat)
                 self.bloom[3].setShaderInput("intensity", intensity, intensity, intensity, intensity)
                 self.bloom[3].setShaderInput("intensity", intensity, intensity, intensity, intensity)
-        
+
         if (changed == "VolumetricLighting") or fullrebuild:
         if (changed == "VolumetricLighting") or fullrebuild:
             if ("VolumetricLighting" in configuration):
             if ("VolumetricLighting" in configuration):
                 config = configuration["VolumetricLighting"]
                 config = configuration["VolumetricLighting"]
                 tcparam = config.density / float(config.numsamples)
                 tcparam = config.density / float(config.numsamples)
                 self.finalQuad.setShaderInput("vlparams", tcparam, config.decay, config.exposure, 0.0)
                 self.finalQuad.setShaderInput("vlparams", tcparam, config.decay, config.exposure, 0.0)
-        
+
         if (changed == "AmbientOcclusion") or fullrebuild:
         if (changed == "AmbientOcclusion") or fullrebuild:
             if ("AmbientOcclusion" in configuration):
             if ("AmbientOcclusion" in configuration):
                 config = configuration["AmbientOcclusion"]
                 config = configuration["AmbientOcclusion"]

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

@@ -44,7 +44,7 @@ class FilterManager(DirectObject):
             FilterManager.notify = directNotify.newCategory("FilterManager")
             FilterManager.notify = directNotify.newCategory("FilterManager")
 
 
         # Find the appropriate display region.
         # Find the appropriate display region.
-        
+
         region = None
         region = None
         for dr in win.getDisplayRegions():
         for dr in win.getDisplayRegions():
             drcam = dr.getCamera()
             drcam = dr.getCamera()
@@ -54,7 +54,7 @@ class FilterManager(DirectObject):
         if region is None:
         if region is None:
             self.notify.error('Could not find appropriate DisplayRegion to filter')
             self.notify.error('Could not find appropriate DisplayRegion to filter')
             return False
             return False
-        
+
         # Instance Variables.
         # Instance Variables.
 
 
         self.win = win
         self.win = win
@@ -102,7 +102,7 @@ class FilterManager(DirectObject):
                 (self.region.getRight()  == 1.0) and
                 (self.region.getRight()  == 1.0) and
                 (self.region.getBottom() == 0.0) and
                 (self.region.getBottom() == 0.0) and
                 (self.region.getTop()    == 1.0))
                 (self.region.getTop()    == 1.0))
-            
+
     def getScaledSize(self, mul, div, align):
     def getScaledSize(self, mul, div, align):
 
 
         """ Calculate the size of the desired window. Not public. """
         """ Calculate the size of the desired window. Not public. """
@@ -213,7 +213,7 @@ class FilterManager(DirectObject):
         lens.setNearFar(-1000, 1000)
         lens.setNearFar(-1000, 1000)
         quadcamnode.setLens(lens)
         quadcamnode.setLens(lens)
         quadcam = quad.attachNewNode(quadcamnode)
         quadcam = quad.attachNewNode(quadcamnode)
-        
+
         self.region.setCamera(quadcam)
         self.region.setCamera(quadcam)
 
 
         self.setStackedClears(buffer, self.rclears, self.wclears)
         self.setStackedClears(buffer, self.rclears, self.wclears)
@@ -247,7 +247,7 @@ class FilterManager(DirectObject):
         texgroup = (depthtex, colortex, auxtex0, auxtex1)
         texgroup = (depthtex, colortex, auxtex0, auxtex1)
 
 
         winx, winy = self.getScaledSize(mul, div, align)
         winx, winy = self.getScaledSize(mul, div, align)
-        
+
         depthbits = bool(depthtex != None)
         depthbits = bool(depthtex != None)
 
 
         buffer = self.createBuffer("filter-stage", winx, winy, texgroup, depthbits)
         buffer = self.createBuffer("filter-stage", winx, winy, texgroup, depthbits)
@@ -284,7 +284,7 @@ class FilterManager(DirectObject):
 
 
         self.buffers.append(buffer)
         self.buffers.append(buffer)
         self.sizes.append((mul, div, align))
         self.sizes.append((mul, div, align))
-        
+
         return quad
         return quad
 
 
     def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1):
     def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1):

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

@@ -108,7 +108,7 @@ class ClassicFSM(DirectObject):
         assert not self.__internalStateInFlux
         assert not self.__internalStateInFlux
         if self.__currentState == self.__initialState:
         if self.__currentState == self.__initialState:
             return
             return
-        
+
         assert self.__currentState == None
         assert self.__currentState == None
         self.__internalStateInFlux = 1
         self.__internalStateInFlux = 1
         self.__enter(self.__initialState, argList)
         self.__enter(self.__initialState, argList)

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

@@ -197,7 +197,7 @@ class FSM(DirectObject):
             # If there's no matching filterState() function, call
             # If there's no matching filterState() function, call
             # defaultFilter() instead.
             # defaultFilter() instead.
             filter = self.defaultFilter
             filter = self.defaultFilter
-            
+
         return filter
         return filter
 
 
     def getCurrentOrNextState(self):
     def getCurrentOrNextState(self):
@@ -394,7 +394,7 @@ class FSM(DirectObject):
         if request[0].isupper():
         if request[0].isupper():
             return (request,) + args
             return (request,) + args
         return self.defaultFilter(request, args)
         return self.defaultFilter(request, args)
-        
+
 
 
     def setStateArray(self, stateArray):
     def setStateArray(self, stateArray):
         """array of unique states to iterate through"""
         """array of unique states to iterate through"""

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

@@ -13,15 +13,15 @@ import State
 class FourState:
 class FourState:
     """
     """
     Generic four state ClassicFSM base class.
     Generic four state ClassicFSM base class.
-    
+
     This is a mix-in class that expects that your derived class
     This is a mix-in class that expects that your derived class
     is a DistributedObject.
     is a DistributedObject.
-    
-    Inherit from FourStateFSM and pass in your states.  Two of 
-    the states should be oposites of each other and the other 
+
+    Inherit from FourStateFSM and pass in your states.  Two of
+    the states should be oposites of each other and the other
     two should be the transition states between the first two.
     two should be the transition states between the first two.
     E.g.
     E.g.
-    
+
                     +--------+
                     +--------+
                  -->| closed | --
                  -->| closed | --
                 |   +--------+   |
                 |   +--------+   |
@@ -35,10 +35,10 @@ class FourState:
                 |    +------+    |
                 |    +------+    |
                  ----| open |<---
                  ----| open |<---
                      +------+
                      +------+
-    
+
     There is a fifth off state, but that is an implementation
     There is a fifth off state, but that is an implementation
     detail (and that's why it's not called a five state ClassicFSM).
     detail (and that's why it's not called a five state ClassicFSM).
-    
+
     I found that this pattern repeated in several things I was
     I found that this pattern repeated in several things I was
     working on, so this base class was created.
     working on, so this base class was created.
     """
     """
@@ -47,22 +47,22 @@ class FourState:
     def __init__(self, names, durations = [0, 1, None, 1, 1]):
     def __init__(self, names, durations = [0, 1, None, 1, 1]):
         """
         """
         names is a list of state names
         names is a list of state names
-        
+
         E.g.
         E.g.
             ['off', 'opening', 'open', 'closing', 'closed',]
             ['off', 'opening', 'open', 'closing', 'closed',]
-        
+
         e.g. 2:
         e.g. 2:
             ['off', 'locking', 'locked', 'unlocking', 'unlocked',]
             ['off', 'locking', 'locked', 'unlocking', 'unlocked',]
-        
+
         e.g. 3:
         e.g. 3:
             ['off', 'deactivating', 'deactive', 'activating', 'activated',]
             ['off', 'deactivating', 'deactive', 'activating', 'activated',]
-        
+
         durations is a list of time values (floats) or None values.
         durations is a list of time values (floats) or None values.
-        
+
         Each list must have five entries.
         Each list must have five entries.
-        
+
         More Details
         More Details
-        
+
         Here is a diagram showing the where the names from the list
         Here is a diagram showing the where the names from the list
         are used:
         are used:
 
 
@@ -86,8 +86,8 @@ class FourState:
 
 
         Each states also has an associated on or off value.  The only
         Each states also has an associated on or off value.  The only
         state that is 'on' is state 4.  So, the transition states
         state that is 'on' is state 4.  So, the transition states
-        between off and on (states 1 and 3) are also considered 
-        off (and so is state 2 which is oposite of 4 and therefore 
+        between off and on (states 1 and 3) are also considered
+        off (and so is state 2 which is oposite of 4 and therefore
         oposite of 'on').
         oposite of 'on').
         """
         """
         assert self.debugPrint("FourState(names=%s)"%(names))
         assert self.debugPrint("FourState(names=%s)"%(names))
@@ -129,7 +129,7 @@ class FourState:
                            names[0],
                            names[0],
                           )
                           )
         self.fsm.enterInitialState()
         self.fsm.enterInitialState()
-    
+
     def setTrack(self, track):
     def setTrack(self, track):
         assert self.debugPrint("setTrack(track=%s)"%(track,))
         assert self.debugPrint("setTrack(track=%s)"%(track,))
         if self.track is not None:
         if self.track is not None:
@@ -138,18 +138,18 @@ class FourState:
         if track is not None:
         if track is not None:
             track.start(self.stateTime)
             track.start(self.stateTime)
             self.track = track
             self.track = track
-    
+
     def enterStateN(self, stateIndex):
     def enterStateN(self, stateIndex):
         self.stateIndex = stateIndex
         self.stateIndex = stateIndex
         self.duration = self.durations[stateIndex] or 0.0
         self.duration = self.durations[stateIndex] or 0.0
-    
+
     # The AI is the authority on setting the On value.
     # The AI is the authority on setting the On value.
     # If the client wants the state changed it needs to
     # If the client wants the state changed it needs to
     # send a request to the AI.
     # send a request to the AI.
     #def setIsOn(self, isOn):
     #def setIsOn(self, isOn):
     #    assert self.debugPrint("setIsOn(isOn=%s)"%(isOn,))
     #    assert self.debugPrint("setIsOn(isOn=%s)"%(isOn,))
     #    pass
     #    pass
-    
+
     def isOn(self):
     def isOn(self):
         assert self.debugPrint("isOn() returning %s (stateIndex=%s)"%(self.stateIndex==4, self.stateIndex))
         assert self.debugPrint("isOn() returning %s (stateIndex=%s)"%(self.stateIndex==4, self.stateIndex))
         return self.stateIndex==4
         return self.stateIndex==4
@@ -159,13 +159,13 @@ class FourState:
         Allow derived classes to overide this.
         Allow derived classes to overide this.
         """
         """
         assert self.debugPrint("changedOnState(isOn=%s)"%(isOn,))
         assert self.debugPrint("changedOnState(isOn=%s)"%(isOn,))
-    
+
     ##### state 0 #####
     ##### state 0 #####
-    
+
     def enterState0(self):
     def enterState0(self):
         assert self.debugPrint("enter0()")
         assert self.debugPrint("enter0()")
         self.enterStateN(0)
         self.enterStateN(0)
-    
+
     def exitState0(self):
     def exitState0(self):
         assert self.debugPrint("exit0()")
         assert self.debugPrint("exit0()")
         # It's important for FourStates to broadcast their state
         # It's important for FourStates to broadcast their state
@@ -173,45 +173,45 @@ class FourState:
         # if a door was generated and went directly to an 'open' state,
         # if a door was generated and went directly to an 'open' state,
         # it would not broadcast its state until it closed.
         # it would not broadcast its state until it closed.
         self.changedOnState(0)
         self.changedOnState(0)
-    
+
     ##### state 1 #####
     ##### state 1 #####
-    
+
     def enterState1(self):
     def enterState1(self):
         assert self.debugPrint("enterState1()")
         assert self.debugPrint("enterState1()")
         self.enterStateN(1)
         self.enterStateN(1)
-    
+
     def exitState1(self):
     def exitState1(self):
         assert self.debugPrint("exitState1()")
         assert self.debugPrint("exitState1()")
-    
+
     ##### state 2 #####
     ##### state 2 #####
-    
+
     def enterState2(self):
     def enterState2(self):
         assert self.debugPrint("enterState2()")
         assert self.debugPrint("enterState2()")
         self.enterStateN(2)
         self.enterStateN(2)
-    
+
     def exitState2(self):
     def exitState2(self):
         assert self.debugPrint("exitState2()")
         assert self.debugPrint("exitState2()")
-    
+
     ##### state 3 #####
     ##### state 3 #####
-    
+
     def enterState3(self):
     def enterState3(self):
         assert self.debugPrint("enterState3()")
         assert self.debugPrint("enterState3()")
         self.enterStateN(3)
         self.enterStateN(3)
-    
+
     def exitState3(self):
     def exitState3(self):
         assert self.debugPrint("exitState3()")
         assert self.debugPrint("exitState3()")
-    
+
     ##### state 4 #####
     ##### state 4 #####
-    
+
     def enterState4(self):
     def enterState4(self):
         assert self.debugPrint("enterState4()")
         assert self.debugPrint("enterState4()")
         self.enterStateN(4)
         self.enterStateN(4)
         self.changedOnState(1)
         self.changedOnState(1)
-    
+
     def exitState4(self):
     def exitState4(self):
         assert self.debugPrint("exitState4()")
         assert self.debugPrint("exitState4()")
         self.changedOnState(0)
         self.changedOnState(0)
-    
+
     if __debug__:
     if __debug__:
         def debugPrint(self, message):
         def debugPrint(self, message):
             """for debugging"""
             """for debugging"""

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

@@ -14,15 +14,15 @@ from direct.task import Task
 class FourStateAI:
 class FourStateAI:
     """
     """
     Generic four state ClassicFSM base class.
     Generic four state ClassicFSM base class.
-    
+
     This is a mix-in class that expects that your derived class
     This is a mix-in class that expects that your derived class
     is a DistributedObjectAI.
     is a DistributedObjectAI.
-    
-    Inherit from FourStateFSM and pass in your states.  Two of 
-    the states should be oposites of each other and the other 
+
+    Inherit from FourStateFSM and pass in your states.  Two of
+    the states should be oposites of each other and the other
     two should be the transition states between the first two.
     two should be the transition states between the first two.
     E.g.
     E.g.
-    
+
                     +--------+
                     +--------+
                  -->| closed | --
                  -->| closed | --
                 |   +--------+   |
                 |   +--------+   |
@@ -36,10 +36,10 @@ class FourStateAI:
                 |    +------+    |
                 |    +------+    |
                  ----| open |<---
                  ----| open |<---
                      +------+
                      +------+
-    
+
     There is a fifth off state, but that is an implementation
     There is a fifth off state, but that is an implementation
     detail (and that's why it's not called a five state ClassicFSM).
     detail (and that's why it's not called a five state ClassicFSM).
-    
+
     I found that this pattern repeated in several things I was
     I found that this pattern repeated in several things I was
     working on, so this base class was created.
     working on, so this base class was created.
     """
     """
@@ -56,16 +56,16 @@ class FourStateAI:
 
 
             e.g. 3:
             e.g. 3:
                 ['off', 'deactivating', 'deactive', 'activating', 'activated',]
                 ['off', 'deactivating', 'deactive', 'activating', 'activated',]
-        
+
         durations is a list of durations in seconds or None values.
         durations is a list of durations in seconds or None values.
             The list of duration values should be the same length
             The list of duration values should be the same length
             as the list of state names and the lists correspond.
             as the list of state names and the lists correspond.
-            For each state, after n seconds, the ClassicFSM will move to 
+            For each state, after n seconds, the ClassicFSM will move to
             the next state.  That does not happen for any duration
             the next state.  That does not happen for any duration
             values of None.
             values of None.
-        
+
         More Details
         More Details
-        
+
         Here is a diagram showing the where the names from the list
         Here is a diagram showing the where the names from the list
         are used:
         are used:
 
 
@@ -89,8 +89,8 @@ class FourStateAI:
 
 
         Each states also has an associated on or off value.  The only
         Each states also has an associated on or off value.  The only
         state that is 'on' is state 4.  So, the transition states
         state that is 'on' is state 4.  So, the transition states
-        between off and on (states 1 and 3) are also considered 
-        off (and so is state 2 which is oposite of state 4 and therefore 
+        between off and on (states 1 and 3) are also considered
+        off (and so is state 2 which is oposite of state 4 and therefore
         oposite of 'on').
         oposite of 'on').
         """
         """
         assert self.debugPrint(
         assert self.debugPrint(
@@ -143,15 +143,15 @@ class FourStateAI:
             del self.doLaterTask
             del self.doLaterTask
         del self.states
         del self.states
         del self.fsm
         del self.fsm
-    
+
     def getState(self):
     def getState(self):
         assert self.debugPrint("getState() returning %s"%(self.stateIndex,))
         assert self.debugPrint("getState() returning %s"%(self.stateIndex,))
         return [self.stateIndex]
         return [self.stateIndex]
-    
+
     def sendState(self):
     def sendState(self):
         assert self.debugPrint("sendState()")
         assert self.debugPrint("sendState()")
         self.sendUpdate('setState', self.getState())
         self.sendUpdate('setState', self.getState())
-    
+
     def setIsOn(self, isOn):
     def setIsOn(self, isOn):
         assert self.debugPrint("setIsOn(isOn=%s)"%(isOn,))
         assert self.debugPrint("setIsOn(isOn=%s)"%(isOn,))
         if isOn:
         if isOn:
@@ -168,7 +168,7 @@ class FourStateAI:
         #    nextState = (2, 2, None, 1, 1)[self.stateIndex]
         #    nextState = (2, 2, None, 1, 1)[self.stateIndex]
         #if nextState is not None:
         #if nextState is not None:
         #    self.fsm.request(self.states[nextState])
         #    self.fsm.request(self.states[nextState])
-    
+
     def isOn(self):
     def isOn(self):
         assert self.debugPrint("isOn() returning %s (stateIndex=%s)"%(self.stateIndex==4, self.stateIndex))
         assert self.debugPrint("isOn() returning %s (stateIndex=%s)"%(self.stateIndex==4, self.stateIndex))
         return self.stateIndex==4
         return self.stateIndex==4
@@ -190,12 +190,12 @@ class FourStateAI:
 
 
     def distributeStateChange(self):
     def distributeStateChange(self):
         """
         """
-        This function is intentionaly simple so that derived classes 
+        This function is intentionaly simple so that derived classes
         may easily alter the network message.
         may easily alter the network message.
         """
         """
         assert self.debugPrint("distributeStateChange()")
         assert self.debugPrint("distributeStateChange()")
         self.sendState()
         self.sendState()
-    
+
     def enterStateN(self, stateIndex, nextStateIndex):
     def enterStateN(self, stateIndex, nextStateIndex):
         assert self.debugPrint(
         assert self.debugPrint(
             "enterStateN(stateIndex=%s, nextStateIndex=%s)"%
             "enterStateN(stateIndex=%s, nextStateIndex=%s)"%
@@ -209,64 +209,64 @@ class FourStateAI:
                 self.durations[stateIndex],
                 self.durations[stateIndex],
                 self.switchToNextStateTask,
                 self.switchToNextStateTask,
                 "enterStateN-timer-%s"%id(self))
                 "enterStateN-timer-%s"%id(self))
-    
+
     def exitStateN(self):
     def exitStateN(self):
         assert self.debugPrint("exitStateN()")
         assert self.debugPrint("exitStateN()")
         if self.doLaterTask:
         if self.doLaterTask:
             taskMgr.remove(self.doLaterTask)
             taskMgr.remove(self.doLaterTask)
             self.doLaterTask=None
             self.doLaterTask=None
-    
+
     ##### state 0 #####
     ##### state 0 #####
-    
+
     def enterState0(self):
     def enterState0(self):
         assert self.debugPrint("enter0()")
         assert self.debugPrint("enter0()")
         self.enterStateN(0, 0)
         self.enterStateN(0, 0)
-    
+
     def exitState0(self):
     def exitState0(self):
         assert self.debugPrint("exit0()")
         assert self.debugPrint("exit0()")
-    
+
     ##### state 1 #####
     ##### state 1 #####
-    
+
     def enterState1(self):
     def enterState1(self):
         #assert self.debugPrint("enterState1()")
         #assert self.debugPrint("enterState1()")
         self.enterStateN(1, 2)
         self.enterStateN(1, 2)
-    
+
     def exitState1(self):
     def exitState1(self):
         assert self.debugPrint("exitState1()")
         assert self.debugPrint("exitState1()")
         self.exitStateN()
         self.exitStateN()
-    
+
     ##### state 2 #####
     ##### state 2 #####
-    
+
     def enterState2(self):
     def enterState2(self):
         #assert self.debugPrint("enterState2()")
         #assert self.debugPrint("enterState2()")
         self.enterStateN(2, 3)
         self.enterStateN(2, 3)
-    
+
     def exitState2(self):
     def exitState2(self):
         assert self.debugPrint("exitState2()")
         assert self.debugPrint("exitState2()")
         self.exitStateN()
         self.exitStateN()
-    
+
     ##### state 3 #####
     ##### state 3 #####
-    
+
     def enterState3(self):
     def enterState3(self):
         #assert self.debugPrint("enterState3()")
         #assert self.debugPrint("enterState3()")
         self.enterStateN(3, 4)
         self.enterStateN(3, 4)
-    
+
     def exitState3(self):
     def exitState3(self):
         assert self.debugPrint("exitState3()")
         assert self.debugPrint("exitState3()")
         self.exitStateN()
         self.exitStateN()
-    
+
     ##### state 4 #####
     ##### state 4 #####
-    
+
     def enterState4(self):
     def enterState4(self):
         assert self.debugPrint("enterState4()")
         assert self.debugPrint("enterState4()")
         self.enterStateN(4, 1)
         self.enterStateN(4, 1)
         self.changedOnState(1)
         self.changedOnState(1)
-    
+
     def exitState4(self):
     def exitState4(self):
         assert self.debugPrint("exitState4()")
         assert self.debugPrint("exitState4()")
         self.exitStateN()
         self.exitStateN()
         self.changedOnState(0)
         self.changedOnState(0)
-    
+
     if __debug__:
     if __debug__:
         def debugPrint(self, message):
         def debugPrint(self, message):
             """for debugging"""
             """for debugging"""

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

@@ -145,7 +145,7 @@ class ToonEyes(FSM.FSM):
 ## exitRed(self, 'Red', 'Green')
 ## exitRed(self, 'Red', 'Green')
 ## enterGreen(self, 'Red', 'Green')
 ## enterGreen(self, 'Red', 'Green')
 ## ('Green',)
 ## ('Green',)
-## >>> 
+## >>>
 
 
 ####
 ####
 #### Example of using NewStyle:
 #### Example of using NewStyle:
@@ -175,7 +175,7 @@ class ToonEyes(FSM.FSM):
 ## exitRed(self, 'Red', 'Green')
 ## exitRed(self, 'Red', 'Green')
 ## enterGreen(self, 'Red', 'Green')
 ## enterGreen(self, 'Red', 'Green')
 ## ('Green',)
 ## ('Green',)
-## >>> 
+## >>>
 
 
 ####
 ####
 #### Example of using ToonEyes:
 #### Example of using ToonEyes:
@@ -193,4 +193,4 @@ class ToonEyes(FSM.FSM):
 ## swap in eyes surprised model
 ## swap in eyes surprised model
 ## ('Surprised',)
 ## ('Surprised',)
 ## >>> eyes.request('blink')
 ## >>> eyes.request('blink')
-## >>> 
+## >>>

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

@@ -23,7 +23,7 @@ class State(DirectObject):
         @classmethod
         @classmethod
         def replaceMethod(self, oldFunction, newFunction):
         def replaceMethod(self, oldFunction, newFunction):
             import types
             import types
-            count = 0        
+            count = 0
             for state in self.States:
             for state in self.States:
                 # Note: you can only replace methods currently
                 # Note: you can only replace methods currently
                 enterFunc = state.getEnterFunc()
                 enterFunc = state.getEnterFunc()
@@ -99,7 +99,7 @@ class State(DirectObject):
     def isTransitionDefined(self, otherState):
     def isTransitionDefined(self, otherState):
         if self.transitionsToAny():
         if self.transitionsToAny():
             return 1
             return 1
-        
+
         # if we're given a state object, get its name instead
         # if we're given a state object, get its name instead
         if type(otherState) != type(''):
         if type(otherState) != type(''):
             otherState = otherState.getName()
             otherState = otherState.getName()

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

@@ -20,7 +20,7 @@ class StateData(DirectObject):
         self.doneStatus = None
         self.doneStatus = None
         self.isLoaded = 0
         self.isLoaded = 0
         self.isEntered = 0
         self.isEntered = 0
-    
+
     def enter(self):
     def enter(self):
         """
         """
         Enters the StateData.  This makes it active in whatever sense
         Enters the StateData.  This makes it active in whatever sense

+ 3 - 3
direct/src/fsm/StatePush.py

@@ -249,7 +249,7 @@ class FunctionCall(ReceivesMultipleStateChanges, PushesStateChanges):
         if self._initialized:
         if self._initialized:
             self._func(*self._bakedArgs, **self._bakedKargs)
             self._func(*self._bakedArgs, **self._bakedKargs)
             PushesStateChanges._handleStateChange(self)
             PushesStateChanges._handleStateChange(self)
-        
+
 if __debug__:
 if __debug__:
     l = []
     l = []
     def handler(value, l=l):
     def handler(value, l=l):
@@ -351,7 +351,7 @@ class Pulse(PushesStateChanges):
     def sendPulse(self):
     def sendPulse(self):
         self._handlePotentialStateChange(True)
         self._handlePotentialStateChange(True)
         self._handlePotentialStateChange(False)
         self._handlePotentialStateChange(False)
-    
+
 if __debug__:
 if __debug__:
     l = []
     l = []
     def handler(value, l=l):
     def handler(value, l=l):
@@ -393,7 +393,7 @@ class EventArgument(PushesStateChanges, DirectObject):
         self.ignoreAll()
         self.ignoreAll()
         del self._index
         del self._index
         PushesStateChanges.destroy(self)
         PushesStateChanges.destroy(self)
-        
+
     def _handleEvent(self, *args):
     def _handleEvent(self, *args):
         self._handlePotentialStateChange(args[self._index])
         self._handlePotentialStateChange(args[self._index])
 
 

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

@@ -47,7 +47,7 @@ class DirectButton(DirectFrame):
 
 
         # Initialize superclasses
         # Initialize superclasses
         DirectFrame.__init__(self, parent)
         DirectFrame.__init__(self, parent)
-        
+
         # If specifed, add scaling to the pressed state to make it
         # If specifed, add scaling to the pressed state to make it
         # look like the button is moving when you press it.  We have
         # look like the button is moving when you press it.  We have
         # to set up the node first, before we call initialise options;
         # to set up the node first, before we call initialise options;
@@ -57,7 +57,7 @@ class DirectButton(DirectFrame):
         if self['pressEffect']:
         if self['pressEffect']:
             pressEffectNP = self.stateNodePath[1].attachNewNode('pressEffect', 1)
             pressEffectNP = self.stateNodePath[1].attachNewNode('pressEffect', 1)
             self.stateNodePath[1] = pressEffectNP
             self.stateNodePath[1] = pressEffectNP
-            
+
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectButton)
         self.initialiseoptions(DirectButton)
 
 
@@ -101,7 +101,7 @@ class DirectButton(DirectFrame):
         if self['command']:
         if self['command']:
             # Pass any extra args to command
             # Pass any extra args to command
             apply(self['command'], self['extraArgs'])
             apply(self['command'], self['extraArgs'])
-            
+
     def setClickSound(self):
     def setClickSound(self):
         clickSound = self['clickSound']
         clickSound = self['clickSound']
         # Clear out sounds
         # Clear out sounds

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно