FlailingFog / KK-Blender-Porter-Pack

Plugin pack for exporting Koikatsu characters to Blender.
307 stars 29 forks source link

Automatic character export and processing #43

Closed MediaMoots closed 2 years ago

MediaMoots commented 2 years ago

What's new

KKBP_Exporter Plugin

A brand new plugin that does away with GME and PMX Exporter It's based off the PMX Exporter plugin. Features:

KKBP

How to use?

Use blender 2.93 (idk if this is required, but it's what I'm using)

  1. Install KKBP_Exporter.dll to KK
  2. Export (No need to change blink/eye look/pose, plugin does it automatically) image
  3. Import with CATS, go through the hair separation process, merge duplicates (only the ones with .00X at the end) etc.
  4. Import textures (step 2a) by selecting the folder with the model.pmx inside.
  5. Do the same for step 2b
  6. Tweak intensities and enjoy.

Issues

39

48

#38 #40 #41 #42 #45 #46 #50 Sometimes the color for the top is wrong (Such as a sailor part), in that case you can just copy the colors from another part that is correct or just switch to use the Main Tex instead of the Color Mask

Please let me know if you find any bugs.

FlailingFog commented 2 years ago

Literally unbelievable, I tried it once and it works great. Thank you again for doing this, you've pushed the export process to the endgame.

I'll look at it more in depth today and try to address your other issues

MediaMoots commented 2 years ago

Fixed:

45

46

38

Plugin updates: Export the kage color

KKBP updates: Set the kage color

New issues:

48

FlailingFog commented 2 years ago

Okay, here's my comments:

MediaMoots commented 2 years ago

Thanks for the comments!

The tongue color looks correct now, but the nipple colors are still off (except for that one card I pointed out). Again this doesn't personally bother me

Are you using blender 2.93? I guess it's not a big deal, it might work for some ppl but not for others. They can always set the color themselves.

For dark clothes, the automatic dark color slider in blender needs to be disabled or you'll get the wrong colors

Ok thanks!

You've added tags that identify what material belongs to what mesh instance. This identification lets you combine the .00X materials automatically because there's no fear of combining the wrong materials together! I can add this later if you don't feel like doing it.

Good point, I'll try and script it, if not, then feel free to do that. Edit: I think I'll let you do this one, haha

Just an observation, the plugin seems to break the "All accs off" button on the right of the charamaker

I don't have that button? image image The show acc tick boxes work for me.

MediaMoots commented 2 years ago

New update should fix:

For dark clothes, the automatic dark color slider in blender needs to be disabled or you'll get the wrong colors

The plugin tries to open the Documents folder in explorer after exporting instead of the PMX folder

FlailingFog commented 2 years ago

Are you using blender 2.93?

I'm on 2.93.0. I'll update to see if it makes a difference

I don't have that button?

This one? image

MediaMoots commented 2 years ago

This one?

Hmm, I don't have it, maybe I'm lacking a plugin? I think you can use the acc checkboxes on the right to get the same effect.

MediaMoots commented 2 years ago

Another observation, I like that dynamic bones are disabled during export but I'm assuming when people make the card they take these into account, so on certain cards accessories will look a little off or clip into things after being imported to blender (like the bow in the one below). This doesn't bother me, but I guess it's something to note

So, after a bit of digging here's the issue: The plugin does not disable dynamic bones, rather, it can't/doesn't export bone rotations. I don't know how to fix this (for now), so I guess it's just something that users need to take note of.

MediaMoots commented 2 years ago

New Plugin: Exports pattern colors correctly

New Scripts: Imports and applies clothing patterns

FlailingFog commented 2 years ago

I've got a few extra notes:

New update should fix:

Works good now!

it can't/doesn't export bone rotations.

Just found out that you can manually rotate the bones in blender to look correct, apply the current armature modifier rotations as a shapekey, and then apply the bone rotations in pose mode as a rest post, so this isn't a big deal at all

MediaMoots commented 2 years ago

Weird, but updating to 2.93.4 fixed the color issue for me

Nice, that's great!

The pattern import didn't seem to work for me on Chika. It was imported into Blender but not applied

Oh no, not another bug. This is what Chika looks like for me, what about for you? image

I'm pretty sure I shared a Megumin card with you earlier.

Good catch, I'll try to fix it.

Would it be possible to apply the warm Sunset LUT to the body and face materials instead of the cold Night LUT?

Ok.

MediaMoots commented 2 years ago

New update

Fixed: Long names Use the sunset lut

FlailingFog commented 2 years ago

This is what Chika looks like for me, what about for you?

Sorry, I realized I installed the new version without reloading blender, so it was using the old one when I tried it originally. This works for me

MediaMoots commented 2 years ago

Ah, nice

FlailingFog commented 2 years ago

Use the sunset lut

To be honest I don't like how this looks compared to the night LUT... Sorry for being picky.

Could you also add the exporter dll with the stock armature? And if you're okay with leaving the remaining issues for later, I can merge this now and we can work from there.

MediaMoots commented 2 years ago

To be honest I don't like how this looks compared to the night LUT...

No problem, so what should we use? Day lut for both light and dark?

Could you also add the exporter dll with the stock armature?

ok

I can merge this now and we can work from there

I think that's fine, let me make sure it all works one more time, then we can merge.

MediaMoots commented 2 years ago

Ok, the latest commits should be final.

Feel free to merge.

When I need to make changes do I just open a new PR?

FlailingFog commented 2 years ago

It's been merged, thanks a ton for adding these features! I really thought what I currently had was as good as it was going to get, so I'm very thankful for your work.

I don't know if you can make edits to an already merged PR, but I'll accept either way if you can/can't

MediaMoots commented 2 years ago

Very cool, thanks!

Feel free to let me know if you find bugs.

Jessiii223 commented 2 years ago

@MediaMoots Hey I'm having trouble getting the KKBP_Exporter Plugin to actually export a pmx file. It exports all the textures and then just doesn't create a pmx file. It's not even working on a base model with no accessories. Any assistance would be much appreciated. Any chance the exporting process generates a log I can investigate?

Edit: Found the log file and I seem to be getting this error

System.MissingFieldException: Field '.ChaClothesComponent.rendNormal03' not found. at PmxBuilder.ExportSpecialTextures () [0x00000] in :0 System.MissingFieldException: Field '.ChaClothesComponent.rendNormal03' not found. at PmxBuilder.GatherCharacterColors () [0x00000] in :0

I'm curious if my install is messed up or something.

MediaMoots commented 2 years ago

@MediaMoots Hey I'm having trouble getting the KKBP_Exporter Plugin to actually export a pmx file. It exports all the textures and then just doesn't create a pmx file. It's not even working on a base model with no accessories. Any assistance would be much appreciated. Any chance the exporting process generates a log I can investigate?

Edit: Found the log file and I seem to be getting this error

System.MissingFieldException: Field '.ChaClothesComponent.rendNormal03' not found. at PmxBuilder.ExportSpecialTextures () [0x00000] in :0 System.MissingFieldException: Field '.ChaClothesComponent.rendNormal03' not found. at PmxBuilder.GatherCharacterColors () [0x00000] in :0

I'm curious if my install is messed up or something.

Oh yeah, it seems you do not have the darkness dlc?

Jessiii223 commented 2 years ago

Oh yeah, it seems you do not have the darkness dlc?

Ok I bet that's the problem. I wasn't aware the dlc was a requirement. I'll try again after I get the non-steam dlc's installed. Thanks!

MediaMoots commented 2 years ago

Ok I bet that's the problem. I wasn't aware the dlc was a requirement. I'll try again after I get the non-steam dlc's installed. Thanks!

Yup, in fact i should have added checks in the plugin to make sure this sort of thing does not happen, ill try and fix this in an update for the plugin. Thanks for finding this bug! :)

Jessiii223 commented 2 years ago

Yup, in fact i should have added checks in the plugin to make sure this sort of thing does not happen, ill try and fix this in an update for the plugin. Thanks for finding this bug! :)

Glad I could help hahaha. I actually noticed another minor issue. For some reason, I have an improperly configured clothing item that exports with the same name as the main body texture causing it to overwrite it. Any chance the texture exporting process could be configured to not overwrite and instead just number the duplicates?

MediaMoots commented 2 years ago

I actually noticed another minor issue.

Could you send me the character card that the issue appears in? thanks!

Jessiii223 commented 2 years ago

Koikatu_F_20211014000454278_Embercres Jessie_Lexiii

The item in question is the fake nails that are in the sock section for some reason.

MediaMoots commented 2 years ago

@Lexiii223 Thank you, please try this plugin v1.2 KKBP_Exporter.zip It should fix both issues (Darkness and nail texture)

Jessiii223 commented 2 years ago

Still having the same issue. image I'm pretty sure it's because this clothing item has it's material set as cf_m_body for whatever reason. It's not a huge issue I can easily remove the item and grab the right texture. Just wanted to let you know about textures overwriting.

MediaMoots commented 2 years ago

Thats weird I specifically made it so it would export like this: image

Oh well, the workaround you have should work for now.

Jessiii223 commented 2 years ago

Interesting. I seriously appreciate all the help!

MediaMoots commented 2 years ago

Still having the same issue. image I'm pretty sure it's because this clothing item has it's material set as cf_m_body for whatever reason. It's not a huge issue I can easily remove the item and grab the right texture. Just wanted to let you know about textures overwriting.

If you have time, please try out PR #61

Jessiii223 commented 2 years ago

If you have time, please try out PR #61

Works great now! Thank you!