diff --git a/io_anim_c3d/__init__.py b/io_anim_c3d/__init__.py index a63cf764e0df8e3ba3968445294e4eb43d0cc0db..605ebf63bef7133453dd3a00190329e2fa11fc91 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 7df6bcf8045c81b142e26c2c2e1ef88f30986b39..febdef35b04bb93c941ca7430bda738090b89c12 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 # ...