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/import_c3d.py | |
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/import_c3d.py')
-rw-r--r-- | io_anim_c3d/import_c3d.py | 12 |
1 files changed, 10 insertions, 2 deletions
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 # ... |