From 2f37da95a310d8590cf3a6aaf16b54bcba3ffa84 Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Thu, 3 Nov 2011 02:18:12 +0000 Subject: [PATCH] more edits & dont use try/except to check if the property exists --- io_anim_acclaim/__init__.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/io_anim_acclaim/__init__.py b/io_anim_acclaim/__init__.py index 640d9b5dd..955ff6e7e 100644 --- a/io_anim_acclaim/__init__.py +++ b/io_anim_acclaim/__init__.py @@ -407,22 +407,29 @@ class AmcImporter(bpy.types.Operator): 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 -- GitLab