Browse Source

*** empty log message ***

Mark Mine 23 years ago
parent
commit
6d1c202f0d
2 changed files with 15 additions and 6 deletions
  1. 1 4
      direct/src/directtools/DirectLights.py
  2. 14 2
      direct/src/tkpanels/MopathRecorder.py

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

@@ -24,12 +24,9 @@ class DirectLight(NodePath):
         return self.light
 
 class DirectLights(NodePath):
-    def __init__(self, parent = None):
+    def __init__(self, parent = render):
         # Initialize the superclass
         NodePath.__init__(self)
-        # Use direct.group as default parent
-        if parent == None:
-            parent = direct.group
         # Create a node for the lights
         self.assign(parent.attachNewNode('DIRECT Lights'))
         # Create a light attrib

+ 14 - 2
direct/src/tkpanels/MopathRecorder.py

@@ -73,6 +73,8 @@ class MopathRecorder(AppShell, PandaObject):
         self.playbackMarker = loader.loadModel('models/misc/smiley')
         self.playbackMarker.setName('Playback Marker')
         self.playbackMarker.reparentTo(self.recorderNodePath)
+        self.playbackMarkerIds = self.getChildIds(
+            self.playbackMarker.getChild(0))
         self.playbackMarker.hide()
         # Tangent marker
         self.tangentGroup = self.playbackMarker.attachNewNode('Tangent Group')
@@ -82,6 +84,8 @@ class MopathRecorder(AppShell, PandaObject):
         self.tangentMarker.setScale(0.5)
         self.tangentMarker.setColor(1,0,1,1)
         self.tangentMarker.setName('Tangent Marker')
+        self.tangentMarkerIds = self.getChildIds(
+            self.tangentMarker.getChild(0))
         self.tangentLines = LineNodePath(self.tangentGroup)
         self.tangentLines.setColor(VBase4(1,0,1,1))
         self.tangentLines.setThickness(1)
@@ -656,9 +660,10 @@ class MopathRecorder(AppShell, PandaObject):
         marker if subnode selected
         """
         taskMgr.remove(self.name + '-curveEditTask')
-        if nodePath.id() == self.playbackMarker.getChild(0).id():
+        print nodePath.id()
+        if nodePath.id() in self.playbackMarkerIds:
             direct.select(self.playbackMarker)
-        elif nodePath.id() == self.tangentMarker.getChild(0).id():
+        elif nodePath.id() in self.tangentMarkerIds:
             direct.select(self.tangentMarker)
         elif nodePath.id() == self.playbackMarker.id():
             self.tangentGroup.show()
@@ -671,6 +676,13 @@ class MopathRecorder(AppShell, PandaObject):
         else:
             self.tangentGroup.hide()
 
+    def getChildIds(self, nodePath):
+        ids = [nodePath.id()]
+        kids = nodePath.getChildrenAsList()
+        for kid in kids:
+            ids += self.getChildIds(kid)
+        return ids
+
     def deselectedNodePathHook(self, nodePath):
         """
         Hook called upon deselection of a node path used to select playback