Esempio n. 1
0
    def __init__(
        self, minwaitlen=0.1, maxwaitlen=0.6, burstlen=0.14, burstintensity=1, offintensity=0.05, tracklen=500
    ):
        "times are in seconds (floats)"
        make_attributes_from_args("burstlen", "burstintensity", "offintensity")
        self.burstintervals = []
        timecursor = 0

        while timecursor < tracklen:
            waitlen = minwaitlen + (random.random() * (maxwaitlen - minwaitlen))
            timecursor += waitlen
            self.burstintervals.append((timecursor, timecursor + burstlen))
Esempio n. 2
0
    def __init__(self, name, tracks, rate=1, direction=FORWARD):
        """
        Most/all of this is old:

        You can have multiple FunctionFrames at the same time.  Their
        order is important though, since FunctionFrames will be applied
        in the order seen in this list.  blenders is a list of Blenders.
        rate is the rate of playback.  If set to 1, 1 unit inside the
        Timeline will be 1 second.  direction is the initial direction.
        If you want to do have looping, place a LoopFunction at the end of
        the Timeline.  Timelines don't have a set length.  Their length
        is bounded by their last frame.  You can put an EmptyFrame at
        some time if you want to extend a Timeline."""

        make_attributes_from_args("name", "tracks", "rate", "direction")
        self.current_time = 0
        self.last_clock_time = None
        self.stopped = 1
Esempio n. 3
0
 def __init__(self, time, frame=MISSING, blender=None, level=1.0):
     make_attributes_from_args("time", "frame")
     self.next_blender = blender
     self.level = level
Esempio n. 4
0
 def __init__(self, period, onlevel=1, offlevel=0):
     "times are in seconds (floats)"
     make_attributes_from_args("period", "onlevel", "offlevel")
Esempio n. 5
0
 def __init__(self, ontime, offtime, onlevel=1, offlevel=0):
     "times are in seconds (floats)"
     make_attributes_from_args("ontime", "offtime", "onlevel", "offlevel")
     self.cycletime = ontime + offtime
Esempio n. 6
0
 def __init__(self, timedevent):
     make_attributes_from_args("timedevent")
     Exception.__init__(self, "%r is missing a blender." % self.timedevent)