[Bf-extensions-cvs] [92ec119] master: CMU mocap browser: fixed missing/incorrect return values.

Sybren A. Stüvel noreply at git.blender.org
Fri Mar 20 10:21:52 CET 2015


Commit: 92ec119da2c7ff62bc29625840c345c0370b23c3
Author: Sybren A. Stüvel
Date:   Fri Mar 20 10:20:53 2015 +0100
Branches: master
https://developer.blender.org/rBAC92ec119da2c7ff62bc29625840c345c0370b23c3

CMU mocap browser: fixed missing/incorrect return values.

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

M	cmu_mocap_browser/__init__.py
M	cmu_mocap_browser/download.py

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

diff --git a/cmu_mocap_browser/__init__.py b/cmu_mocap_browser/__init__.py
index 11823d2..7feaeb9 100644
--- a/cmu_mocap_browser/__init__.py
+++ b/cmu_mocap_browser/__init__.py
@@ -25,7 +25,7 @@
 bl_info = {
     "name": "Carnegie Mellon University Mocap Library Browser",
     "author": "Daniel Monteiro Basso <daniel at basso.inf.br>",
-    "version": (2013, 5, 9),
+    "version": (2015, 3, 20),
     "blender": (2, 66, 6),
     "location": "View3D > Tools",
     "description": "Assistant for using CMU Motion Capture data",
diff --git a/cmu_mocap_browser/download.py b/cmu_mocap_browser/download.py
index b4d4a09..0f30386 100644
--- a/cmu_mocap_browser/download.py
+++ b/cmu_mocap_browser/download.py
@@ -98,7 +98,8 @@ class CMUMocapDownloadImport(bpy.types.Operator):
         bpy.types.SpaceView3D.draw_handler_remove(self.handle, 'WINDOW')
         cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
         if os.path.exists(self.local_file):
-            self.import_or_open(cml)
+            return self.import_or_open(cml)
+        return {'CANCELLED'}
 
     def execute(self, context):
         cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
@@ -141,12 +142,13 @@ class CMUMocapDownloadImport(bpy.types.Operator):
                 except AttributeError:
                     self.report({'ERROR'}, "To use this feature "
                         "please enable the Acclaim ASF/AMC Importer addon.")
+                    return {'CANCELLED'}
             elif self.local_file.endswith("amc"):
                 ob = bpy.context.active_object
                 if not ob or ob.type != 'ARMATURE' or \
                     'source_file_path' not in ob:
                     self.report({'ERROR'}, "Please select a CMU Armature.")
-                    return
+                    return {'CANCELLED'}
                 try:
                     bpy.ops.import_anim.amc(
                         filepath=self.local_file,
@@ -154,6 +156,7 @@ class CMUMocapDownloadImport(bpy.types.Operator):
                 except AttributeError:
                     self.report({'ERROR'}, "To use this feature please "
                         "enable the Acclaim ASF/AMC Importer addon.")
+                    return {'CANCELLED'}
             elif self.local_file.endswith("c3d"):
                 try:
                     bpy.ops.import_anim.c3d(
@@ -166,4 +169,6 @@ class CMUMocapDownloadImport(bpy.types.Operator):
                 except AttributeError:
                     self.report({'ERROR'}, "To use this feature "
                         "please enable the C3D Importer addon.")
+                    return {'CANCELLED'}
 
+        return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list