Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"prep for export" only available for the KKBP armature? #628

Open
AnalogKnight opened this issue Nov 8, 2024 · 8 comments
Open

"prep for export" only available for the KKBP armature? #628

AnalogKnight opened this issue Nov 8, 2024 · 8 comments

Comments

@AnalogKnight
Copy link
Contributor

Hi there, I noticed that after 7.1.0 prep for export only works on KKBP armature. Previously this function could be used when importing via the other three armatures. But I noticed that “exportprep.py” is almost unchanged, and when I remove the condition required by 'row.Enabledd' prep for export still works fine and simplifies the skeleton. So I'm not sure what the purpose of adding this restriction is?

FlailingFog added a commit that referenced this issue Nov 8, 2024
fix 4.2 koikatsu armature import
@FlailingFog
Copy link
Owner

The reason I added the restriction was because that button was only intended to be used with the KKBP armature (I didn't want to support the other armatures). I guess you're right though it looks like it simplifies the Koikatsu and PMX armatures, so I'll add those to the enabled list. It doesn't work for the rigify armature though, so I'll keep that one disabled

@AnalogKnight
Copy link
Contributor Author

The reason I added the restriction was because that button was only intended to be used with the KKBP armature (I didn't want to support the other armatures). I guess you're right though it looks like it simplifies the Koikatsu and PMX armatures, so I'll add those to the enabled list. It doesn't work for the rigify armature though, so I'll keep that one disabled

@FlailingFog Thank you for your response. Yes, I think I misremembered, I haven't tried Rigify yet.

A little off topic, the reason I haven't used KKBP armature is because it and Rigify tweak bones like knees and elbows to make IK work. This causes these bones to be oriented differently than the other bones on the limb they are on. For the most part this doesn't cause a problem, but after exporting to some software this can make IK not work. For example, when animating in Unreal Engine, its IK requires that all bones on the limb face the same direction.
I'll try to delve a little deeper into how to fix this myself, but I also wanted to share this idea with you, so if you're interested and know how to do it that would be great.

@FlailingFog
Copy link
Owner

I see, I've never tried exporting to Unreal so that's interesting. I think the only time the bones are bent in the KKBP armature is during this function. If you comment out line 676 and 684, or just revert that change during prep for export I believe that would do it. I'm not sure about what modifications the rigify armature does. Also, if that's the only change needed to make the KKBP armature work in Unreal, I can add a menu entry for the prep button like I've got for Unity

@AnalogKnight
Copy link
Contributor Author

Yes, I noticed that these code makes changes to the skeleton. When I commented it out though, IK was broken. Unfortunately I don't know enough about Blender to know how to solve that.
Ands yes, I believe this is the only change needed to make KKBP work in Unreal. BTW I have actually done some work on it, I tried to add a menu entry to modify the bone hierarchy in prep menu to make it match the Epic Skeleton. so far it's doing fine, so if you don't mind I'll create a Pull Request for that.

@FlailingFog
Copy link
Owner

That would be cool!

@FlailingFog
Copy link
Owner

@AnalogKnight
Hey, actually I think I have a way to make the IKs work in blender without modifying the bone positions. Could you try the latest commit?

@AnalogKnight
Copy link
Contributor Author

AnalogKnight commented Nov 18, 2024

Thanks for the update.
Unfortunately, I don't think that's the problem.
Using the knee as an example, if I'm not mistaken, these two lines position the knee's tail to the height of the foot:

relocate_tail('cf_j_leg01_R', 'cf_j_foot_R', 'leg')
relocate_tail('cf_j_leg01_L', 'cf_j_foot_L', 'leg')

The result of this is that the head of the knee bone faces up and the tail faces down.
And the two bones leg and cf_j_leg03 (which I think should be the foot bones) are oriented in the opposite direction, with their heads facing down and tails facing up. This causes IK to not work in software like Unreal, which requires all bones on a limb to be oriented from the torso toward the end of the limb.
If the knee bones were oriented the same way as both, I think that would solve the problem.

@AnalogKnight
Copy link
Contributor Author

@FlailingFog
Hello, just in case you didn't see the reply as the last reply was 3 weeks ago.
I tried to tweak the PMX skeleton to get it to adapt to the Epic skeleton and so far it works fine in Unreal. However, it does not work on the KKBP skeleton due to the previously mentioned issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants