Patch T41093: Cleanup non-manifold
[blender-addons.git] / render_renderfarmfi / ore_session.py
blob0f8cc4efa7acae5cc2a5a44f3cf6a090c126f208
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 from math import floor
21 class OreSession:
23 def __init__(self, id, title):
24 self.id = id
25 self.title = title
26 self.frames = 0
27 self.startframe = 0
28 self.endframe = 0
29 self.rendertime = 0
30 self.percentage = 0
32 def percentageComplete(self):
33 totFrames = self.endframe - self.startframe
34 done = 0
35 if totFrames != 0:
36 done = floor((self.frames / totFrames)*100)
38 if done > 100:
39 done = 100
40 return done