Cleanup: remove unused operator args
[blender-addons.git] / io_scene_fbx / data_types.py
blob129806c991b6c3cb13a70763b0441ebb3ee5df78
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 # <pep8 compliant>
21 # Script copyright (C) 2006-2012, assimp team
22 # Script copyright (C) 2013 Blender Foundation
24 BOOL = b'C'[0]
25 INT16 = b'Y'[0]
26 INT32 = b'I'[0]
27 INT64 = b'L'[0]
28 FLOAT32 = b'F'[0]
29 FLOAT64 = b'D'[0]
30 BYTES = b'R'[0]
31 STRING = b'S'[0]
32 INT32_ARRAY = b'i'[0]
33 INT64_ARRAY = b'l'[0]
34 FLOAT32_ARRAY = b'f'[0]
35 FLOAT64_ARRAY = b'd'[0]
36 BOOL_ARRAY = b'b'[0]
37 BYTE_ARRAY = b'c'[0]
39 # Some other misc defines
40 # Known combinations so far - supposed meaning: A = animatable, A+ = animated, U = UserProp
41 # VALID_NUMBER_FLAGS = {b'A', b'A+', b'AU', b'A+U'} # Not used...
43 # array types - actual length may vary (depending on underlying C implementation)!
44 import array
46 # For now, bytes and bool are assumed always 1byte.
47 ARRAY_BOOL = 'b'
48 ARRAY_BYTE = 'B'
50 ARRAY_INT32 = None
51 ARRAY_INT64 = None
52 for _t in 'ilq':
53 size = array.array(_t).itemsize
54 if size == 4:
55 ARRAY_INT32 = _t
56 elif size == 8:
57 ARRAY_INT64 = _t
58 if ARRAY_INT32 and ARRAY_INT64:
59 break
60 if not ARRAY_INT32:
61 raise Exception("Impossible to get a 4-bytes integer type for array!")
62 if not ARRAY_INT64:
63 raise Exception("Impossible to get an 8-bytes integer type for array!")
65 ARRAY_FLOAT32 = None
66 ARRAY_FLOAT64 = None
67 for _t in 'fd':
68 size = array.array(_t).itemsize
69 if size == 4:
70 ARRAY_FLOAT32 = _t
71 elif size == 8:
72 ARRAY_FLOAT64 = _t
73 if ARRAY_FLOAT32 and ARRAY_FLOAT64:
74 break
75 if not ARRAY_FLOAT32:
76 raise Exception("Impossible to get a 4-bytes float type for array!")
77 if not ARRAY_FLOAT64:
78 raise Exception("Impossible to get an 8-bytes float type for array!")