Skip to content

Commit

Permalink
Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycrow101 committed Feb 22, 2022
1 parent eb48ac5 commit b1f6cdb
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# 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

1. Import DFF model into Blender
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'})
Expand All @@ -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'})
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.

0 comments on commit b1f6cdb

Please sign in to comment.