DragonFF icon indicating copy to clipboard operation
DragonFF copied to clipboard

Feature: Support for Embedded Mesh in Bone

Open dreamsyntax opened this issue 9 months ago • 16 comments

There exists some models in Shadow the Hedgehog and Sonic Heroes where meshes are attached to bone, and bones may be nested within those skins. OMEGA.DFF is one such model.

The model throws this error on import with DragonFF image image

The model throws this error on import with @Psycrow101 's DragonFF-multimesh image image

image

Source for debugging: Shadow the Hedgehog Omega: omega.zip

3DSMax Hierarchy Example: Where tri = bone; Circle = mesh unknown

image

dreamsyntax avatar Oct 07 '23 21:10 dreamsyntax

following this issue and attaching Omega and Tails from Sonic Heroes, as those suffer from the same exact issue: OMEGA_TAILS-SH.zip this one including the model (DFF), textures (TXD and PNG) and animations (ANM) for more diversity on testing the models during and after the procedure.

RaphaelDrewBoltman avatar Oct 07 '23 22:10 RaphaelDrewBoltman

DragonFF uses data extracted from the skin section to create frames for the scene. As dreamsyntax said, in Omega, skin sections are missing, which is why the armature to which the meshes are attached is not created. This causes an exception to be thrown in the multi-mesh addon.

To fix this problem, we need to figure out how to combine skin data and frame data. I think we should create armature based on frame data, supplementing it with skin data, but I'm not sure that the frame transformation matrices will exactly match the skin transformation matrices. I'll try to experiment with this, but I can't guarantee perfect results.

For now I have coded a temporary fix for Omega.

image

Please note that the armature will not be created, resulting in incorrect export and animations.

DragonFF.zip

UPD: with armature

DragonFF.zip

Psycrow101 avatar Oct 08 '23 11:10 Psycrow101

DragonFF uses data extracted from the skin section to create frames for the scene. As dreamsyntax said, in Omega, skin sections are missing, which is why the armature to which the meshes are attached is not created. This causes an exception to be thrown in the multi-mesh addon.

To fix this problem, we need to figure out how to combine skin data and frame data. I think we should create armature based on frame data, supplementing it with skin data, but I'm not sure that the frame transformation matrices will exactly match the skin transformation matrices. I'll try to experiment with this, but I can't guarantee perfect results.

For now I have coded a temporary fix for Omega.

image

Please note that the armature will not be created, resulting in incorrect export and animations.

DragonFF.zip

UPD: with armature

DragonFF.zip

Unsurprisingly importing MTN files do not work properly, but with armature available its a step in the right direction! Thank you very much

dreamsyntax avatar Oct 09 '23 01:10 dreamsyntax

Unsurprisingly importing MTN files do not work properly, but with armature available its a step in the right direction! Thank you very much

I checked omega.bon and found that some bone ids are unexpectedly undefined (have a value of -1). Try the modified version of io_scene_sth_mtn. Animations should work correctly. io_scene_sth_mtn.zip

Psycrow101 avatar Oct 09 '23 21:10 Psycrow101

Unsurprisingly importing MTN files do not work properly, but with armature available its a step in the right direction! Thank you very much

I checked omega.bon and found that some bone ids are unexpectedly undefined (have a value of -1). Try the modified version of io_scene_sth_mtn. Animations should work correctly. io_scene_sth_mtn.zip

Ah I recall running into that while trying to update the 3dsmax bon script. Giving it a try

dreamsyntax avatar Oct 09 '23 21:10 dreamsyntax

Seems good for the few I've tried!

https://github.com/Parik27/DragonFF/assets/14857235/69773b30-a136-421d-9d87-0a1a3ce7a9e7

https://github.com/Parik27/DragonFF/assets/14857235/9204ad20-ac55-4cb0-9d9a-400c000b0acb

I will verify the heroes models next, to see if they also work properly. Thank you!

This is a bit off topic, but I can't seem to trigger your bulk import function for .mtn.

I see the code change, but when selecting a folder no mtns are imported. When multi-selecting individual mtns it just defaults to the first letter one.

dreamsyntax avatar Oct 09 '23 22:10 dreamsyntax

The two known problematic models in heroes work fine + tested the existing rw anm plugin.

https://github.com/Parik27/DragonFF/assets/14857235/91a238c8-6eff-4f91-bd9c-000c260b2c7c

https://github.com/Parik27/DragonFF/assets/14857235/d2449da0-c784-456d-8d28-f8b79ef41575

Seems good to me, I'll leave this open until the PR is created / merged.

dreamsyntax avatar Oct 09 '23 22:10 dreamsyntax

~~This is probably an issue for the sh mtn plugin~~; Actually confirmed DragonFF issue. While Omega is fixed, Shadow Tails is not. I think this is because of the multi .bon case

Image on TAILS.DFF -> TAILS.BON -> tails_atc.MTN image

TAILS_SHAD.zip

dreamsyntax avatar Oct 09 '23 22:10 dreamsyntax

Another such similar case of nested mesh is GUNBIGFOOT

With this DragonFF update the initial DFF works fine, but again MTN does not image

image

SHADOW_BIGFOOT.zip

dreamsyntax avatar Oct 09 '23 22:10 dreamsyntax

Unsurprisingly importing MTN files do not work properly, but with armature available its a step in the right direction! Thank you very much

I checked omega.bon and found that some bone ids are unexpectedly undefined (have a value of -1). Try the modified version of io_scene_sth_mtn. Animations should work correctly. io_scene_sth_mtn.zip

Just an update on this, this seems to break for all other shadow the hedgehog animations besides omega. Shadow's animations become scrambled if using this version.

CORRECTION:

It's actually this new DragonFF version that causes the Shadow animations to break, regardless of io_scene plugin

old io_scene plugin: image

new io_scene plugin: image

Above is shadow_body.dff -> sh.bon -> sh_atc_eda.mtn

shadow_ex.zip

dreamsyntax avatar Oct 09 '23 23:10 dreamsyntax

Unsurprisingly importing MTN files do not work properly, but with armature available its a step in the right direction! Thank you very much

I checked omega.bon and found that some bone ids are unexpectedly undefined (have a value of -1). Try the modified version of io_scene_sth_mtn. Animations should work correctly. io_scene_sth_mtn.zip

Just an update on this, this seems to break for all other shadow the hedgehog animations besides omega. Shadow's animations become scrambled if using this version.

CORRECTION:

It's actually this new DragonFF version that causes the Shadow animations to break, regardless of io_scene plugin

old io_scene plugin: image

new io_scene plugin: image

Above is shadow_body.dff -> sh.bon -> sh_atc_eda.mtn

shadow_ex.zip

Remove Copy Transforms constraint for mesh object image

Or try this DragonFF.zip

Psycrow101 avatar Oct 10 '23 16:10 Psycrow101

Or try this DragonFF.zip

BigFoot anims look mostly good, I noticed there's a few frames that seem to spasm out in most anms

BFA_WALK

https://github.com/Parik27/DragonFF/assets/14857235/eabb653a-3277-4a90-8e32-e5abac22f9e3

BFA_DAMAGE

https://github.com/Parik27/DragonFF/assets/14857235/37b73ea5-c55a-41d4-9e0c-960975af0c94

Tails seems to work properly now. Shadow seems to work properly now.

I see the code change, but when selecting a folder no mtns are imported. When multi-selecting individual mtns it just defaults to the first letter one.

I still can't figure out how to invoke your bulk import you added.

dreamsyntax avatar Oct 14 '23 15:10 dreamsyntax

I still can't figure out how to invoke your bulk import you added.

In Blender, animations are available in the Dope Sheet editor (Shift + F12). There you need to go to Action Editor. A list of actions will be available on the right. image

BigFoot anims look mostly good, I noticed there's a few frames that seem to spasm out in most anms

The problem is with the io_scene_sth_mtn addon. Wrong Bezier curve handlers result in incorrect keyframe interpolation. I'll see how this can be fixed.

Psycrow101 avatar Oct 14 '23 18:10 Psycrow101

Or try this DragonFF.zip

To re-iterate the status of this, which branch will this live in and does it make sense to have this as a PR for the main branch or only multi-mesh?

dreamsyntax avatar Nov 13 '23 05:11 dreamsyntax

Or try this DragonFF.zip

To re-iterate the status of this, which branch will this live in and does it make sense to have this as a PR for the main branch or only multi-mesh?

This change is currently in the multi-mesh branch. I think this branch is not tested enough to merge into the main branch.

Psycrow101 avatar Nov 22 '23 18:11 Psycrow101

Or try this DragonFF.zip

To re-iterate the status of this, which branch will this live in and does it make sense to have this as a PR for the main branch or only multi-mesh?

This change is currently in the multi-mesh branch. I think this branch is not tested enough to merge into the main branch.

@Psycrow101 would be curious on your thoughts about a checkbox option in the DFF Import/Export popup to handle as latest master does vs with multi mesh. Would it be infeasible given the amount of changes? The dual branches leads to some confusion for end users.

dreamsyntax avatar Jan 28 '24 22:01 dreamsyntax