Skip to content
Snippets Groups Projects
Commit 49ecb6cf authored by Daniel M. Basso's avatar Daniel M. Basso
Browse files

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.
parent f0c73a26
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
bl_info = { bl_info = {
'name': "C3D Graphics Lab Motion Capture file (.c3d)", 'name': "C3D Graphics Lab Motion Capture file (.c3d)",
'author': "Daniel Monteiro Basso <daniel@basso.inf.br>", 'author': "Daniel Monteiro Basso <daniel@basso.inf.br>",
'version': (2011, 11, 3, 1), 'version': (2012, 7, 10, 1),
'blender': (2, 6, 0), 'blender': (2, 6, 3),
'location': "File > Import", 'location': "File > Import",
'description': "Imports C3D Graphics Lab Motion Capture files", 'description': "Imports C3D Graphics Lab Motion Capture files",
'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/" 'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
......
...@@ -47,7 +47,8 @@ class Parameter: ...@@ -47,7 +47,8 @@ class Parameter:
if not nameLength: if not nameLength:
self.name = '' self.name = ''
return return
if nameLength < 0 or nameLength > 64: nameLength = abs(nameLength) # negative flags something
if nameLength > 64:
raise ValueError raise ValueError
self.name = infile.read(nameLength).decode('ascii') self.name = infile.read(nameLength).decode('ascii')
(offset, b) = struct.unpack('hb', infile.read(3)) (offset, b) = struct.unpack('hb', infile.read(3))
...@@ -195,7 +196,14 @@ class MarkerSet: ...@@ -195,7 +196,14 @@ class MarkerSet:
if not g.name: if not g.name:
break break
self.paramGroups[g.name] = g 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): def readMarker(self, infile):
pass # ... pass # ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment