[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2577] trunk/py/scripts/addons/ io_anim_acclaim/__init__.py: more edits & dont use try/ except to check if the property exists

Campbell Barton ideasman42 at gmail.com
Thu Nov 3 03:18:14 CET 2011


Revision: 2577
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2577
Author:   campbellbarton
Date:     2011-11-03 02:18:12 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
more edits & dont use try/except to check if the property exists

Modified Paths:
--------------
    trunk/py/scripts/addons/io_anim_acclaim/__init__.py

Modified: trunk/py/scripts/addons/io_anim_acclaim/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_anim_acclaim/__init__.py	2011-11-03 02:09:59 UTC (rev 2576)
+++ trunk/py/scripts/addons/io_anim_acclaim/__init__.py	2011-11-03 02:18:12 UTC (rev 2577)
@@ -407,22 +407,29 @@
     bl_idname = "import_anim.amc"
     bl_label = "Import AMC"
 
-    filepath = StringProperty(name="File Path", maxlen=1024, default="",
-                              description="Path to the AMC file")
-    frame_skip = IntProperty(name="Fps divisor", default=4,
-    # usually the sample rate is 120, so the default 4 gives you 30fps
-                          description="Frame supersampling factor", min=1)
-    use_frame_no = BoolProperty(name="Use frame numbers", default=False,
-              description="Offset start of animation according to the source")
+    filepath = StringProperty(
+            name="File Path", maxlen=1024,
+            description="Path to the AMC file",
+            )
+    frame_skip = IntProperty(
+            name="Fps divisor",
+            default=4,
+            # usually the sample rate is 120, so the default 4 gives you 30fps
+            description="Frame supersampling factor",
+            min=1,
+            )
+    use_frame_no = BoolProperty(
+            name="Use frame numbers",
+            default=False,
+            description="Offset start of animation according to the source",
+            )
+
     filter_glob = StringProperty(default="*.amc", options={'HIDDEN'})
 
     @classmethod
     def poll(cls, context):
         ob = context.active_object
-        try:
-            return (ob and ob.type == 'ARMATURE' and ob['source_file_path'])
-        except:
-            return False
+        return (ob and ob.type == 'ARMATURE' and 'source_file_path' in ob)
 
     def execute(self, context):
         ob = context.active_object



More information about the Bf-extensions-cvs mailing list