[Bf-extensions-cvs] [c33c2c0] master: Fix T37768: marker labels were misidentified

Daniel Monteiro Basso noreply at git.blender.org
Tue Dec 10 21:06:48 CET 2013


Commit: c33c2c0b7a28787123f4b9e7354549a18e8b88b4
Author: Daniel Monteiro Basso
Date:   Tue Dec 10 20:02:25 2013 +0000
http://developer.blender.org/rBAc33c2c0b7a28787123f4b9e7354549a18e8b88b4

Fix T37768: marker labels were misidentified

===================================================================

M	io_anim_c3d/__init__.py
M	io_anim_c3d/import_c3d.py

===================================================================

diff --git a/io_anim_c3d/__init__.py b/io_anim_c3d/__init__.py
index 0f918fd..451af15 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 at basso.inf.br>",
-    "version": (2013, 2, 16, 1),
-    "blender": (2, 65, 9),
+    "version": (2013, 12, 10, 1),
+    "blender": (2, 69, 5),
     "location": "File > Import",
     "description": "Imports C3D Graphics Lab Motion Capture files",
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
@@ -95,6 +95,7 @@ class C3DAnimateCloud(bpy.types.Operator):
     def cancel(self, context):
         bpy.context.scene.frame_set(bpy.context.scene.frame_current)
         context.window_manager.event_timer_remove(self.timer)
+        return {'FINISHED'}
 
 
 class C3DImporter(bpy.types.Operator):
diff --git a/io_anim_c3d/import_c3d.py b/io_anim_c3d/import_c3d.py
index 9381a53..6694474 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:



More information about the Bf-extensions-cvs mailing list