diff options
Diffstat (limited to 'io_anim_bvh/__init__.py')
-rw-r--r-- | io_anim_bvh/__init__.py | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/io_anim_bvh/__init__.py b/io_anim_bvh/__init__.py index c9b5dfdf..01484af9 100644 --- a/io_anim_bvh/__init__.py +++ b/io_anim_bvh/__init__.py @@ -22,7 +22,7 @@ bl_info = { "name": "BioVision Motion Capture (BVH) format", "author": "Campbell Barton", "version": (1, 0, 0), - "blender": (2, 74, 0), + "blender": (2, 80, 0), "location": "File > Import-Export", "description": "Import-Export BVH from armature objects", "warning": "", @@ -62,9 +62,9 @@ class ImportBVH(bpy.types.Operator, ImportHelper): bl_options = {'REGISTER', 'UNDO'} filename_ext = ".bvh" - filter_glob = StringProperty(default="*.bvh", options={'HIDDEN'}) + filter_glob: StringProperty(default="*.bvh", options={'HIDDEN'}) - target = EnumProperty(items=( + target: EnumProperty(items=( ('ARMATURE', "Armature", ""), ('OBJECT', "Object", ""), ), @@ -72,41 +72,41 @@ class ImportBVH(bpy.types.Operator, ImportHelper): description="Import target type", default='ARMATURE') - global_scale = FloatProperty( + global_scale: FloatProperty( name="Scale", description="Scale the BVH by this value", min=0.0001, max=1000000.0, soft_min=0.001, soft_max=100.0, default=1.0, ) - frame_start = IntProperty( + frame_start: IntProperty( name="Start Frame", description="Starting frame for the animation", default=1, ) - use_fps_scale = BoolProperty( + use_fps_scale: BoolProperty( name="Scale FPS", description=("Scale the framerate from the BVH to the current scenes, " "otherwise each BVH frame maps directly to a Blender frame"), default=False, ) - update_scene_fps = BoolProperty( + update_scene_fps: BoolProperty( name="Update Scene FPS", description="Set the scene framerate to that of the BVH file (note that this " "nullifies the 'Scale FPS' option, as the scale will be 1:1)", default=False ) - update_scene_duration = BoolProperty( + update_scene_duration: BoolProperty( name="Update Scene Duration", description="Extend the scene's duration to the BVH duration (never shortens the scene)", default=False, ) - use_cyclic = BoolProperty( + use_cyclic: BoolProperty( name="Loop", description="Loop the animation playback", default=False, ) - rotate_mode = EnumProperty( + rotate_mode: EnumProperty( name="Rotation", description="Rotation conversion", items=(('QUATERNION', "Quaternion", @@ -145,29 +145,29 @@ class ExportBVH(bpy.types.Operator, ExportHelper): bl_label = "Export BVH" filename_ext = ".bvh" - filter_glob = StringProperty( + filter_glob: StringProperty( default="*.bvh", options={'HIDDEN'}, ) - global_scale = FloatProperty( + global_scale: FloatProperty( name="Scale", description="Scale the BVH by this value", min=0.0001, max=1000000.0, soft_min=0.001, soft_max=100.0, default=1.0, ) - frame_start = IntProperty( + frame_start: IntProperty( name="Start Frame", description="Starting frame to export", default=0, ) - frame_end = IntProperty( + frame_end: IntProperty( name="End Frame", description="End frame to export", default=0, ) - rotate_mode = EnumProperty( + rotate_mode: EnumProperty( name="Rotation", description="Rotation conversion", items=(('NATIVE', "Euler (Native)", @@ -181,7 +181,7 @@ class ExportBVH(bpy.types.Operator, ExportHelper): ), default='NATIVE', ) - root_transform_only = BoolProperty( + root_transform_only: BoolProperty( name="Root Translation Only", description="Only write out translation channels for the root bone", default=False, @@ -217,15 +217,22 @@ def menu_func_export(self, context): self.layout.operator(ExportBVH.bl_idname, text="Motion Capture (.bvh)") +classes = [ + ImportBVH, + ExportBVH +] + def register(): - bpy.utils.register_module(__name__) + for cls in classes: + bpy.utils.register_class(cls) bpy.types.TOPBAR_MT_file_import.append(menu_func_import) bpy.types.TOPBAR_MT_file_export.append(menu_func_export) def unregister(): - bpy.utils.unregister_module(__name__) + for cls in classes: + bpy.utils.unregister_class(cls) bpy.types.TOPBAR_MT_file_import.remove(menu_func_import) bpy.types.TOPBAR_MT_file_export.remove(menu_func_export) |