ssbucarlos / smash-ultimate-blender

Blender Plugin containing utilities for Smash Ultimate Models and Animations.
45 stars 9 forks source link

Anim export #138

Closed ssbucarlos closed 2 years ago

ssbucarlos commented 2 years ago

Going to merge soon since only thing functionally remaining is camera export and since theres alot of misc bugfixes / qol features also in here. @ScanMountGoat lmk if theres anything that should be done before merging.

ScanMountGoat commented 2 years ago

Thanks for taking the time to finish this! The overall changes look ok. I'll try and set aside some time this week to go over things more closely before we merge.

I think it would be best to change the hlpb field names in the addon UI to match SSBH Editor, ssbh_data, and the next ssbh_data_py update. You can find the unreleased Python API at the link below. These field names probably won't change anytime soon. https://github.com/ScanMountGoat/ssbh_data_py/blob/main/ssbh_data_py/ssbh_data_py/hlpb_data.pyi

There won't be a need to update the UI right away even if the field names change in the future. I mostly just want the existing names to be updated since they have confusing phrases inherited from years ago like "root" vs "parent". The bone effected by the constraint is the "target" bone. This makes the JSON code a little harder to read, but it will be replaced at some point by ssbh_data_py anyway.

ssbucarlos commented 2 years ago

Good idea, ill try to get that done today.

ssbucarlos commented 2 years ago

Ok camera export is done along with the helper bone property name update. The only issue remaining is figuring out the proper blender FOV, but thats a long-standing issue that existed even with the previous plugin. I can push a fix for it later when i figure it out.

ScanMountGoat commented 2 years ago

The only thing that I think needs to be addressed before merging is the orientation issues on the foot when viewing a00wait2.nuanmb for Mario. The issue doesn't seem to persist when exporting and viewing in SSBH Editor. This could just be a visual thing, but it would be nice to have some idea as to what's going on.

TabuuForteAkugun commented 2 years ago

Woo, neat! I'm curious about something: with this NEW plugin is there a way to edit the Z-axis translation on the Trans bone? With the old tool, I have many problems with scaling the animation to fit the scale of the model (exported from Max). When I scale the animation, the animation's Trans values are also scaled. How can I stop this?

ssbucarlos commented 2 years ago

The only thing that I think needs to be addressed before merging is the orientation issues on the foot when viewing a00wait2.nuanmb for Mario. The issue doesn't seem to persist when exporting and viewing in SSBH Editor. This could just be a visual thing, but it would be nice to have some idea as to what's going on.

I dont notice anything on my end when i loaded a00wait2.nuanmb for mario, do u know on which frame the issue is and on which bone it is?

ssbucarlos commented 2 years ago

Woo, neat! I'm curious about something: with this NEW plugin is there a way to edit the Z-axis translation on the Trans bone?

Yes the translation values for the root bones are now editable.

With the old tool, I have many problems with scaling the animation to fit the scale of the model (exported from Max). When I scale the animation, the animation's Trans values are also scaled. How can I stop this?

If you imported the animation from Max then im not sure, maybe mess around with the Max export settings or blender FBX importer settings to see if that can fix the issue.

TabuuForteAkugun commented 2 years ago

Cool, I was nervous you wouldn't understand what I was trying to get at (bad wording :P)

But yeah. The MODEL exported from max, and the ANIMATION was with your old edited Blender script. Not Max.

ScanMountGoat commented 2 years ago

The GitHub UI is being finicky. On line 117 in import_anim.py, the mode set can fail if nothing is active or selected. The easiest way to reproduce this is to import a model and then import an anim without selecting anything in Blender.

ssbucarlos commented 2 years ago

The GitHub UI is being finicky. On line 117 in import_anim.py, the mode set can fail if nothing is active or selected. The easiest way to reproduce this is to import a model and then import an anim without selecting anything in Blender.

Good catch, ill fix it rn

ScanMountGoat commented 2 years ago

The only thing that I think needs to be addressed before merging is the orientation issues on the foot when viewing a00wait2.nuanmb for Mario. The issue doesn't seem to persist when exporting and viewing in SSBH Editor. This could just be a visual thing, but it would be nice to have some idea as to what's going on.

I dont notice anything on my end when i loaded a00wait2.nuanmb for mario, do u know on which frame the issue is and on which bone it is?

Is this not happening on your end? My install may be a little weird, so I wanted to double check. image

ssbucarlos commented 2 years ago

But yeah. The MODEL exported from max, and the ANIMATION was with your old edited Blender script. Not Max.

The animation importer is intended to be used with vanilla skeletons also imported with this plugin. If the other model is imported from another format, if u run into any animation import issues when importing with smush_blender i think besides matching the imported model scale to match the vanilla ultimate model (if scale is really the only issue), ur best bet may be to use an animation retargetting plugin like rokoko.

ssbucarlos commented 2 years ago

The only thing that I think needs to be addressed before merging is the orientation issues on the foot when viewing a00wait2.nuanmb for Mario. The issue doesn't seem to persist when exporting and viewing in SSBH Editor. This could just be a visual thing, but it would be nice to have some idea as to what's going on.

I dont notice anything on my end when i loaded a00wait2.nuanmb for mario, do u know on which frame the issue is and on which bone it is?

Is this not happening on your end? My install may be a little weird, so I wanted to double check. image

that definitely didnt happen on my end, but im deleting my mario files and re-extracting just to double check

TabuuForteAkugun commented 2 years ago

But yeah. The MODEL exported from max, and the ANIMATION was with your old edited Blender script. Not Max.

The animation importer is intended to be used with vanilla skeletons also imported with this plugin. If the other model is imported from another format, if u run into any animation import issues when importing with smush_blender i think besides matching the imported model scale to match the vanilla ultimate model (if scale is really the only issue), ur best bet may be to use an animation retargetting plugin like rokoko.

I gotcha. Looks like I'll have to re-export all my models with your plugin as well as my new ones. Thanks!

ScanMountGoat commented 2 years ago

The only thing that I think needs to be addressed before merging is the orientation issues on the foot when viewing a00wait2.nuanmb for Mario. The issue doesn't seem to persist when exporting and viewing in SSBH Editor. This could just be a visual thing, but it would be nice to have some idea as to what's going on.

I dont notice anything on my end when i loaded a00wait2.nuanmb for mario, do u know on which frame the issue is and on which bone it is?

Is this not happening on your end? My install may be a little weird, so I wanted to double check. image

that definitely didnt happen on my end, but im deleting my mario files and re-extracting just to double check

I can reliably reproduce this on Blender 2.93 but not Blender 3.0.

ssbucarlos commented 2 years ago

I can reliably reproduce this on Blender 2.93 but not Blender 3.0.

Now that u mention it, i used to run into random bone twist issues.

In the old model.numdlb importer script, sometimes the rest pose of some fighters like ness would have some of their bones twist after model import for no reason.

ScanMountGoat commented 2 years ago

Hopefully this is an easy fix. If not, we can increment the addon version and supported Blender version and document it in the readme. The update to Blender 3.1+ will happen soon anyway. I don't think many people are on 2.93 anyway. Blender doesn't make it easy to find older versions.

ssbucarlos commented 2 years ago

yeah i think its just a glitch on blenders side anyways thats already been fixed, i dont think we need to do anything. Especially if we do move to 3.1+ soon

ScanMountGoat commented 2 years ago

This should be good for you to merge. We can fix minor stuff as it comes up before the update to 3.1+.