Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel M. Basso <danielmbasso@gmail.com>2012-07-10 18:22:10 +0400
committerDaniel M. Basso <danielmbasso@gmail.com>2012-07-10 18:22:10 +0400
commit49ecb6cf0da19854afcb938013d9034957b7600d (patch)
treed77889e92025bf822a14bf6ceebb781593eee637 /io_anim_c3d/import_c3d.py
parentf0c73a261c3c0f21b36cef36a5cc18ee03f60a52 (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.py12
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 # ...