Package toon :: Module seq
[hide private]
[frames] | no frames]

Source Code for Module toon.seq

 1  #!/usr/bin/env python 
 2  # 
 3  # Toonloop for Python 
 4  # 
 5  # Copyright 2008 Alexandre Quessy & Tristan Matthews 
 6  # <alexandre@quessy.net> & <le.businessman@gmail.com> 
 7  # http://www.toonloop.com 
 8  # 
 9  # Original idea by Alexandre Quessy 
10  # http://alexandre.quessy.net 
11  # 
12  # Toonloop is free software: you can redistribute it and/or modify 
13  # it under the terms of the GNU General Public License as published by 
14  # the Free Software Foundation, either version 3 of the License, or 
15  # (at your option) any later version. 
16  # 
17  # Toonloop is distributed in the hope that it will be useful, 
18  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
19  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
20  # GNU General Public License for more details. 
21  # 
22  # You should have received a copy of the gnu general public license 
23  # along with Toonloop.  If not, see <http://www.gnu.org/licenses/>. 
24  # 
25  from rats.serialize import Serializable 
26   
27 -class ToonSequence(Serializable):
28 """ 29 Not used yet !!!!!! 30 31 Toonloop sequence. 32 33 A sequence is made of many shots. 34 35 An act include one or more sequences; sequences comprise one or more scenes; 36 and scenes may be thought of as being built out of shots (if one is thinking visually) 37 or beats (if one is thinking in narrative terms). 38 """ 39 # TODO: use it !
40 - def __init__(self, **argd):
41 self.shots_ids = [] 42 # end of overridable attributes 43 self.__dict__.update(argd)
44
45 -def load_image(file_name, colorkey=None):
46 """ 47 Loads an image file. 48 returns surface, width, height 49 """ 50 try: 51 image = pygame.image.load(file_name) 52 except pygame.error, message: 53 print 'Cannot load image:', file_name 54 image = image.convert() 55 56 if colorkey is not None: 57 if colorkey is -1: 58 colorkey = image.get_at((0,0)) 59 image.set_colorkey(colorkey, RLEACCEL) 60 return image, image.get_rect()
61 62 # class ToonClip : 63 64 # to do: 65 #self.writehead = 0 66 #self.images_file_names = [] 67 #self._intervalometer_delayed_id = None 68 #self.intervalometer_enabled = False 69 #self.intervalometer_rate_seconds = 0.1 70 71 # class ToonProject(object): 72 # """ 73 # Project file with clips and sequences. 74 # 75 # Serializes project and save image files. 76 # """ 77 # def __init__(self, name, **kwargs): 78 # self.path = os.path.expanduser("~/toonloop") 79 # self.name = "toonloop" 80 # self.datetime = self.now() 81 # self.__dict__.update(argd) 82 # # self.clips = [] 83 # 84 # def now(self): 85 # return strftime("%Y-%m-%d_%Hh%Mm%S") 86 # 87 # def __str__(self): 88 # """ 89 # Full path of the project folder. 90 # """ 91 # return "%s/%s_%s" % (self.path, self.name, self.datetime) 92