Browse Source

*** empty log message ***

Joe Shochet 25 years ago
parent
commit
f76bbb1cd7
2 changed files with 26 additions and 27 deletions
  1. 1 1
      direct/src/showbase/Loader.py
  2. 25 26
      direct/src/showbase/Transitions.py

+ 1 - 1
direct/src/showbase/Loader.py

@@ -65,7 +65,7 @@ class Loader:
         anyway--it prevents accumulation of instances of the font
         anyway--it prevents accumulation of instances of the font
         model under hidden."""
         model under hidden."""
         
         
-        Loader.notify.info("Loading model for node: %s" % (modelPath))
+        Loader.notify.info("Loading model once node: %s" % (modelPath))
         return ModelPool.loadModel(modelPath)
         return ModelPool.loadModel(modelPath)
 
 
     def unloadModel(self, modelPath):
     def unloadModel(self, modelPath):

+ 25 - 26
direct/src/showbase/Transitions.py

@@ -10,7 +10,7 @@ class Transitions:
         self.fade.setBin("fixed", 1000)
         self.fade.setBin("fixed", 1000)
 
 
         self.iris.setPos(0,0,0)
         self.iris.setPos(0,0,0)
-        self.fade.setScale(2.0, 2.0, 2.6666)
+        self.fade.setScale(3)
 
 
         self.irisTaskName = "irisTask"
         self.irisTaskName = "irisTask"
         self.fadeTaskName = "fadeTask"
         self.fadeTaskName = "fadeTask"
@@ -20,17 +20,17 @@ class Transitions:
         self.fade.reparentTo(hidden)
         self.fade.reparentTo(hidden)
         return Task.done
         return Task.done
             
             
-    def fadeIn(self, t=0.4, block=0):
+    def fadeIn(self, t=0.5, block=0):
         """
         """
         Play a fade in transition over t seconds.
         Play a fade in transition over t seconds.
-        Places a polygon on the render2d plane then lerps the color
+        Places a polygon on the aspect2d plane then lerps the color
         from black to transparent. When the color lerp is finished, it
         from black to transparent. When the color lerp is finished, it
         parents the fade polygon to hidden. If block is set, return the
         parents the fade polygon to hidden. If block is set, return the
         sequence instead of spawning it.
         sequence instead of spawning it.
         """
         """
         self.noTransitions()
         self.noTransitions()
 
 
-	self.fade.reparentTo(render2d)
+	self.fade.reparentTo(aspect2d)
 
 
         if (t == 0):
         if (t == 0):
             # Fade in immediately with no lerp
             # Fade in immediately with no lerp
@@ -49,25 +49,25 @@ class Transitions:
             else:
             else:
                 return task
                 return task
             
             
-    def fadeInTask(self, task, time=0.4):
+    def fadeInTask(self, task, time=0.5):
         """
         """
         As a sequence: Fade in, execute the given task
         As a sequence: Fade in, execute the given task
         """
         """
         seq = Task.sequence(self.fadeIn(time, block=1), task)
         seq = Task.sequence(self.fadeIn(time, block=1), task)
         taskMgr.spawnTaskNamed(seq, 'fadeInTaskSeq')
         taskMgr.spawnTaskNamed(seq, 'fadeInTaskSeq')
 
 
-    def fadeOut(self, t=0.4, block=0):
+    def fadeOut(self, t=0.5, block=0):
         """
         """
         Play a fade out transition over t seconds.
         Play a fade out transition over t seconds.
-        Places a polygon on the render2d plane then lerps the color
+        Places a polygon on the aspect2d plane then lerps the color
         from transparent to full black. When the color lerp is finished,
         from transparent to full black. When the color lerp is finished,
-        it leaves the fade polygon covering the render2d plane until you
+        it leaves the fade polygon covering the aspect2d plane until you
         fadeIn or call noFade. If block is set to 1, performs blocking
         fadeIn or call noFade. If block is set to 1, performs blocking
         lerp
         lerp
         """
         """
         self.noTransitions()
         self.noTransitions()
 
 
-	self.fade.reparentTo(render2d)
+	self.fade.reparentTo(aspect2d)
 
 
         if (t == 0):
         if (t == 0):
             # Fade out immediately with no lerp
             # Fade out immediately with no lerp
@@ -83,7 +83,7 @@ class Transitions:
                                 0,0,0,1,
                                 0,0,0,1,
                                 t)
                                 t)
 
 
-    def fadeOutTask(self, task, time=0.4, noFade=1):
+    def fadeOutTask(self, task, time=0.5, noFade=1):
         """
         """
         As a sequence: Fade out, execute the given task, then do a noFade
         As a sequence: Fade out, execute the given task, then do a noFade
         if requested
         if requested
@@ -113,10 +113,10 @@ class Transitions:
         self.iris.reparentTo(hidden)
         self.iris.reparentTo(hidden)
         return Task.done
         return Task.done
 
 
-    def irisIn(self, t=0.4, block=0):
+    def irisIn(self, t=0.5, block=0):
         """
         """
         Play an iris in transition over t seconds.
         Play an iris in transition over t seconds.
-        Places a polygon on the render2d plane then lerps the scale
+        Places a polygon on the aspect2d plane then lerps the scale
         of the iris polygon up so it looks like we iris in. When the
         of the iris polygon up so it looks like we iris in. When the
         scale lerp is finished, it parents the iris polygon to hidden.
         scale lerp is finished, it parents the iris polygon to hidden.
         If block is true, does not execute lerp, but returns the sequence.
         If block is true, does not execute lerp, but returns the sequence.
@@ -126,13 +126,13 @@ class Transitions:
         if (t == 0):
         if (t == 0):
             self.iris.reparentTo(hidden)
             self.iris.reparentTo(hidden)
         else:
         else:
-            self.iris.reparentTo(render2d)
-            self.iris.setScale(0.0015, 0.0015, 0.002)
+            self.iris.reparentTo(aspect2d)
+            self.iris.setScale(0.0015)
             # Create a sequence that scales the iris up,
             # Create a sequence that scales the iris up,
             # then parents the fade to hidden
             # then parents the fade to hidden
             task = Task.sequence(
             task = Task.sequence(
-                self.iris.lerpScale(0.1, 0.1, 0.1333,
-                                    t, blendType="easeIn"),
+                self.iris.lerpScale(0.18, 0.18, 0.18,
+                                    t, blendType="noBlend"),
                 Task.Task(self.irisInLerpDone))
                 Task.Task(self.irisInLerpDone))
             # Spawn the sequence
             # Spawn the sequence
             if not block:
             if not block:
@@ -140,7 +140,7 @@ class Transitions:
             else:
             else:
                 return task
                 return task
             
             
-    def irisInTask(self, task, time=0.4):
+    def irisInTask(self, task, time=0.5):
         """
         """
         As a sequence: iris in, execute the given task
         As a sequence: iris in, execute the given task
         """
         """
@@ -154,26 +154,25 @@ class Transitions:
         self.fadeOut(0)
         self.fadeOut(0)
         return Task.done
         return Task.done
 
 
-    def irisOut(self, t=0.4, block=0):
+    def irisOut(self, t=0.5, block=0):
         """
         """
         Play an iris out transition over t seconds.
         Play an iris out transition over t seconds.
-        Places a polygon on the render2d plane then lerps the scale
+        Places a polygon on the aspect2d plane then lerps the scale
         of the iris down so it looks like we iris out. When the scale
         of the iris down so it looks like we iris out. When the scale
         lerp is finished, it leaves the iris polygon covering the
         lerp is finished, it leaves the iris polygon covering the
-        render2d plane until you irisIn or call noIris.
+        aspect2d plane until you irisIn or call noIris.
         """
         """
 	self.noTransitions()
 	self.noTransitions()
-
         if (t == 0):
         if (t == 0):
             self.iris.reparentTo(hidden)
             self.iris.reparentTo(hidden)
         else:
         else:
-            self.iris.reparentTo(render2d)
-            self.iris.setScale(0.1, 0.1, 0.13333)
+            self.iris.reparentTo(aspect2d)
+            self.iris.setScale(0.18)
             # Create a sequence that scales the iris up,
             # Create a sequence that scales the iris up,
             # then parents the fade to hidden
             # then parents the fade to hidden
             task = Task.sequence(
             task = Task.sequence(
-                self.iris.lerpScale(0.0015, 0.0015, 0.002,
-                                    t, blendType="easeIn"),
+                self.iris.lerpScale(0.0015, 0.0015, 0.0015,
+                                    t, blendType="noBlend"),
                 Task.Task(self.irisOutLerpDone))
                 Task.Task(self.irisOutLerpDone))
             # Spawn the sequence
             # Spawn the sequence
             if not block:
             if not block:
@@ -181,7 +180,7 @@ class Transitions:
             else:
             else:
                 return task
                 return task
 
 
-    def irisOutTask(self, task, time=0.4, noIris=1):
+    def irisOutTask(self, task, time=0.5, noIris=1):
         """
         """
         As a sequence: iris out, execute the given task, then do a noIris
         As a sequence: iris out, execute the given task, then do a noIris
         if requested
         if requested