2 # -*- mode: python; tab-width: 4; indent-tabs-mode: t; -*-
5 # ***** BEGIN GPL LICENSE BLOCK *****
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software Foundation,
19 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # The Original Code is Copyright (C) 2008 by the Blender Foundation
22 # All rights reserved.
24 # The Original Code is: see repository.
26 # Contributor(s): see repository.
34 nanblenderhome = os.getenv("NANBLENDERHOME")
36 if nanblenderhome == None:
37 nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0])) + "/.."
39 config = nanblenderhome + "/source/blender/blenkernel/BKE_blender.h"
46 for line in infile.readlines():
47 m = re.search("#define BLENDER_VERSION\s+(\d+)", line)
50 m = re.search("#define BLENDER_SUBVERSION\s+(\d+)", line)
54 major = float(major) / 100.0
59 # Major was changed to float, but minor is still a string
64 print "%.2f.%s" % (major, minor)
66 print "unknownversion"