From b1f6cdb13dd73b3e7026c4b2f26dad2a31e8849d Mon Sep 17 00:00:00 2001 From: Psycrow Date: Tue, 22 Feb 2022 17:47:28 +0300 Subject: [PATCH] Rename project --- README.md | 7 +-- .../__init__.py | 44 +++++++++---------- .../anm.py | 0 .../export_rw_anm.py | 2 +- .../import_rw_anm.py | 0 5 files changed, 27 insertions(+), 26 deletions(-) rename {io_scene_sonic_heroes_anm => io_scene_rw_anm}/__init__.py (76%) rename {io_scene_sonic_heroes_anm => io_scene_rw_anm}/anm.py (100%) rename io_scene_sonic_heroes_anm/export_sh_anm.py => io_scene_rw_anm/export_rw_anm.py (96%) rename io_scene_sonic_heroes_anm/import_sh_anm.py => io_scene_rw_anm/import_rw_anm.py (100%) diff --git a/README.md b/README.md index 38c7f72..42c37c9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# io_scene_sonic_heroes_anm +# io_scene_rw_anm -This plugin for Blender 3D allows you to import and export RenderWare animations (`.anm`) for Sonic Heroes. Based on [Renderware-.anm-IO-Tool](https://github.com/Shadowth117/Renderware-.anm-IO-Tool). +This plugin for Blender 3D allows you to import and export RenderWare animations (`.anm`). Based on [Renderware-.anm-IO-Tool](https://github.com/Shadowth117/Renderware-.anm-IO-Tool). Primarily developed for Sonic Heroes game. -Poorly tested. Animation export may be incorrect due to broken keyframe sorting. To solve this problem, you can enable the "Create intermediate" option, but with this, the exported file will be larger in size. ## How to import animation @@ -10,6 +9,8 @@ Poorly tested. Animation export may be incorrect due to broken keyframe sorting. 2. Make armature active 3. Import ANM animation +For a more accurate animation export, it is proposed to snap keyframes in the timeline. + ## Requirements * Blender 3D (2.81 and higher) diff --git a/io_scene_sonic_heroes_anm/__init__.py b/io_scene_rw_anm/__init__.py similarity index 76% rename from io_scene_sonic_heroes_anm/__init__.py rename to io_scene_rw_anm/__init__.py index 4fca05a..0b9f27d 100644 --- a/io_scene_sonic_heroes_anm/__init__.py +++ b/io_scene_rw_anm/__init__.py @@ -11,12 +11,12 @@ from . anm import unpack_rw_lib_id, pack_rw_lib_id bl_info = { - "name": "Sonic Heroes Animation", + "name": "RenderWare Animation", "author": "Psycrow", "version": (0, 1, 0), "blender": (2, 81, 0), "location": "File > Import-Export", - "description": "Import / Export Sonic Heroes Animation (.anm)", + "description": "Import / Export RenderWare Animation (.anm)", "warning": "", "wiki_url": "", "support": 'COMMUNITY', @@ -25,15 +25,15 @@ if "bpy" in locals(): import importlib - if "import_sh_anm" in locals(): - importlib.reload(import_sh_anm) - if "export_sh_anm" in locals(): - importlib.reload(export_sh_anm) + if "import_rw_anm" in locals(): + importlib.reload(import_rw_anm) + if "export_rw_anm" in locals(): + importlib.reload(export_rw_anm) -class ImportSonicHeroesAnm(bpy.types.Operator, ImportHelper): - bl_idname = "import_scene.sonic_heroes_anm" - bl_label = "Import Sonic Heroes Animation" +class ImportRenderWareAnm(bpy.types.Operator, ImportHelper): + bl_idname = "import_scene.renderware_anm" + bl_label = "Import RenderWare Animation" bl_options = {'PRESET', 'UNDO'} filter_glob: StringProperty(default="*.anm", options={'HIDDEN'}) @@ -46,17 +46,17 @@ class ImportSonicHeroesAnm(bpy.types.Operator, ImportHelper): ) def execute(self, context): - from . import import_sh_anm + from . import import_rw_anm keywords = self.as_keywords(ignore=("filter_glob", )) - return import_sh_anm.load(context, **keywords) + return import_rw_anm.load(context, **keywords) -class ExportSonicHeroesAnm(bpy.types.Operator, ExportHelper): - bl_idname = "export_scene.sonic_heroes_anm" - bl_label = "Export Sonic Heroes Animation" +class ExportRenderWareAnm(bpy.types.Operator, ExportHelper): + bl_idname = "export_scene.renderware_anm" + bl_label = "Export RenderWare Animation" bl_options = {'PRESET'} filter_glob: StringProperty(default="*.anm", options={'HIDDEN'}) @@ -88,13 +88,13 @@ def draw(self, context): col.prop(self, "fps") def execute(self, context): - from . import export_sh_anm + from . import export_rw_anm if not self.verify_rw_version(): self.report({"ERROR_INVALID_INPUT"}, "Invalid RW Version") return {'CANCELLED'} - return export_sh_anm.save(context, self.filepath, self.fps, self.get_selected_rw_version()) + return export_rw_anm.save(context, self.filepath, self.fps, self.get_selected_rw_version()) def invoke(self, context, event): arm_obj = context.view_layer.objects.active @@ -125,18 +125,18 @@ def get_selected_rw_version(self): def menu_func_import(self, context): - self.layout.operator(ImportSonicHeroesAnm.bl_idname, - text="Sonic Heroes Animation (.anm)") + self.layout.operator(ImportRenderWareAnm.bl_idname, + text="RenderWare Animation (.anm)") def menu_func_export(self, context): - self.layout.operator(ExportSonicHeroesAnm.bl_idname, - text="Sonic Heroes Animation (.anm)") + self.layout.operator(ExportRenderWareAnm.bl_idname, + text="RenderWare Animation (.anm)") classes = ( - ImportSonicHeroesAnm, - ExportSonicHeroesAnm, + ImportRenderWareAnm, + ExportRenderWareAnm, ) diff --git a/io_scene_sonic_heroes_anm/anm.py b/io_scene_rw_anm/anm.py similarity index 100% rename from io_scene_sonic_heroes_anm/anm.py rename to io_scene_rw_anm/anm.py diff --git a/io_scene_sonic_heroes_anm/export_sh_anm.py b/io_scene_rw_anm/export_rw_anm.py similarity index 96% rename from io_scene_sonic_heroes_anm/export_sh_anm.py rename to io_scene_rw_anm/export_rw_anm.py index 87e7585..da5a9fe 100644 --- a/io_scene_sonic_heroes_anm/export_sh_anm.py +++ b/io_scene_rw_anm/export_rw_anm.py @@ -29,7 +29,7 @@ def get_pose_mats(context, arm_obj, act): bone_id = arm_obj.data.bones.find(bone_name) if bone_id not in bone_ids: continue - + for kp in curve.keyframe_points: time = kp.co[0] if not frame_start <= time < frame_end: diff --git a/io_scene_sonic_heroes_anm/import_sh_anm.py b/io_scene_rw_anm/import_rw_anm.py similarity index 100% rename from io_scene_sonic_heroes_anm/import_sh_anm.py rename to io_scene_rw_anm/import_rw_anm.py