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 Monteiro Basso <daniel@basso.inf.br>2013-12-11 00:02:25 +0400
committerDaniel Monteiro Basso <daniel@basso.inf.br>2013-12-11 00:02:25 +0400
commitc33c2c0b7a28787123f4b9e7354549a18e8b88b4 (patch)
treed51bcbdd5a8f5e26b2473a0573721dca8463f8c8 /io_anim_c3d/import_c3d.py
parent74ff9632637c44fddd06863968b38e12f18b1860 (diff)
Fix T37768: marker labels were misidentified
Diffstat (limited to 'io_anim_c3d/import_c3d.py')
-rw-r--r--io_anim_c3d/import_c3d.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/io_anim_c3d/import_c3d.py b/io_anim_c3d/import_c3d.py
index 9381a537..6694474c 100644
--- a/io_anim_c3d/import_c3d.py
+++ b/io_anim_c3d/import_c3d.py
@@ -196,14 +196,23 @@ class MarkerSet:
if not g.name:
break
self.paramGroups[g.name] = g
+ cand_mlabel = None
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
+ cand_mlabel = self.paramGroups[pg].params['LABELS'].decode()
+ if len(cand_mlabel) == self.markerCount:
+ break
+ cand_mlabel = None
# pg should be 'POINT', but let's be liberal and accept any group
- self.markerLabels = self.paramGroups[pg].params['LABELS'].decode()
+ # as long as the LABELS parameter has the same number of markers
+ if cand_mlabel is None:
+ self.markerLabels = ["m{}".format(idx)
+ for idx in range(self.markerCount)]
+ else:
+ self.markerLabels = cand_mlabel
repeats = {}
for i, m in enumerate(self.markerLabels):
if m in repeats: