def _parse_motion(self, bvh):
    if (bvh[self.current_token][0] != 'IDENT'):
        print('Unexpected text')
        return None
    if (bvh[self.current_token][1] != 'MOTION'):
        print('No motion section')
        return None
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Frames'):
        return None
    self.current_token = (self.current_token + 1)
    frame_count = int(bvh[self.current_token][1])
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Frame'):
        return None
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Time'):
        return None
    self.current_token = (self.current_token + 1)
    frame_rate = float(bvh[self.current_token][1])
    self.framerate = frame_rate
    self.current_token = (self.current_token + 1)
    frame_time = 0.0
    self._motions = ([()] * frame_count)
    for i in range(frame_count):
        channel_values = []
        for channel in self._motion_channels:
            channel_values.append((channel[0], channel[1], float(bvh[self.current_token][1])))
            self.current_token = (self.current_token + 1)
        self._motions[i] = (frame_time, channel_values)
        frame_time = (frame_time + frame_rate)
def _parse_motion(self, bvh):
    if (bvh[self.current_token][0] != 'IDENT'):
        print('Unexpected text')
        return None
    if (bvh[self.current_token][1] != 'MOTION'):
        print('No motion section')
        return None
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Frames'):
        return None
    self.current_token = (self.current_token + 1)
    frame_count = int(bvh[self.current_token][1])
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Frame'):
        return None
    self.current_token = (self.current_token + 1)
    if (bvh[self.current_token][1] != 'Time'):
        return None
    self.current_token = (self.current_token + 1)
    frame_rate = float(bvh[self.current_token][1])
    self.framerate = frame_rate
    self.current_token = (self.current_token + 1)
    frame_time = 0.0
    self._motions = ([()] * frame_count)
    for i in range(frame_count):
        channel_values = []
        for channel in self._motion_channels:
            channel_values.append((channel[0], channel[1], float(bvh[self.current_token][1])))
            self.current_token = (self.current_token + 1)
        self._motions[i] = (frame_time, channel_values)
        frame_time = (frame_time + frame_rate)