diff options
author | Daniel M. Basso <danielmbasso@gmail.com> | 2012-07-10 18:22:10 +0400 |
---|---|---|
committer | Daniel M. Basso <danielmbasso@gmail.com> | 2012-07-10 18:22:10 +0400 |
commit | 49ecb6cf0da19854afcb938013d9034957b7600d (patch) | |
tree | d77889e92025bf822a14bf6ceebb781593eee637 /io_anim_c3d | |
parent | f0c73a261c3c0f21b36cef36a5cc18ee03f60a52 (diff) |
fix for problem reported by Jens Meisner
Cortex from Motion Analysis exports the LABELS parameter
in a different group (not POINT); now the importer searches
all groups for a LABELS parameter.
Diffstat (limited to 'io_anim_c3d')
-rw-r--r-- | io_anim_c3d/__init__.py | 4 | ||||
-rw-r--r-- | io_anim_c3d/import_c3d.py | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/io_anim_c3d/__init__.py b/io_anim_c3d/__init__.py index a63cf764..605ebf63 100644 --- a/io_anim_c3d/__init__.py +++ b/io_anim_c3d/__init__.py @@ -25,8 +25,8 @@ bl_info = { 'name': "C3D Graphics Lab Motion Capture file (.c3d)", 'author': "Daniel Monteiro Basso <daniel@basso.inf.br>", - 'version': (2011, 11, 3, 1), - 'blender': (2, 6, 0), + 'version': (2012, 7, 10, 1), + 'blender': (2, 6, 3), 'location': "File > Import", 'description': "Imports C3D Graphics Lab Motion Capture files", 'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/" diff --git a/io_anim_c3d/import_c3d.py b/io_anim_c3d/import_c3d.py index 7df6bcf8..febdef35 100644 --- a/io_anim_c3d/import_c3d.py +++ b/io_anim_c3d/import_c3d.py @@ -47,7 +47,8 @@ class Parameter: if not nameLength: self.name = '' return - if nameLength < 0 or nameLength > 64: + nameLength = abs(nameLength) # negative flags something + if nameLength > 64: raise ValueError self.name = infile.read(nameLength).decode('ascii') (offset, b) = struct.unpack('hb', infile.read(3)) @@ -195,7 +196,14 @@ class MarkerSet: if not g.name: break self.paramGroups[g.name] = g - self.markerLabels = self.paramGroups['POINT'].params['LABELS'].decode() + for pg in self.paramGroups: + #print("group: " + pg) + #for p in self.paramGroups[pg].params: + # print(" * " + p) + if 'LABELS' in self.paramGroups[pg].params: + break + # pg should be 'POINT', but let's be liberal and accept any group + self.markerLabels = self.paramGroups[pg].params['LABELS'].decode() def readMarker(self, infile): pass # ... |