feat: Add KoikatsuBlenderPipeline addon with import/export functionality

- Add core addon files (__init__.py, KKPanel.py, preferences.py, common.py)
- Add import pipeline with armature, mesh, and material modification modules
- Add export pipeline with material baking and FBX preparation utilities
- Add material combiner tool for texture atlas generation and optimization
- Add extras utilities for animation, rigging, and asset management
- Add bone orientation data from better_fbx for accurate skeletal structure
- Add comprehensive documentation and wiki with multi-language support (EN, JP, ZH)
- Add animation library retargeting lists for ARP and Rokoko motion capture
- Add Rigify integration scripts for advanced rigging workflows
- Add shader file (KK Shader V8.0.blend) for material rendering
- Add manifest and license files for addon distribution
- Add changelog documenting version history and improvements
- Initialize complete Blender addon project for Koikatsu character import/export
This commit is contained in:
2025-12-06 15:26:19 +08:00
commit 5d9e09e9c3
122 changed files with 22683 additions and 0 deletions

65
wiki/README.md Normal file
View File

@@ -0,0 +1,65 @@
## How to use the exporter
1. Install the <a style="font-weight:bold" href="https://github.com/ManlyMarco/KK-HF_Patch"> HF Patch for Koikatsu</a>, or the <a style="font-weight:bold" href="https://github.com/ManlyMarco/KKS-HF_Patch"> HF Patch for Koikatsu Sunshine</a>.
**Pre-modded repacks will not work** unless you update with the repack's auto-updater or install the HF patch.
[Click here for repack workaround #1.](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/465#issuecomment-2602969013)
[Click here for repack workaround #2.](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/523)
[Click here for repack workaround #3.](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/560)
1. Find your Koikatsu install directory and drag the <a style="font-weight:bold" href="https://github.com/FlailingFog/KK-Blender-Porter-Pack/releases">KKBP exporter</a> into the /bepinex/plugins/ folder
1. Start Koikatsu and open the Character Maker
1. Enable the KKBP Exporter window.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exportpanel2.png)
1. Change your export options. [See this page for an explanation of all export options](export_panel).
1. Click the "Export Model for KKBP" button at the top of the screen. This may take a few minutes depending on your computer hardware.
3. A folder in your Koikatsu install directory will popup when the export is finished
## How to use the importer
1. Open Blender 4.2 LTS. **Other versions are not guaranteed to work.** [Click here if you are not using Blender 4.2](faq)
1. Install <a style="font-weight:bold" href="https://extensions.blender.org/add-ons/mmd-tools/">mmd_tools</a> in Blender
1. Install <a style="font-weight:bold" href="https://github.com/FlailingFog/KK-Blender-Porter-Pack/releases">KKBP Importer 8.0.0</a> in Blender
1. After you install both addons, you can click the "Import model" button in the KKBP panel. [An explanation of all import options can be found here](import_panel)
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel2.png)
1. Choose the .pmx file from the export folder
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel3.png)
1. The blender console will appear and begin importing the model. This may take a few minutes depending on your computer hardware
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel4.png)
1. Check there were no errors during import in the scripting tab. A successful import will end in "KKBP import finished in XX minutes"
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel5.png)
## Editing the model in Blender
1. If there were no errors, you can start using the model as is by activating the material preview on the top right. If your computer is taking a long time to compile all the shaders (longer than 60 seconds), it is recommended to finalize the materials by clicking the button in the KKBP panel. If you finalize the materials then the shaders will compile very quickly. Finalizing the materials can take anywhere from 5 to 30 minutes depending on your hardware and model.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel6.png)
1. If there were no errors but something doesn't look right, check the [FAQ](faq) or the [material breakdown](material_breakdown) page for information on how to edit the materials.
1. If you got an error during import, check the [FAQ](faq), or search [the issues page on the Github repo](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues) to see if anyone else had the same issue as you.
## Exporting from Blender to fbx:
1. Enable the Atlas option, then click the Finalize Materials button in the KKBP panel
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/atlasoption.png)
1. This does three things
* Finalizes all of the materials to png files and saves them to the baked_files folder in the export folder
* Creates an atlas file for your body / hair / clothes and saves them to the atlas_files folder in your export folder
* Creates a new collection that uses the atlas
1. Hide the original collection in the outliner and show the new collection
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel7.png)
1. If you want to reduce the bone count, or convert the model's armature for VRM / VRChat / Unreal Engine, click the "Prep for target application" button.
1. Click the export button in the collection tab to export an fbx file to the atlas_files folder in the export folder
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel8.png)

65
wiki/README_zh.md Normal file
View File

@@ -0,0 +1,65 @@
## 如何使用导出器
1. 安装 <a style="font-weight:bold" href="https://github.com/ManlyMarco/KK-HF_Patch">Koikatsu 的 HF 补丁</a>,或 <a style="font-weight:bold" href="https://github.com/ManlyMarco/KKS-HF_Patch">Koikatsu Sunshine 的 HF 补丁</a>
**预修改的重新打包版本将无法工作**,除非你使用重新打包的自动更新程序更新或安装 HF 补丁。
[点击这里查看重新打包解决方法 #1。](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/465#issuecomment-2602969013)
[点击这里查看重新打包解决方法 #2。](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/523)
[点击这里查看重新打包解决方法 #3。](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/560)
1. 找到你的 Koikatsu 安装目录,并将 <a style="font-weight:bold" href="https://github.com/FlailingFog/KK-Blender-Porter-Pack/releases">KKBP 导出器</a>拖到 /bepinex/plugins/ 文件夹中
1. 启动 Koikatsu 并打开角色制作器
1. 启用 KKBP 导出器窗口。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exportpanel2.png)
1. 更改你的导出选项。[有关所有导出选项的说明,请参见此页面](export_panel)。
1. 点击屏幕顶部的"Export Model for KKBP"按钮。这可能需要几分钟,具体取决于你的计算机硬件。
3. 导出完成后Koikatsu 安装目录中的一个文件夹将弹出
## 如何使用导入器
1. 打开 Blender 4.2 LTS。**不保证其他版本可以工作。** [如果你没有使用 Blender 4.2,请点击这里](faq)
1. 在 Blender 中安装 <a style="font-weight:bold" href="https://extensions.blender.org/add-ons/mmd-tools/">mmd_tools</a>
1. 在 Blender 中安装 <a style="font-weight:bold" href="https://github.com/FlailingFog/KK-Blender-Porter-Pack/releases">KKBP Importer 8.0.0</a>
1. 安装两个插件后,你可以点击 KKBP 面板中的"Import model"按钮。[所有导入选项的说明可以在这里找到](import_panel)
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel2.png)
1. 从导出文件夹中选择 .pmx 文件
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel3.png)
1. Blender 控制台将出现并开始导入模型。这可能需要几分钟,具体取决于你的计算机硬件
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel4.png)
1. 在脚本选项卡中检查导入期间是否没有错误。成功的导入将以"KKBP import finished in XX minutes"结束
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel5.png)
## 在 Blender 中编辑模型
1. 如果没有错误,你可以通过激活右上角的材质预览来开始按原样使用模型。如果你的计算机编译所有着色器需要很长时间(超过 60 秒),建议通过点击 KKBP 面板中的按钮来完成材质。如果你完成材质,则着色器将非常快速地编译。完成材质可能需要 5 到 30 分钟,具体取决于你的硬件和模型。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel6.png)
1. 如果没有错误但某些东西看起来不对,请查看 [FAQ](faq) 或[材质分解](material_breakdown)页面以获取有关如何编辑材质的信息。
1. 如果你在导入期间遇到错误,请查看 [FAQ](faq),或搜索 [Github 仓库上的问题页面](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues)以查看是否有其他人遇到与你相同的问题。
## 从 Blender 导出到 fbx
1. 启用 Atlas 选项,然后点击 KKBP 面板中的完成材质按钮
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/atlasoption.png)
1. 这会做三件事
* 将所有材质完成为 png 文件并将它们保存到导出文件夹中的 baked_files 文件夹
* 为你的身体/头发/衣服创建一个图集文件并将它们保存到导出文件夹中的 atlas_files 文件夹
* 创建一个使用图集的新集合
1. 在大纲视图中隐藏原始集合并显示新集合
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel7.png)
1. 如果你想减少骨骼数量,或为 VRM / VRChat / Unreal Engine 转换模型的骨架,请点击"Prep for target application"按钮。
1. 点击集合选项卡中的导出按钮,将 fbx 文件导出到导出文件夹中的 atlas_files 文件夹
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/importpanel8.png)

68
wiki/armature.md Normal file
View File

@@ -0,0 +1,68 @@
---
layout: default
---
# Armature
## KKBP Armature
The KKBP armature is the best armature to use **if you plan on exporting the model**.
The KKBP armature features the following:
* Eye controller bone
* Hand and Leg IKs
* A heel IK
* A center bone that lets you move all bones at once
## Rigify Armature
The Rigify armature is the best armature to use **if you plan on using the model in Blender**.
The Rigify addon must be enabled for this armature to work.
The Rigify armature includes many different features:
* Eye controller bone
* Hand and Leg IKs
* A heel IK
* A center bone that lets you move all bones at once
* IK to FK sliders
* IK to FK transition helpers
* IK limb stretches
* Tweak bones for limb deformation
* Easy-to-use finger bones
* Finger IKs
* Palm bones
* Foot spin bone
* Eye look target
* Individual eye bones
* FK eye bones
* Tongue IK
* Head and Neck follow sliders
* Head look target
Check [this video series for understanding what the Rigify addon is and how it can be used in general](https://www.youtube.com/watch?v=-JSFcSxsaTs&list=PLdcL5aF8ZcJv68SSdwxip33M7snakl6Dx).
Check [this page for information specific to the KKBP Rigify armature](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/78).
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm4.gif)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm5.gif)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm6.png)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm7.png)
## Koikatsu Armature
The Koikatsu Armature is an armature that tries to match the bone structure of the in-game armature. This armature does not come with IKs and is FK only.
## PMX Armature
The PMX Armature is the armature that comes straight out of the KKBP exporter. This armature does not come with IKs and is FK only.
## Bone Collections
The KKBP armature hides some bone collections by default so the view is less cluttered. These bones can be found in each collection.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm1.png)
The bone collection panel can be found by selecting the armature and looking in the Data tab. You can click the eye next to a collection to hide/show it.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm2.png)
## Joint corrections
The KKBP and Rigify armatures make use of helper bones to make the mesh look better when it deforms. These helper bones can be found in bone collections 2 and 3 of the KKBP armature. Some joint corrections are implemented by giving the helper bones bone contraints and other corrections are implemented by giving the helper bones drivers to automatically set their location and rotation when a specific bone is rotated. An example of a joint correction bone is shown below. In the default position, the cf_s_elboback_L bone stays in place. When the arm is bent the location drivers for cf_s_elboback_L cause the bone to move out and deform the arm properly. The third image is an example of what the arm would look like without the location drivers enabled. **Joint corrections are not carried over when you export the model, so you will likely experience weird bends like this unless you re-implement the drivers in your target program.** A list of all helper bones can be found in the create_joint_drivers function of [modifyarmature.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifyarmature.py).
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm3.png)

67
wiki/armature_zh.md Normal file
View File

@@ -0,0 +1,67 @@
---
layout: default
---
# 骨架
## KKBP 骨架
如果你**计划导出模型**KKBP 骨架是最佳选择。
KKBP 骨架具有以下特性:
* 眼睛控制器骨骼
* 手部和腿部 IK
* 脚跟 IK
* 可以一次移动所有骨骼的中心骨骼
## Rigify 骨架
如果你**计划在 Blender 中使用模型**Rigify 骨架是最佳选择。
必须启用 Rigify 插件才能使此骨架正常工作。
Rigify 骨架包含许多不同的功能:
* 眼睛控制器骨骼
* 手部和腿部 IK
* 脚跟 IK
* 可以一次移动所有骨骼的中心骨骼
* IK 到 FK 滑块
* IK 到 FK 过渡辅助器
* IK 肢体拉伸
* 用于肢体变形的微调骨骼
* 易于使用的手指骨骼
* 手指 IK
* 手掌骨骼
* 脚部旋转骨骼
* 眼睛注视目标
* 独立眼睛骨骼
* FK 眼睛骨骼
* 舌头 IK
* 头部和颈部跟随滑块
* 头部注视目标
查看[此视频系列以了解 Rigify 插件是什么以及如何一般使用它](https://www.youtube.com/watch?v=-JSFcSxsaTs&list=PLdcL5aF8ZcJv68SSdwxip33M7snakl6Dx)。
查看[此页面以获取有关 KKBP Rigify 骨架的特定信息](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/78)。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm4.gif)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm5.gif)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm6.png)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm7.png)
## Koikatsu 骨架
Koikatsu 骨架是一个试图匹配游戏内骨架结构的骨架。此骨架不带 IK仅支持 FK。
## PMX 骨架
PMX 骨架是直接从 KKBP 导出器导出的骨架。此骨架不带 IK仅支持 FK。
## 骨骼集合
KKBP 骨架默认隐藏一些骨骼集合,以使视图不那么杂乱。这些骨骼可以在每个集合中找到。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm1.png)
可以通过选择骨架并在数据选项卡中查找来找到骨骼集合面板。你可以点击集合旁边的眼睛图标来隐藏/显示它。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm2.png)
## 关节修正
KKBP 和 Rigify 骨架使用辅助骨骼来使网格在变形时看起来更好。这些辅助骨骼可以在 KKBP 骨架的骨骼集合 2 和 3 中找到。一些关节修正是通过给辅助骨骼添加骨骼约束来实现的其他修正则是通过给辅助骨骼添加驱动器来实现的当特定骨骼旋转时自动设置它们的位置和旋转。下面显示了一个关节修正骨骼的示例。在默认位置cf_s_elboback_L 骨骼保持在原位。当手臂弯曲时cf_s_elboback_L 的位置驱动器会使骨骼向外移动并正确变形手臂。第三张图片是没有启用位置驱动器时手臂的样子。**导出模型时不会保留关节修正,因此除非在目标程序中重新实现驱动器,否则可能会遇到这样的奇怪弯曲。** 所有辅助骨骼的列表可以在 [modifyarmature.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifyarmature.py) 的 create_joint_drivers 函数中找到。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/arm3.png)

45
wiki/export_panel.md Normal file
View File

@@ -0,0 +1,45 @@
## Exporter Panel settings
Each setting in the exporter panel will be briefly detailed on this page.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exportpanel.png)
### Freeze current pose
The pose is usually reset to a T pose during export. Enable this option to not reset to a T pose, and to keep the pose you have selected in the character maker. Because a pose is pre-applied to the armature, the armature will not work correctly in blender. This setting may be useful for 3D prints of koikatsu models or for stills. This exporter setting will force the Koikatsu armature in blender. See the picture below for an example of a pose being applied to the model.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter4.png)
### Export without physics
Some outfits rely on in-game physics to look correct. Enable this option to disable the in-game physics during export. This may make certain outfits look weird because of the lack of physics, but it is useful if you want to apply your own physics to the model in blender.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.1.png)
### Freeze shapekeys
Shapekeys are reverted to their default values during export. Enable this option to freeze any shapekeys you have enabled in the character maker to the base mesh. Because the mesh is pre-deformed, other shapekeys will not work correctly in blender. Tear and gag eye shapekeys will also not work in blender. See the picture below for an example of some shapekeys being pre-applied to the base mesh.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter3.png)
### Export variations
This will export any available clothing variations. Not all clothes have variations.
When imported, the variations will be hidden in the outliner by default.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter1.png)
### Export all outfits
This will make the exporter export all of the card's outfits instead of just the currently selected one. This will dramatically increase koikatsu export times and blender import times.
### Export hit meshes
This will export the hit mesh. An example of the hit mesh is shown below.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.png)
### Enable pushups
Outfit pushups (shown below) are disabled during export. Enable this option to keep them on.
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.2.png)

45
wiki/export_panel_zh.md Normal file
View File

@@ -0,0 +1,45 @@
## 导出器面板设置
本页将简要介绍导出器面板中的每个设置。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exportpanel.png)
### 冻结当前姿势
导出期间通常会将姿势重置为 T 姿势。启用此选项可不重置为 T 姿势,并保持你在角色制作器中选择的姿势。由于姿势已预先应用到骨架上,骨架在 Blender 中将无法正常工作。此设置可能对 Koikatsu 模型的 3D 打印或静态图像有用。此导出器设置将强制使用 Blender 中的 Koikatsu 骨架。请参见下图以了解应用到模型的姿势示例。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter4.png)
### 导出时不使用物理
某些服装依赖游戏内物理才能看起来正确。启用此选项可在导出期间禁用游戏内物理。这可能会使某些服装因缺少物理而看起来很奇怪,但如果你想在 Blender 中为模型应用自己的物理,这会很有用。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.1.png)
### 冻结形态键
导出期间形态键会恢复为默认值。启用此选项可将你在角色制作器中启用的任何形态键冻结到基础网格。由于网格已预先变形,其他形态键在 Blender 中将无法正常工作。泪水和口塞眼睛形态键在 Blender 中也将无法工作。请参见下图以了解一些预先应用到基础网格的形态键示例。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter3.png)
### 导出变体
这将导出任何可用的服装变体。并非所有服装都有变体。
导入时,变体将默认在大纲视图中隐藏。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter1.png)
### 导出所有服装
这将使导出器导出卡片的所有服装,而不仅仅是当前选择的服装。这将大大增加 Koikatsu 导出时间和 Blender 导入时间。
### 导出碰撞网格
这将导出碰撞网格。下面显示了碰撞网格的示例。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.png)
### 启用推高效果
导出期间会禁用服装推高效果(如下所示)。启用此选项可保持它们开启。
![ ](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/exporter2.2.png)

53
wiki/faq.md Normal file
View File

@@ -0,0 +1,53 @@
## Frequency asked questions
## I don't know what versions of the programs or addons to use
Check the table below. KKBP has been updated many times to keep up with newer Blender versions and is **not** backwards compatible, so the version of KKBP you need to use depends on what your Blender version is.
|Blender version|Last working KKBP version|PMX Importer dependency version|Koikatsu HF Patch version|Koikatsu Sunshine HF Patch version|Video guide link|
|---|---|---|---|---|---|
4.4.0|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[Here](https://www.youtube.com/watch?v=QvXl4jRppP4&list=PLhiuav2SCuveMgQUA2YqqbSE7BtOrkZ-Q)|
4.3.2|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuveWvSwKg18l6mDSl5xl4x7o)|
4.2.2 LTS|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuveWvSwKg18l6mDSl5xl4x7o)|
|3.6.9 LTS|6.6.3|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.5|6.5.0|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.4|6.4.2|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.3|6.2.1|mmd_tools 2.9.2|HF Patch 3.17|HF Patch for KKS 1.7|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.2|5.1.1|CATS Blender Plugin 0.19|HF Patch 3.13|--|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvdEAbUzJxSqp61fNiPTFfwb)|
|2.93|4.3.0|CATS Blender Plugin 0.18|HF Patch 3.7|--|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvd5eAOb3Ct1eovFAlgv-iwe)|
|2.91.2|4.2.1|CATS Blender Plugin 0.18|HF Patch 3.7|--|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvd5eAOb3Ct1eovFAlgv-iwe)|
|2.83.4|3.06|CATS Blender Plugin 0.17|HF Patch 3.0|--|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvfIJ20QrEzkoFl__F9VaRk2)|
|2.82.7|V2|[This outdated mmd_tools version](https://github.com/powroupi/blender_mmd_tools?tab=readme-ov-file)|--|--|[Here](https://www.youtube.com/playlist?list=PLhiuav2SCuvfx_IJw2TnYmPdWYwIzo7SO)|
## I'm using the right versions but it's still not working
**Some heavily modded characters will not import correctly.** Custom head mods, body mods and other mods that change body material names or shapekey names from the default will likely not work. Try exporting the default character that you get when you startup the character creator, and double check the table for choosing the right version at the top of the page. If that works, slowly try adding back each piece of clothing / hair until the item that causes the issue is found. If that didn't work and you are having issues with the default character, triple check you installed everything in the version table at the top of the page.
## My top is missing
KKBP applies the alphamask to the body by default. If your character is supposed to be a shirtless guy, you can find the body material...
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq1.png)
and enable the "Force visibility" slider to show the top of the body
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq2.png)
If you're using multiple outfits, the alphamask may change based on the outfit. If you need to change the alphamask you can open up the Body textures node group on the body material...
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq3.png)
and change the alphamask to the body_AM_## file that corresponds to your outfit
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq4.png)
## My clothes are missing
Make sure the clothing you're looking for isn't hidden in the outliner. In certain situations, KKBP will automatically hide some clothing objects from view. In rare cases, the outfit will just not export. Check the "Outfit 00" folder in your export folder for a .pmx file. If there's no .pmx file the exporter failed to get the clothing. Please submit a new issue on the github if you find a card that does this.
## I'm getting fully white textures after importing my character
The import script failed somewhere. In Blender, click the Scripting tab on the top of the window. Any errors will appear at the bottom of the log. A successful import log will end in "KKBP import finished"
## I don't an error and my clothing or hair doesn't look correct
KKBP should load in a majority of clothing and hair correctly. If it doesn't, check the [material breakdown](material_breakdown) page for information on how to fix material issues.
Please submit a new issue on the github if you find a card that does this.
## Blender crashed during import
Try importing again. It does that every once in a while. The import process can take around 1GB of RAM and 2GB of VRAM (or around 4.5GB of RAM and 3GB of VRAM on complex cards with many accessories), so if you're low on either of those it may crash because of that too.

52
wiki/faq_zh.md Normal file
View File

@@ -0,0 +1,52 @@
## 常见问题
## 我不知道应该使用哪个版本的程序或插件
请查看下表。KKBP 已多次更新以跟上较新的 Blender 版本,并且**不**向后兼容,因此你需要使用的 KKBP 版本取决于你的 Blender 版本。
|Blender 版本|最后可用的 KKBP 版本|PMX 导入器依赖版本|Koikatsu HF 补丁版本|Koikatsu Sunshine HF 补丁版本|视频指南链接|
|---|---|---|---|---|---|
4.4.0|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[这里](https://www.youtube.com/watch?v=QvXl4jRppP4&list=PLhiuav2SCuveMgQUA2YqqbSE7BtOrkZ-Q)|
4.3.2|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuveWvSwKg18l6mDSl5xl4x7o)|
4.2.2 LTS|8.0.0|mmd_tools 4.2.2|HF Patch 3.32|HF Patch for KKS 1.22|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuveWvSwKg18l6mDSl5xl4x7o)|
|3.6.9 LTS|6.6.3|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.5|6.5.0|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.4|6.4.2|mmd_tools 2.9.2|HF Patch 3.22|HF Patch for KKS 1.7|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.3|6.2.1|mmd_tools 2.9.2|HF Patch 3.17|HF Patch for KKS 1.7|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvc-wbexi2vwSnVHnZFwkYNP)|
|3.2|5.1.1|CATS Blender Plugin 0.19|HF Patch 3.13|--|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvdEAbUzJxSqp61fNiPTFfwb)|
|2.93|4.3.0|CATS Blender Plugin 0.18|HF Patch 3.7|--|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvd5eAOb3Ct1eovFAlgv-iwe)|
|2.91.2|4.2.1|CATS Blender Plugin 0.18|HF Patch 3.7|--|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvd5eAOb3Ct1eovFAlgv-iwe)|
|2.83.4|3.06|CATS Blender Plugin 0.17|HF Patch 3.0|--|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvfIJ20QrEzkoFl__F9VaRk2)|
|2.82.7|V2|[这个过时的 mmd_tools 版本](https://github.com/powroupi/blender_mmd_tools?tab=readme-ov-file)|--|--|[这里](https://www.youtube.com/playlist?list=PLhiuav2SCuvfx_IJw2TnYmPdWYwIzo7SO)|
## 我使用了正确的版本但仍然无法工作
**一些高度修改的角色将无法正确导入。** 自定义头部模组、身体模组和其他更改默认身体材质名称或形态键名称的模组可能无法工作。尝试导出启动角色创建器时获得的默认角色,并仔细检查页面顶部的版本选择表。如果可以工作,请慢慢尝试添加回每件服装/头发,直到找到导致问题的项目。如果这不起作用并且你在使用默认角色时遇到问题,请再次检查你是否安装了页面顶部版本表中的所有内容。
## 我的上衣不见了
KKBP 默认将 alpha 蒙版应用于身体。如果你的角色应该是一个赤裸上身的男性,你可以找到身体材质...
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq1.png)
并启用"强制可见性"滑块以显示身体的上部
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq2.png)
如果你使用多套服装alpha 蒙版可能会根据服装而变化。如果你需要更改 alpha 蒙版,可以打开身体材质上的 Body textures 节点组...
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq3.png)
并将 alpha 蒙版更改为与你的服装对应的 body_AM_## 文件
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/faq4.png)
## 我的衣服不见了
确保你要查找的服装在大纲视图中没有被隐藏。在某些情况下KKBP 会自动隐藏一些服装对象。在极少数情况下,服装根本不会导出。检查导出文件夹中的"Outfit 00"文件夹是否有 .pmx 文件。如果没有 .pmx 文件,则导出器未能获取服装。如果你发现这样的卡片,请在 github 上提交新问题。
## 导入角色后我得到了全白的纹理
导入脚本在某处失败了。在 Blender 中,点击窗口顶部的脚本选项卡。任何错误都会出现在日志底部。成功的导入日志将以"KKBP import finished"结束
## 我没有错误,但我的服装或头发看起来不正确
KKBP 应该正确加载大多数服装和头发。如果没有,请查看[材质分解](material_breakdown)页面以获取有关如何修复材质问题的信息。
如果你发现这样的卡片,请在 github 上提交新问题。
## Blender 在导入期间崩溃了
尝试再次导入。它偶尔会这样做。导入过程可能需要大约 1GB 的 RAM 和 2GB 的 VRAM或在具有许多配饰的复杂卡片上大约 4.5GB 的 RAM 和 3GB 的 VRAM因此如果你的任何一个都不足它可能会因此而崩溃。

19
wiki/import_panel.md Normal file
View File

@@ -0,0 +1,19 @@
# Import panel options
**You can hold your mouse over each option in the KKBP panel to get an explanation on what it does!**
This page will only cover things that are not immediately obvious from the explanations built into the panel.
## Default panel settings
If you expand KKBP in Blender's addon menu, you can set default settings for the panel (so you don't have to set them each time you restart Blender).
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/panel1.png)
## Extras panel
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/panel2.png)
* Instructions for exporting studio objects from the game and importing them using the button in the panel [can be found here](https://www.youtube.com/watch?v=PeryYTsAN6E)
* Instructions for exporting animations from the game and applying them using the button in the panel can be found [here if you prefer text](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/extras/animationlibrary/createanimationlibrary.py) or [here if you prefer video](https://www.youtube.com/watch?v=Ezsy6kwgBE0)
* If the "Use KKBP Armature" option was selected during import but you now want to swap to a Rigify armature, you can click the "Convert for Rigify" button to permanentally convert the KKBP one to a Rigify one.
* The "Separate Eyes and Eyebrows" button will separate the eyes and eyebrows into separate objects, then link their shapekeys to the Body object's shapekeys. This can be combined with the Cryptomatte compositor features to make the Eyes and Eyebrows show through the hair. See [this video for an example of selecting objects with Cryptomatte](https://www.youtube.com/watch?v=3UR4eXxMlsU).
* The "Setup Materials for Material Combiner" button will set up your materials for [Shotariya's Material Combiner addon](https://github.com/Grim-es/material-combiner-addon). You must Finalize your materials before you can do this.

19
wiki/import_panel_zh.md Normal file
View File

@@ -0,0 +1,19 @@
# 导入面板选项
**你可以将鼠标悬停在 KKBP 面板中的每个选项上以获取有关其功能的说明!**
本页仅涵盖面板内置说明中不太明显的内容。
## 默认面板设置
如果你在 Blender 的插件菜单中展开 KKBP可以为面板设置默认设置这样你就不必在每次重启 Blender 时都设置它们)。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/panel1.png)
## 额外功能面板
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/panel2.png)
* 从游戏中导出工作室对象并使用面板中的按钮导入它们的说明[可以在这里找到](https://www.youtube.com/watch?v=PeryYTsAN6E)
* 从游戏中导出动画并使用面板中的按钮应用它们的说明可以在[这里找到(如果你喜欢文本)](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/extras/animationlibrary/createanimationlibrary.py)或[这里(如果你喜欢视频)](https://www.youtube.com/watch?v=Ezsy6kwgBE0)
* 如果在导入期间选择了"使用 KKBP 骨架"选项,但你现在想切换到 Rigify 骨架,可以点击"转换为 Rigify"按钮将 KKBP 骨架永久转换为 Rigify 骨架。
* "分离眼睛和眉毛"按钮将眼睛和眉毛分离为单独的对象,然后将它们的形态键链接到 Body 对象的形态键。这可以与 Cryptomatte 合成器功能结合使用,使眼睛和眉毛透过头发显示。请参见[此视频以了解使用 Cryptomatte 选择对象的示例](https://www.youtube.com/watch?v=3UR4eXxMlsU)。
* "为材质合并器设置材质"按钮将为 [Shotariya 的材质合并器插件](https://github.com/Grim-es/material-combiner-addon)设置你的材质。在执行此操作之前,你必须先完成材质。

107
wiki/material.md Normal file
View File

@@ -0,0 +1,107 @@
## Material
## Before you begin...
**There's a lot of information on the [material breakdown](material_breakdown) if you're having issues with a material or want to know how a typical KKBP material works.**
## Updating a finalized material
If you want to go back to the original material to edit it again, you can set the material back to the -ORG version of the material.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p3.png)
Here I have updated the hair color on the original shader
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p5.png)
To finalize the material again, just click the "Finalize Materials" button on the KKBP panel. The material will be re-finalized and the lightweight shader + atlas model will be updated.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p6.png)
## Special materials (Outlines)
Outlines have a different material setup. If an alphamask is available for this material, the alphamask's red channel will be used to determine where the outline should be transparent. If it is not available, the maintex alpha channel will be used for determining transparency instead. If neither are available, the outline will be visible everywhere on the material. The outline materials will not be converted to png files when you click the Finalize Materials button.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat4.png)
## Special materials (Eyes)
The eye texture is automatically created by the KKBP Exporter. If you want to use the custom eye slider and change the colors of the eye on the fly, you have to extract certain eye textures from the game using SB3Utility, then load them into the green texture group and recreate the eye from scratch. [Here's an example of doing that](https://www.youtube.com/watch?v=XFt12n7ByBI&t=231)
## Special materials (Body)
The body has a transparency mask to prevent it from clipping through some clothes [Check here for making the body visible](https://flailingfog.github.io/faq).
If you are finding that the body is still transparent in the wrong areas, you can either edit the body alpha mask (location shown below), or load a different body_AM file from your pmx export folder. The first body alpha mask for the first outfit is automatically loaded in (cf_m_body_AM.png), so if you switch to a different outfit you'll have to switch the body mask to the right one (ex. body_AM_01 for outfit 01, 02 for outfit 02, etc).
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat5p4.png)
## Special materials (Hair)
Hair materials are not linked. If you modify one hair material and then click the update hair materials button, the rest of the hair materials on this object will be updated using the settings of the current hair material.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat5p5.png)
## Special materials (Tears)
Tears have a special material that uses a gradient to get a look similar to the in-game one. You can make the tears use an HDRI or a flat color instead by using the sliders in the Tears material.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6.png)
Tears can be activated in the shapekey panel
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## Special materials (Gag eyes)
There are three sets of Gag eyes: Gag00, Gag01 and Gag02
Gag00 images are displayed in a mirrored fashion (both eyes mirror each other)
Gag01 images are displayed as is
Gag02 images are animated by continuosly changing the location of the UV map over time (also used by the Cartoony Wink expression)
Gag eyes use drivers to determine what expression to display. When you activate a gag shapekey on the Body object, certain eye materials are moved back into the head to hide them, the gag eye mesh comes out to the front of the head and an image is displayed depending on which gag shapekey was activated.
The default import comes with settings that make the face area behind the gag eyes look bad. Disabling the face eyeshadow intensity, setting the face rim to "None", and using the features in the "Permanent light / dark settings" section below can help with that.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat7.png)
Gag eyes can be activated in the shapekey panel
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## Koikatsu color conversion
The colors you see in Koikatsu are not the real colors being used; they're actually being saturated. In order to replicate the colors shown in koikatsu, all colors and images are run through the color_to_KK and image_to_KK functions in [converttextures.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/converttextures.py) to convert the base colors to the "real" colors seen visually in the game. This process is also run on all Maintex images.
Here's an example of a material before and after color saturation
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat11.png)
## Koikatsu dark color conversion
The game uses a second color conversion process to automatically get dark colors for every light color. The skin_dark_color and clothes_dark_color functions in [modifymaterial.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifymaterial.py) are used to replicate this process in Blender and to automatically obtain dark colors for every piece of clothing and create dark Maintex images. If this is disabled in the panel, you'll only get the light colors.
## Cycles support
Basic Cycles support is available by selecting "Use Cycles" in the panel. This will replace the Rim node group in the KK shaders with a Toon-like shader compatible with Cycles. The outline is disabled in the mode.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat12.png)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat13.png)
## Normal blending methods
A different normal blending method is available in the Toon Shading group. Enter it and find the node to use the Unity tech demo blending method. These blending methods [were taken from this page](https://blog.selfshadow.com/publications/blending-in-detail/) and [also this page](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/166)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat16.png)
## Normal quality settings
Normals are set to lower quality by default to increase animation playback performance. To change to higher quality normals, just enter the Toon Shading group, connect the higher quality output node and unmute the node by selecting it and pressing the M key.
This is done automatically when baking materials so you don't need to worry about it if you plan on exporting the model from blender.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat17.png)
## Toon shading settings
Toon shading is created by the color ramps in the Toon Shading group. You can edit the color ramps in this section to increase or decrease the amount of light needed to show the light or dark version of the materials.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat18.png)
## Permanent light / dark settings
Parts of each material can be made permanently light or dark using the Permalight image in the texture node group. The red channel of the image is used for permalight and the blue channel is used for permadark
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat19.png)
## Editing the KKBP shader
The KKBP library file can be edited if you want to use a custom material or node setup for all imported models. Keep in mind the import scripts will error out if certain things are missing, so don't delete anything already in the file. The library file is usually located here: ```C:\Users\[your username]\AppData\Roaming\Blender Foundation\Blender\[your blender version]\scripts\addons\KK-Blender-Porter-Pack\KK Shader.blend```

198
wiki/material_breakdown.md Normal file
View File

@@ -0,0 +1,198 @@
# KKBP material breakdown
This page will fully break down the material node logic for KKBP 8.0's
"KK General" material shader. The simple node logic in the KK General
material is used throughout the entire project, so reading and
understanding this page should allow you to learn how to fix or debug
any KKBP material you encounter.
## Before you begin...
A large amount of cards were chosen at random and tested during the
development of KKBP 8.0.
Out of 133 cards...
* 104 (78%) worked out of the box
* 22 (17%) had odd material issues that took 5 minutes to fix
* 5 (4%) exported but did not import
* 1 (0.5%) had odd material issues that would likely take someone a while to figure out
* 1 (0.5%) did not export and crashed the game
This means if you're having issues **there's a 94.5% chance** reading the
"Basic options" section below will help you fix the appearance of your
model. It also means **there is a 0.5% chance** that you'll have to dig
through this entire thing to find out why a material isn't looking the
way it's supposed to look.
And before you waste your time, **please make sure you didn't get an error**
during the import process as described on the front page!
**This page will not help you if your model imported with errors!**
# Basic shader breakdown
## Intro
This breakdown will begin by using the clothing found on Chika, the
default Koikatsu model. Let's start by opening up the shading tab in
blender.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/89c3ec7cfffb6a560eceb901ed75b1f531c56b22.png)
This is the material setup that is used in every material. The texture
files from the export folder are loaded into the green group on the
left. The colors are generated in the blue group in the middle and then
fed to the output node in the red group.
There are light colors and dark colors for every material. Right now,
the light colors are showing. You can toggle between the light and dark
colors by using the viewport shading buttons on the top right. Here's
what the dark colors look like.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6b413f2411f3809004ea6efb72f87a0666083c8e.png)
The remainder of this documentation will use the light colors only. You
can expand the options for the light colors of the model by clicking on
the arrow in the material panel
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/77cb1be3f9741658df1313fbfcd60f11485f0cfb.png)
## Detail color
Let's go through each option. The first option is override detail
color. KKBP automatically generates a detail color for you but if you
want to override the color it gives you, you can enable this slider and
set the detail color to whatever you want. Here's what it looks like
when it's set to yellow
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/963adabb6ca07aded0b943c7bec1b6646b62d22e.png)
Here's what it looks like when it's set to red
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8d2ac0c1d5c8e5995bcf5f5a217f440408a8999c.png)
## Detail intensity
The next option is green detail intensity. Green detail intensity
usually controls the soft details on clothes. Here's what the jacket
look like at the default of .8 intensity
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8765798548a8a561d9ae0fe1a4ae56b383b29700.png)
Here's what the jacket look like when it's set to five green intensity
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cd98a37c2f3f15aecb77fb921c7743a4c7f62803.png)
And here's what they look like when the detail is set to 10 green
intensity
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/812f55ebe55a5c7c1c3431433133515bf6916a64.png)
The blue detail intensity usually controls hardline details on clothes.
Here's what the jacket look like it's set to the default of 0.1.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/71ff40ea839d748f15843b6f4c9137941eb04882.png)
Here's what it look like when it's set to one
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/55383a783060447fb43f8515417046d6c029e321.png)
And here's what it look like when it's set to five
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/69fd3ff65df304471db69473333d0bf0585c021e.png)
## Shine
Some clothes also have a shininess that can be adjusted. The default
loafers have an adjustable shine. The color of the shine can be changed.
Here's what the loafers look like with a white shine.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/92e10b991094734f51b0849bcc6925ef920c9950.png)
And here's what they look like with a green shine
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/63adc021bbd605cea522b3b1f3c38ff59388d7bb.png)
The intensity of the shine can also be adjusted. Here's what the loafers
look like with the default shine intensity of one.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ab5828b1216b29812e265610482908b70e5cae8a.png)
Here's what the loafers look like with the shine intensity set to zero
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4b0c6fd05f004e196b9c3a72115cdddc5d2cb232.png)
## Maintex HSV
Most clothes have what is called a main texture or a maintex for short.
The hue, saturation and value of the main texture can be easily adjusted
with the maintex sliders. Here's what the shoes look like with their HSV
values adjusted
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/80774dd31c98982b2a55e5dd99ea3804f1b225a5.png)
## Color mask colors
If a piece of clothing has a main texture, it will also have what is
called a plain main texture. The difference between a main texture and a
plain main texture will be explained later on. For now, all you need to
know is that each color on every piece of clothing can be changed, just like in the game. In order to do this, the plain main texture must be enabled. The slider to enable the plain main texture is set to 1 in the picture below.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d433ff287e3589cfe8ae9debbd238d1abf031346.png)
Once the slider is enabled, you can change the colors of the piece of
clothing with the color mask color inputs. The color mask colors of the
shoes are changed below.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/66d706cc284f2a1ef008ee23fa815ba2724a666f.png)
You can return to the original colors at any point by resetting the
color mask colors to their original values. Or by disabling the plain
main texture slider again (thus, the regular main texture will be used
again).
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/43263be8f9743e3f9ccf596453bf1f2c3484aee8.png)
## Pattern colors
Some clothing like the default skirt have pattern colors that can be adjusted. In order to adjust the pattern colors, you need to use the plain main texture. The picture below shows the plain main texture slider enabled for the skirt.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d48cc90aff12458545e4bed0166e10a5f922f1b6.png)
The default skirt only has one pattern color that can be adjusted.
Here's what it looks like with the pattern color set to blue.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d0636d3c6294398178d70e56a9da832a95fa6d38.png)
If this piece of clothing had more patterns, their colors would be
adjusted with the pattern color green and pattern color blue color
inputs
## Visibility slider
Some pieces of clothing have what is called an alpha mask. The alpha
mask hides certain parts of clothing to prevent it from clipping through
other clothing. The default inner shirt is an example of a piece of
clothing that has an alpha mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5fcdffbb5e0d54c5780dd136b163f7e1b1c9a06c.png)
Portions of this clothing are hidden to prevent it from clipping through
the jacket. If you want to make the clothing visible anyway, even though it
shouldn't be, you can enable the force visibility slider. Here's what
the shirt looks like with the slider enabled.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ebb94af4e7cfc44e95c4e0342cf91111c20512e4.png)
And here's what the shirt and jacket look like with the shirt fully
visible. Notice that some parts are clipping through the jacket when
they shouldn't be. That's why the alpha mask is enabled by default.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/e08533fb229046285c72147d685b1ff55fe90f61.png)
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cffd898b850e771d1193dbbaae23d0f2e79cb5c9.png)
# In-depth shader breakdown
That concludes all basic clothing options.
If you are part of the 0.5% and none of these helped fix the material you're having issues with, you can check [the in-depth shader breakdown page](material_breakdown_advanced) for even more information on the KKBP "KK General" shader.

View File

@@ -0,0 +1,732 @@
# In depth shader breakdown
## Advanced intro
This page will take a look at the three main node groups in detail.
Namely, the texture files group, the KK general group and the combine
colors group. It will also examine the sub-groups inside of each node
group.
## Enabling Node Wrangler
Let's take a quick detour and enable node wrangler. This add-on is
invaluable for debugging node groups. In the blender add-on window
search for Node Wrangler and enable it
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/2911bcd76b785d6133314ca953ad7f68b6ca7aa7.png)
## Texture files group
Let's start with the texture files group. Open it by clicking the icon
on the top right of the group
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/0ba27212cfbc555cb4bacb2d143fea6f0fa57089.png)
Here's the texture files group.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/be81fcd554ecb75227f5c98feb124271bd46477d.png)
Each piece of clothing can have multiple textures that go with it. Each
texture file from the export folder is loaded into each outfit material
in blender. For example, the jacket CM.png from the export folder...
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6e4ab4a9d895ee67cc014c7c069cdce2fa96676b.png)
Is loaded into the corresponding jacket CM image node in blender
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4c75371636b8d51aa4e6eaad99d272839f090409.png)
## Pattern slots
There's a lot of textures, so let's start at the top and work our way
to the bottom. The pattern files are loaded up here.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/aa640afc3f7f62c9cbdc39849866aba51c2080ec.png)
The skirt only has one pattern (PM1.png) and it's loaded into the
pattern red slot.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3a927c176b682106cc0680c02d95b7ba251d753c.png)
if you enabled node wrangler, you can see what the pattern looks like by
Control + Shift clicking the image node
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f1fb577204b605202a4f7f24feaa1615d71ae5fa.png)
# Positioning with the Scale Vector group
the pattern scale and positioning can be controlled by opening the
position node group to the left of the image nodes.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5b339a74388804694ef0e9b84ab65fa23487789a.png)
this is what the red pattern looks like after being scaled and shifted.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/b92165c28fdd623450972decda4dde8eb2a4fec7.png)
most things you can position can also be rotated using the rotation
slider
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/c6f5ddfd3c205e9a5ffe510c823882d0f57ce3b0.png)
# One more example of the Scale Vector group
It can be a little hard to see how the scale vector group works with patterns, so let's also check out the positioning group in the eye material. Here's what the eyes look like at their default scale. If you're having difficulty locating the thing you're positioning on the 3D model, recall that you can preview what the material looks like in the materials tab.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/eyeposition.png)
Here's what the eyes look like when they're scaled down.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/eyeposition2.png)
Here's what the eyes look like when they're scaled down, moved to the right, and rotated 90°
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/eyeposition3.png)
## Colored main texture, plain main texture and dark main texture slots
let's move onto the rest of the textures in the group now. here's what
the main texture looks like when the image node has been control shift
clicked. this is the **colored** main texture of the outfit. We'll take a look at this more in depth later on.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4909010168b862322018dbdf0b61911673774b0c.png)
here's what the plain main texture looks like. this is the **uncolored** main texture
of the outfit. notice that some features like
the buttons are still fully textured
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/1ff890b4d80197413e0e3a9d32dcc70d00c2ad12.png)
here's what the dark main texture looks like. KKBP automatically
generates a dark version of the colored main texture and loads it into
this slot.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/b698a8f741bc7e122228d4804894d8be4ea20cff.png)
## Alpha mask slots
If a piece of clothing has an alpha mask. It'll be loaded into this
slot. here's what an alpha mask can look like
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d0b96b98813ee0ab914ef9809ddc17af72fe4b61.png)
Look familiar? This is what the complete material looked like. The
visible portions match up with the yellow portions of the alpha mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/39d07e716d4ef749301606e9f57ca1c12acf40e6.png)
## Color masks slots
there are two slots for the color mask. the top slot is used for
materials that are supposed to be partially or fully transparent. the
bottom slot is used for fully opaque clothing. fully opaque clothing is
not supposed to have a color mask, but the KKBP exporter exports one
anyway. Some materials will look incorrect if a color mask is loaded
into an opaque clothing material so that's why there's two slots. A
list of in game shaders that are identified as opaque are listed below
Koikano/main_clothes_opaque', 'Shader
Forge/main_opaque', 'xukmi/MainOpaquePlus',
'xukmi/MainOpaquePlusTess', 'Shader Forge/main_opaque2', 'Shader
Forge/main_opaque_low'
We'll be taking a look at both color masks but for right now here's what
the bottom color mask looks like
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/58a2bb307d8f52df6fedbe74965f3b7dd852ce07.png)
Look familiar? This is what the fully assembled material looks like. The
brown, dark brown, and green portions of the shoes match up with the
red, green, and blue portions of the color mask.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/38ede80e4805e6a767a8ad68e3cca9335e4c83e7.png)
## Detail mask slots
This is the detail mask for the jacket.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/c06096ad0820c09c2f9fec0c8d86fa0d407a604d.png)
Look familiar? This is what the fully assembled material looks like with
the detail intensity cranked up to the max. The green portions of the
detail mask match up with the soft details on the jacket. The blue
portions of the detail mask match up with the hard lines on the jacket.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/14dd0458c00d8a11c7a0e2ebf81f635ca479808d.png)
and if we take a look at the shoes, You can see the red portion of
the detail mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/928989e31d5e5cdc7ef47844da8d17a9ec2cdbef.png)
the red portion matches up with the location of the shiny parts of the shoes
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f0d01fdaa38d442ff43c2f81eed4acb3668ae5ae.png)
## Detail masks and metallic materials
the KKBP importer has a shortcoming with the detail mask related to
metallic materials. The red portion of a detail mask can either mean
shine or metal. KKBP does not support metal materials, so if it detects a
metal material, it'll automatically set the detail shine slider to
zero. For example, if we take a closer look at the jacket's detail mask,
the buttons are obviously red.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f6da9fc3fde451dcec751ab6cb00d2f2cf84ea5f.png)
but when we take a look at the fully assembled material, the detail mask
intensity has been disabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3ca5374d36f7042d3a9eb5dcea72d1a755adf691.png)
turning it back on results in erroneous appearance
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5040c9599bc536edd6c80e57e9a8411f22144ae2.png)
this is because the buttons are supposed to gain a metallic appearance
from the red channel of the detail mask but since KKBP does not support
metallic materials. It just turns white. KKBP determines if a material is
metallic by the presence of the AR.png texture. If a material has an AR
texture, then it is assumed to be metallic, and the detail shine
intensity will be disabled automatically to avoid issues like the one
seen above.
For example the jacket has such a texture
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/dc6415e30428d2c7ead9fe66e8fcd08ac26a911e.png)
but the shoes do not have that texture so that's why the shine on the
shoes were not disabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4d5a5460a684d1320b3f779d527a8e2cf375c8bc.png)
## Normal map
anything related to hair will be skipped in this explanation, so the
next node is the normal map. The normal maps are grayscale in appearance. The color of the normal map along with its alpha channel are used to create a proper normal map
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/40f5f38281b88ba2c8c3e3d19e7e04fad1dcf428.png)
## Normal map detail
and the final node is normal map detail. Most pieces of clothing do not
have a normal map detail so you'll find this placeholder instead.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6b3c788e264f7acccdb28d4693e74dacefba4f2d.png)
## Final things to note about the textures group
First thing:
Textures are loaded into each image node by their suffix. For example, the material name for the jacket is cf_m_top_jacket06 8480. The KKBP importer searches the export folder for an image called cf_m_top_jacket06 8480_CM.png and if it finds the image it loads it into the _CM.png node. Each one of these nodes has an "_ABC.png" name tag on them to ensure each texture is loaded into the correct image node
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/finalthing1.png)
Second thing:
Main textures exported by the KKBP exporter are not saturated. These files end in "_MT_CT.png" and "_MT.png". In the game, the textures are saturated in realtime to make them look like they normally do. In blender, the KKBP importer saturates these images once, then places them into a new "saturated_files" folder. When the KKBP Importer loads the main textures, it loads the saturated _ST versions of the main textures instead of the unsaturated _MT ones. It does the same thing with dark main textures too. It will grab the _ST version of the main texture, create a dark _DT version of it, save it in a new "dark_files" folder, then load it into the dark main texture slot.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/finalthing2.png)
## Permalight image
let's also take note of this permalight mask texture. This is
an optional texture. You can create one yourself to make portions of
clothing, hair or body materials, permanently light or permanently
dark. An example of this will be shown later on
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/562d6555c130bd7eaa42c45afe90509dacacc219.png)
This texture along with the normal textures are fed into the toon
shading group. Let's go into this group.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/2c6d9187e247245bcb2d32f8aa0d52781cccf072.png)
## Toon shading group
this is the group that creates the light and dark portions of every
material. Let's work from left to right
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/92ed02234b3bef293ac87c1a288caa8fdf7fb6b0.png)
## Normal map blending and optimizing performance
this section is for determining what normal data will be fed into the
BSDF shader. By default, normals are enabled and are fed into the "normal
detail map blending" node group. This group accepts the
grayscale + alpha normal map from the game and the detail normal map (if it exists). There are two built-in methods for blending the two normal maps together. The default is the whiteout method. if you
want to use the unity tech demo blending method, you can set the slider
to zero.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/2bd651e0be6ede4e6ca288a436beb3a854ace14d.png)
Digging into the node group we can see both methods.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/a32228b5b42899107e4a1115ee79a41fa680dc9b.png)
both methods were taken from
<https://blog.selfshadow.com/publications/blending-in-detail/>, so these
are just blender node implementations of the math equations found on that page
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5da3bb189137adcba144a7f2503c7de8c1dd67f2.png)
Returning to the normal section, The output of that group is fed into a
mix node. if normals are enabled, the output is fed into the Normal
Map optimization group. If normals are disabled, a pure purple color
will be fed to the Normal map optimization group. here's what the
output of the mix node looks like when normals are enabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/e1d29d4f7ed0f535c2d2d6e4050e77859d0645f7.png)
Blender has a very poor performance with the normal map node when it's
set to tangent space. The optimization group is used to improve
animation playback. When you're done animating and ready to use the
full quality normals for rendering, you can unmute the normal map node by selecting it
and pressing M, Then you can connect the output of the normal map node
to the inputs of the diffuse BSDF node. The image below shows the normal map unmuted and attached to the BSDF normal input
The normal map optimization group was taken from
<https://blenderartists.org/t/way-faster-normal-map-node-for-realtime-animation-playback-with-tangent-space-normals/1175379>
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/02fe303dfcd534d60e3d7214da456456a4b4df67.png)
## Toon shading with the BSDF node
the normals are fed into the diffuse BSDF node. This is the output of
the BSDF node. It looks like realistic shading
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6ee8b4077b4d5bb54e9faf9fb121b9660c420ca1.png)
the black-and-white portions of the output are then crunched down using
a color ramp. Here's what the output of the color ramp looks like. It
looks more toon-like now. The white portions of this output will ultimately get the light versions of all colors. The black portions of this output will ultimately get the dark version of all colors.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/71ec75099999a502e0921b4cde3eee977a9446ed.png)
## Permamask node
The final section makes the material permanently light or permanently dark
through the use of the permalight mask. Here's what it looks like with
no perma mask loaded in
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/97bb84f57a6611b4b1d0d4c6b7915d904b79ad8f.png)
here's what it looks like with a new mask loaded in. The red portions
of the image are now permanently light, and the blue portions of the
image are now permanently dark
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/9d5e094bd34ed233ced37dbaea1c067d9ece951a.png)
here's what the fully assembled material looks like with the permamask
loaded in
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ea2d3f0ebacd2126474be9b41a2395ebe772aa59.png)
## KK General node group
that was everything in the textures group so let's move on to the KK
general node group
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/a533070f35bce2d8d38658c8fcbb9c6dfc8330f8.png)
this node group takes all of the textures from earlier and uses them to
form the colors you see on the clothes. Let's again start from the left
and work our way to the right.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8a8fb34bf00bc6172c1a3d04d30e66277994ca48.png)
## Colored or plain main texture
first, we choose between the colored main texture and the plain main
texture. the output of the "use plain main texture?" output is currently
zero so it outputs pure black on the entire piece of clothing
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/36823fb10483d0da33c26fce0ba0e923d04b30cb.png)
When the slider is set to zero the factor of the mix node is set to
zero. because of this the A input of the mix node is placed on the output of the node. In this case, the colored main texture is attached to the A input
of the mix node, So that's what gets passed through
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/90b51c1fc10a2b0e890e2dbf1368fc4de4fafac6.png)
when the "use plain main texture?" slider is set to one, the node will output
pure white to the clothes.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cc218cd83e61f82f59d09e3ce1c0996ccc0da40e.png)
because the factor of the mix node is now set to one. The B input gets
passed through the mix node. In this case, the B input is the plain main
texture
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ce21fe84ce91b4e83ddd8217220a8dd13c45fe95.png)
## HSV node
once the main texture type is chosen It's sent through an HSV node.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/fe94b83d702cf2a45f4e0ed184fa68e5437495bf.png)
the HSV values in the material tab for the main texture directly
correlate to the inputs of this node.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3c03e6c90eddb7b479d3c7f04595333eea5fee1c.png)
## Colormask and patterns
Once the HSV values are adjusted, The color mask and the patterns are
applied. Not every piece of clothing uses every feature here so we'll
take a look at a few different pieces of clothing in this section
let's start with the node inbetween the inputs and the "add color mask
and patterns" node group. When you disable the "use plain main texture?"
slider, the first color mask from the textures group is placed at the output of the mix node.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/97bb8f9327ec670288f69a6c82e24778c0c5ae84.png)
If you recall from earlier, opaque materials that use the shaders below are not
supposed to have a color mask
'Koikano/main_clothes_opaque', 'Shader
Forge/main_opaque', 'xukmi/MainOpaquePlus',
'xukmi/MainOpaquePlusTess', 'Shader Forge/main_opaque2', 'Shader
Forge/main_opaque_low'
this piece of clothing happens to be an opaque material so that's why
the colormask in the first slot was pure black.
If you enable the "use plain main texture" slider, then the color mask loaded
into the second color mask slot will be passed through the mix node.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/edb52766f957d70229a4044343955a7098d6bd15.png)
If we take a look at the output of the "add color mask and patterns" node
group, you can see that the colors look correct when the plain main
texture slider is set to zero
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/9ab46d8a6f4bd2ad058bd728bb787fb335bf67e3.png)
and they still look correct when it's set to one
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f4674221e7238b4ad133b6a2b3dabcea612234a5.png)
this is because of the dual color mask setup. If I force the second
color mask to be enabled while the colored main texture is active you
can see that the color is applied twice to the material and that's not
something that you want to see
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/7e830a952b7097f418785dce91703102d6cd2914.png)
so again that's why there's two color mask slots. Because if the
clothing is using the opaque shader then you'll have a fully colored
main texture and a black color mask in the first color mask slot,
meaning no extra colors will be applied to the already colored main texture.
Then when you're using the plain main
texture, you always want the colors applied to it because it's white,
meaning you always want a color mask in the second slot.
## Add colormask and patterns node group
If it still doesn't make sense, let's take a look inside the "add color
mask and patterns" node group.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8df1f91fca5ed3eea3a5c93cf2f0bce814d24bae.png)
the group starts with the base color. The base color will always be pure
white, But you can change it if you want with the color mask base color
input in the material tab
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d3bf16c8b63741f1577b7be73c24b88d5c39b1d4.png)
next the red color from the color mask is placed. (make sure the plain
main texture slider is set to one or you won't see anything). if we get
a preview of the color mask, you can see where the red color is going to
go
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/098c30ea93a724c46c2a3451c56cc0ea5ec89018.png)
the red portion of the color mask is separated out with the "separate
color" node
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/da0994cdd3afc9b76f87dcef5621182959b36702.png)
and the red color is applied to the white masked out portion going into
the factor input of the mix node
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/edf761215ca32844584c91b2fad6294992a02646.png)
the same thing happens with the green channel of the color mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ffeccd0217d58faa3e60bf8e39f6d5e3aae0765a.png)
the green channel is singled out
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ed22c28e0c6601b3c24dd745677526d9a9d0b225.png)
and the green color is applied to that white area
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d1415354cb994f61707aaea5f6b5b04c47607c35.png)
same with the blue channel
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d40aef2788ca2ef4c6b2f30e2a02392e47307a5c.png)
and finally the plain main texture is multiplied by those colors. recall this is what the plain main texture looks like
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/36adc37d8425f24348f9f75f1b382ef44b1ddac1.png)
Once they are multipled, you get the resulting image
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/c02d5483a35d4686a9ed8a2e4da7da28ff9f40f7.png)
if we take a step back and see what the B input of the multiply node
looks like when the plain main texture slider is set to zero, we can see
that it's pure white.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/1f98fa55b02b6a96d82a036f664dd4b2757abc10.png)
Recall that this color mask is pure black so nothing shows up at the
separate color mode output. A black section in the color mask basically means "do not put any color here, just keep it white".
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/0090e4ca61f67380363e865a32853cf559292a81.png)
so when the slider is disabled and the color mask is black, the colored main texture is multiplied
by pure white. Here's what the A input of the multiplying node looks
like.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cb92d85c616148515551c9f510afd05ef468cfd1.png)
and here's what the result looks like. (exactly the same)
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/79c513ba771127c0ed92bcafeb1b0b8356e9f64d.png)
and if we take a step back one more time we can see how patterns work.
When a pattern is loaded into a pattern slot in the textures group, The
colors in the color mask (red) color input, and the pattern color (red)
color input will be applied to the white and black portions of the
pattern respectively, with this mix node
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/9d70e520ad3394bbcb4ad1e7d366e419cf7d8c4d.png)
the black-and-white pattern goes into the factor input of the mix
node, So where the pattern is black the A input will be used which is
the darker color, And where the pattern is white is where the B input
will be used, which is the regular color mask color
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6886dfc13c59957f0369ce44b2075257aa114be6.png)
So to summarize the color mask behavior one more time...
* Black = Do not add any color to the main texture, keep it the way it is
* Red = Multiply the main texture by the red color mask color here
* Green = Multiply the main texture by the green color mask color here
* Blue = Multiply the main texture by the blue color mask color here
* Any overlaps in the color mask = Blue overrides green, green overrides red
## Green detail
let's move onto group that applies the green channel of the detail mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/64c1a38049c82adbca167d77af6bfc1bd0d5946b.png)
## Generating detail color
there's a few things that go on in this group. let's start with the
frame on the left
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/7c29a0829d93586210bdaf30c32c877b37cb042f.png)
this section very intensely saturates the colors in order
automatically get a detail color. This is what the clothing looks like at the output
of the section
the darkening code is taken from
<https://github.com/xukmi/KKShadersPlus/tree/main/Shaders/Hair> so it's
really just a node implementation of the equations found in that shader
file
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/bbb929881be5c821c72df2af42b1d4b1e580caf7.png)
the next section adds blue tint to the saturated color, but only if the
color is detected as white, and never if the color is detected as dark.
the light color detection is done by taking the saturation value of the
material
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/e6245451148c0abd5be30606f0b1e5bea3de2aea.png)
and sending it through a color ramp to make sure that only the least
saturated colors get a blue tint applied to them. the white portions of
the clothing will not get a blue tint. The black portions of the
clothing will get a blue tint
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/72525eb438e70f0f536a24433bf9d7491681ce7b.png)
the dark color detection is done with the value of the color
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cb41e84b5e12b49dcb41c695d0fd15ac8b432e99.png)
this value is then inverted and crunched down with another color ramp.
The white portion of the clothing will not get a blue tint. The black
portions of the clothing will get a blue tint
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f396dbfb6daf03c503b151eb68a54f3817d3fc9e.png)
these two values are then added together and sent into the multiply node
factor input. Again, the white portions will not get the blue tint.
Only the black portions will.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4cc59cfea1cc0567be04f4b433ad9200ee30ea3e.png)
This is what the detail color looks like, with the blue tint applied.
Only the white-most portions of the jacket got a blue tint.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/c21917bb3bd0726c1f36310704d1b93be7741907.png)
## Overriding detail color
you also have the option of overriding the detail color. If you override
the detail color you can set it to whatever you want with the "detail
color" color input. here's what it looks like without the override
enabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/76dec3111f854ee8648c1bc3a890fcb2433cf552.png)
here's what it looks like with the override enabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/1c5680d777a0ecc709fe06e3793246bfcae401b5.png)
## Detail intensity
and finally, the shader needs to know where to put this detail color, so
the detail mask is brought in
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/0501bb7255a810f339f716019678e86090b71ae8.png)
the green channel of the detail mask is used to locate where
to put the detail color.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3699a3b1008c0f1daa5ddc4e8a454ad21fc94e0d.png)
The strength of the detail mask can also be increased with this multiply
node. Here's what it looks like when it's set to the default of 0.8
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3936b6fdc1349c9fde97899733a2b7afaec90d25.png)
here's what it looks like when it's set to five
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/0077b20e15f3570c8f827fd1a1db4e7c8a76f7bc.png)
and here's what it looks like after the mix node, with the detail
color applied to the main texture (detail intensity still set to 5 for
clarity)
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/f37520ac74f77cae6d812393732b1a38c74a990a.png)
the same process is applied for the blue channel of the detail mask. In
order to ensure only the blue channel of the detail mask is used, the
"separate color" node is used to extract only the blue channel. This causes the blue channel to replace the RG and B channels of the detail mask so when the green channel is extracted later on, it's really just extracting the blue channel
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/253ad754b2b2d9a653a9bf1293f67319b03a295f.png)
## Detail shine
the final part of the KK general node group is the shine.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/725c1670a98062bc6123f43aa82166abd5e1c5e7.png)
Just like before the detail mask is loaded in.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d3da7206142eeebde11ba31803d280022878fa6b.png)
And the red channel is used along with the shine intensity to determine
where the shine color will be applied..
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/15b788fbdc86a5f2e7b972c09007fbf4c79fd30b.png)![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/bcac94622b34a7508d7b6f23ecdabb1dd72c4b7f.png)
## Combine colors group
the final portion of the KK general material Is the combine colors
group. This group takes the light colors and the dark colors from the
previous shader groups and combines them using the black-and-white
mask from the toon shading group. This group also applies
transparency to the model if its main texture is semi transparent, or
if it has an alpha mask. Custom alpha masks can also be loaded in. You
can check the body material for an example of a custom alpha mask.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/971ed0a79c2fc4d7c89a0cce8680708c28a9017e.png)
this is all there is inside of the combine colors group.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/fd323b1b3a98bc5989f81c48658b8c49294a52f6.png)
To keep things simple I'm going to remove the custom alpha mask from
the group, again you can check the body material if you want to see how
it works yourself.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/a39d55abb81cdcb0b7cf93736de03fdedcf4b425.png)
so let's start with the alpha mask
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/7adfc64521ba60d389a34c248aff6a518bdfad29.png)
the red channel of the alpha mask is used to determine what parts of the
clothes should be visible
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/3bcf7ceda44e22be721509034dfc07d1ea51a5d6.png)
in some cases the alpha channel of the alpha mask is also used to
determine what parts of the clothes should be visible. In this case, the
alpha mask's alpha channel is pure white, so it does not affect the
clothes alpha
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/55335816673af84ad5e97a1b40c6dc9b2a5400d0.png)
because the alpha channel is pure white, this is what it looks like when
the red channel of the alpha mask and the alpha channel of the alpha
mask are multiplied together.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/73033fb16639dd4805efc3e823a89e6827deeba4.png)
The alpha channel of the main texture can also determine the materials
visibility. In this case, the main textures alpha channel is pure white
so (again) it does not affect the materials visibility
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/70f5da50680e27f69b7293f72173cd32187c2aa5.png)![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/0727faf59774c4ae9b73f996ecf5897f28345672.png)
and finally if you want to force a material to be fully visible, then
you can use the force visibility slider to add white to the result.
Here's what it looks like when the slider is disabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5bf7cc0cfc2e94fa2f2e154392b28a67ee4ca378.png)
and here's what it looks like when it's enabled
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/84e16a45c1868ab4666c68fd6eefd11683f5c13f.png)
if we look at the top, we can see the light colors are fed in
through this node input
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/23ca5eef694b605c70130739c27809ed824a81ea.png)
the dark colors are fed in through this node input
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/bd0c1a82b01631c99be232ad4a6a8bb952370709.png)
and the toon shading is loaded into this input
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/56070d375bd5c004fb96352e89e378ed2cb75c40.png)
The portions of the toon shading that are white will get the light colors and
the portions that are dark will get the dark colors
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6fed39e49e2dcd4d6ea21794644a1862ce1a9249.png)
and finally the transparency mask from earlier is used to
determine if the color is passed through or if a transparent shader is
passed through to the material output
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ec74008172355134e82304a98b9076f14ffc6ab2.png)
## Outro
and that was a complete walk-through of KKBP's KK general material node setup. If
you check the hair, skin, eyes and any other KKBP material, you'll find
that many of the node setups and simple masking strategies are reused
everywhere.
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/1bb2d247a9ca61ee50774e517ad23ab8ba09f2bd.png)

View File

@@ -0,0 +1,144 @@
# KKBP 材质分解
本页将完整分解 KKBP 8.0 的"KK General"材质着色器的材质节点逻辑。KK General 材质中的简单节点逻辑在整个项目中使用,因此阅读和理解本页应该能让你学会如何修复或调试你遇到的任何 KKBP 材质。
## 开始之前...
在 KKBP 8.0 的开发过程中,随机选择了大量卡片进行测试。
在 133 张卡片中...
* 104 张78%)开箱即用
* 22 张17%)有奇怪的材质问题,需要 5 分钟修复
* 5 张4%)导出但未导入
* 1 张0.5%)有奇怪的材质问题,可能需要一段时间才能弄清楚
* 1 张0.5%)未导出并导致游戏崩溃
这意味着如果你遇到问题,**有 94.5% 的机会**阅读下面的"基本选项"部分将帮助你修复模型的外观。这也意味着**有 0.5% 的机会**你必须挖掘整个内容才能找出材质为什么看起来不对。
在你浪费时间之前,**请确保你在导入过程中没有收到错误**,如首页所述!
**如果你的模型导入时出现错误,本页将无法帮助你!**
# 基础着色器分解
## 简介
此分解将首先使用默认 Koikatsu 模型 Chika 上的服装。让我们首先在 Blender 中打开着色选项卡。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/89c3ec7cfffb6a560eceb901ed75b1f531c56b22.png)
这是每个材质中使用的材质设置。导出文件夹中的纹理文件加载到左侧的绿色组中。颜色在中间的蓝色组中生成,然后馈送到红色组中的输出节点。
每个材质都有浅色和深色。现在显示的是浅色。你可以使用右上角的视口着色按钮在浅色和深色之间切换。这是深色的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/6b413f2411f3809004ea6efb72f87a0666083c8e.png)
本文档的其余部分将仅使用浅色。你可以通过点击材质面板中的箭头来展开模型浅色的选项
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/77cb1be3f9741658df1313fbfcd60f11485f0cfb.png)
## 细节颜色
让我们逐个了解每个选项。第一个选项是覆盖细节颜色。KKBP 会自动为你生成细节颜色,但如果你想覆盖它给你的颜色,可以启用此滑块并将细节颜色设置为你想要的任何颜色。这是设置为黄色时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/963adabb6ca07aded0b943c7bec1b6646b62d22e.png)
这是设置为红色时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8d2ac0c1d5c8e5995bcf5f5a217f440408a8999c.png)
## 细节强度
下一个选项是绿色细节强度。绿色细节强度通常控制衣服上的柔和细节。这是夹克在默认 0.8 强度下的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/8765798548a8a561d9ae0fe1a4ae56b383b29700.png)
这是夹克设置为 5 绿色强度时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cd98a37c2f3f15aecb77fb921c7743a4c7f62803.png)
这是细节设置为 10 绿色强度时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/812f55ebe55a5c7c1c3431433133515bf6916a64.png)
蓝色细节强度通常控制衣服上的硬线细节。这是夹克设置为默认 0.1 时的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/71ff40ea839d748f15843b6f4c9137941eb04882.png)
这是设置为 1 时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/55383a783060447fb43f8515417046d6c029e321.png)
这是设置为 5 时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/69fd3ff65df304471db69473333d0bf0585c021e.png)
## 光泽
一些衣服还具有可调节的光泽度。默认的乐福鞋具有可调节的光泽。可以更改光泽的颜色。这是乐福鞋带有白色光泽的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/92e10b991094734f51b0849bcc6925ef920c9950.png)
这是它们带有绿色光泽的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/63adc021bbd605cea522b3b1f3c38ff59388d7bb.png)
光泽的强度也可以调整。这是乐福鞋在默认光泽强度为 1 时的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ab5828b1216b29812e265610482908b70e5cae8a.png)
这是乐福鞋光泽强度设置为零时的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/4b0c6fd05f004e196b9c3a72115cdddc5d2cb232.png)
## 主纹理 HSV
大多数衣服都有所谓的主纹理或简称 maintex。可以使用 maintex 滑块轻松调整主纹理的色调、饱和度和值。这是鞋子调整其 HSV 值后的样子
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/80774dd31c98982b2a55e5dd99ea3804f1b225a5.png)
## 颜色蒙版颜色
如果一件衣服有主纹理,它也会有所谓的纯主纹理。主纹理和纯主纹理之间的区别将在稍后解释。现在,你只需要知道每件衣服上的每种颜色都可以更改,就像在游戏中一样。为此,必须启用纯主纹理。启用纯主纹理的滑块在下图中设置为 1。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d433ff287e3589cfe8ae9debbd238d1abf031346.png)
启用滑块后,你可以使用颜色蒙版颜色输入更改衣服的颜色。下面更改了鞋子的颜色蒙版颜色。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/66d706cc284f2a1ef008ee23fa815ba2724a666f.png)
你可以随时通过将颜色蒙版颜色重置为其原始值来返回原始颜色。或者通过再次禁用纯主纹理滑块(因此,将再次使用常规主纹理)。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/43263be8f9743e3f9ccf596453bf1f2c3484aee8.png)
## 图案颜色
一些衣服(如默认裙子)具有可调整的图案颜色。为了调整图案颜色,你需要使用纯主纹理。下图显示了为裙子启用的纯主纹理滑块。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d48cc90aff12458545e4bed0166e10a5f922f1b6.png)
默认裙子只有一种可以调整的图案颜色。这是图案颜色设置为蓝色时的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/d0636d3c6294398178d70e56a9da832a95fa6d38.png)
如果这件衣服有更多图案,它们的颜色将使用图案颜色绿色和图案颜色蓝色颜色输入进行调整
## 可见性滑块
一些衣服有所谓的 alpha 蒙版。alpha 蒙版隐藏衣服的某些部分以防止它穿过其他衣服。默认内衬衬衫是具有 alpha 蒙版的衣服的示例
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/5fcdffbb5e0d54c5780dd136b163f7e1b1c9a06c.png)
此衣服的部分被隐藏以防止它穿过夹克。如果你想让衣服可见,即使它不应该可见,你可以启用强制可见性滑块。这是启用滑块后衬衫的样子。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/ebb94af4e7cfc44e95c4e0342cf91111c20512e4.png)
这是衬衫完全可见时衬衫和夹克的样子。请注意,某些部分在不应该穿过夹克时穿过了夹克。这就是为什么默认启用 alpha 蒙版的原因。
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/e08533fb229046285c72147d685b1ff55fe90f61.png)
![](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/shader_media/cffd898b850e771d1193dbbaae23d0f2e79cb5c9.png)
# 深入着色器分解
这就是所有基本服装选项的结论。
如果你是 0.5% 的一部分,并且这些都没有帮助修复你遇到问题的材质,你可以查看[深入着色器分解页面](material_breakdown_advanced)以获取有关 KKBP"KK General"着色器的更多信息。

107
wiki/material_zh.md Normal file
View File

@@ -0,0 +1,107 @@
## 材质
## 开始之前...
**如果你在材质方面遇到问题或想了解典型的 KKBP 材质如何工作,[材质分解](material_breakdown)上有很多信息。**
## 更新已完成的材质
如果你想返回原始材质再次编辑它,可以将材质设置回材质的 -ORG 版本。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p3.png)
这里我已经更新了原始着色器上的头发颜色
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p5.png)
要再次完成材质,只需点击 KKBP 面板上的"完成材质"按钮。材质将被重新完成,轻量级着色器 + 图集模型将被更新。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat2p6.png)
## 特殊材质(轮廓)
轮廓具有不同的材质设置。如果此材质有可用的 alpha 蒙版,则 alpha 蒙版的红色通道将用于确定轮廓应该在哪里透明。如果不可用,则将使用主纹理 alpha 通道来确定透明度。如果两者都不可用,则轮廓将在材质的任何地方可见。当你点击完成材质按钮时,轮廓材质不会转换为 png 文件。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat4.png)
## 特殊材质(眼睛)
眼睛纹理由 KKBP 导出器自动创建。如果你想使用自定义眼睛滑块并动态更改眼睛的颜色,你必须使用 SB3Utility 从游戏中提取某些眼睛纹理,然后将它们加载到绿色纹理组中并从头开始重新创建眼睛。[这是一个这样做的示例](https://www.youtube.com/watch?v=XFt12n7ByBI&t=231)
## 特殊材质(身体)
身体有一个透明蒙版以防止它穿过某些衣服[点击这里使身体可见](https://flailingfog.github.io/faq)。
如果你发现身体在错误的区域仍然透明,你可以编辑身体 alpha 蒙版(位置如下所示),或从 pmx 导出文件夹加载不同的 body_AM 文件。第一套服装的第一个身体 alpha 蒙版会自动加载cf_m_body_AM.png因此如果你切换到不同的服装你必须将身体蒙版切换到正确的蒙版例如服装 01 使用 body_AM_01服装 02 使用 02等等
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat5p4.png)
## 特殊材质(头发)
头发材质未链接。如果你修改一个头发材质,然后点击更新头发材质按钮,此对象上的其余头发材质将使用当前头发材质的设置进行更新。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat5p5.png)
## 特殊材质(泪水)
泪水有一个特殊的材质,使用渐变来获得类似游戏内的外观。你可以通过使用泪水材质中的滑块使泪水使用 HDRI 或纯色。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6.png)
可以在形态键面板中激活泪水
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## 特殊材质(口塞眼睛)
有三组口塞眼睛Gag00、Gag01 和 Gag02
Gag00 图像以镜像方式显示(两只眼睛相互镜像)
Gag01 图像按原样显示
Gag02 图像通过随时间连续更改 UV 贴图的位置来动画化(也被卡通眨眼表情使用)
口塞眼睛使用驱动器来确定要显示的表情。当你在 Body 对象上激活口塞形态键时,某些眼睛材质会移回头部以隐藏它们,口塞眼睛网格会出现在头部前面,并根据激活的口塞形态键显示图像。
默认导入带有使口塞眼睛后面的面部区域看起来不好的设置。禁用面部眼影强度,将面部边缘设置为"无",并使用下面"永久明亮/黑暗设置"部分中的功能可以帮助解决这个问题。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat7.png)
可以在形态键面板中激活口塞眼睛
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## Koikatsu 颜色转换
你在 Koikatsu 中看到的颜色不是正在使用的真实颜色;它们实际上正在被饱和。为了复制 Koikatsu 中显示的颜色,所有颜色和图像都通过 [converttextures.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/converttextures.py) 中的 color_to_KK 和 image_to_KK 函数运行,以将基础颜色转换为游戏中视觉上看到的"真实"颜色。此过程也在所有主纹理图像上运行。
这是颜色饱和前后的材质示例
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat11.png)
## Koikatsu 深色颜色转换
游戏使用第二个颜色转换过程来自动获取每个浅色的深色。[modifymaterial.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifymaterial.py) 中的 skin_dark_color 和 clothes_dark_color 函数用于在 Blender 中复制此过程,并自动获取每件衣服的深色并创建深色主纹理图像。如果在面板中禁用此功能,你将只获得浅色。
## Cycles 支持
通过在面板中选择"使用 Cycles"可以获得基本的 Cycles 支持。这将用与 Cycles 兼容的类似卡通的着色器替换 KK 着色器中的 Rim 节点组。在此模式下禁用轮廓。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat12.png)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat13.png)
## 法线混合方法
在 Toon Shading 组中可以使用不同的法线混合方法。进入它并找到节点以使用 Unity 技术演示混合方法。这些混合方法[取自此页面](https://blog.selfshadow.com/publications/blending-in-detail/)和[此页面](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/166)
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat16.png)
## 法线质量设置
默认情况下,法线设置为较低质量以提高动画播放性能。要更改为更高质量的法线,只需进入 Toon Shading 组,连接更高质量的输出节点并通过选择它并按 M 键取消静音节点。
如果你计划从 Blender 导出模型,则在烘焙材质时会自动完成此操作,因此你无需担心。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat17.png)
## 卡通着色设置
卡通着色由 Toon Shading 组中的颜色渐变创建。你可以编辑此部分中的颜色渐变以增加或减少显示材质的浅色或深色版本所需的光量。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat18.png)
## 永久明亮/黑暗设置
可以使用纹理节点组中的 Permalight 图像使每个材质的部分永久明亮或黑暗。图像的红色通道用于永久明亮,蓝色通道用于永久黑暗
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat19.png)
## 编辑 KKBP 着色器
如果你想为所有导入的模型使用自定义材质或节点设置,可以编辑 KKBP 库文件。请记住,如果缺少某些内容,导入脚本将出错,因此不要删除文件中已有的任何内容。库文件通常位于此处:```C:\Users\[your username]\AppData\Roaming\Blender Foundation\Blender\[your blender version]\scripts\addons\KK-Blender-Porter-Pack\KK Shader.blend```

27
wiki/mesh.md Normal file
View File

@@ -0,0 +1,27 @@
## Mesh
## Face shapekeys
Shapekeys from koikatsu are preserved when importing. Only the Body object will have shapekeys.
The Face shapekeys originally come from the game as partial shapekeys; For example, if you wanted to activate the "Angry" mouth shapekey you would need to activate the angry lips shapekey, the angry tongue shapekey, the angry teeth shapekey and the angry nose shapekey to get the full expression. KKBP combines these shapekeys into a single shapekey called "KK Mouth Angry" for convienience. The same is done for the eye shapekeys. No modifications are made to the Eyebrow shapekeys. Once all shapekeys are combined, the partial shapekeys are deleted to clean up the shapekey list. If you want to preserve the partial shapekeys, or stop the plugin from editing the shapekeys at all you can do that by changing the Shapekey settings in the KKBP panel.
Shapekeys are generated using the shapekey names of the base Type 1 head. Compatibility for different headmods can vary because different headmods can have different names for the shapekeys (such as the Yelan headmod). These differently named headmod shapekeys can be added to the translate_shapekeys list in [modifymesh.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifymesh.py) to allow them to work. If a headmod has not been added to the list, no KK shapekeys will be created and the original headmod shapekeys will be preserved.
All shapekeys can be found by selecting the Body object and going to the Data tab:
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mesh1.png)
## Tear and gag eye shapekeys
The gag eye and tear meshes are separated from the Body. Their shapekeys are automatically linked to the Body's shapekeys through drivers. This way you don't have to find the small tears object to change the shapekey, you can just click on the body and change the tear shapekey that way. The tear and gag eye meshes shrink into the head when not active. If your character has a really small head, you may have to [edit the shapekeys as shown in this issue](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/338).
Tears and gag eyes can be activated in the shapekey panel
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## Body seams
The Body has seams in several places (middle of neck, middle of chest, around mouth). These are visible in some situations, so a "merge by distance" operation can performed on the body to remove the seams. This unfortunately [modifies some bone weights as seen in this issue](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/69). The "merge by distance" operation will only occur if you enable the "Fix body seams" option on the Import panel.
Clothes also have seams, but these seams are not automatically merged when this option is enabled.
## Object organization
This is the default object organization you'll get after importing. Some objects like the variations or extra outfits will be missing if you didn't enable them in the Koikatsu KKBP Exporter panel.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mesh2.png)

27
wiki/mesh_zh.md Normal file
View File

@@ -0,0 +1,27 @@
## 网格
## 面部形态键
导入时会保留来自 Koikatsu 的形态键。只有 Body 对象会有形态键。
面部形态键最初来自游戏时是部分形态键;例如,如果你想激活"愤怒"嘴部形态键你需要激活愤怒嘴唇形态键、愤怒舌头形态键、愤怒牙齿形态键和愤怒鼻子形态键才能获得完整的表情。为了方便起见KKBP 将这些形态键组合成一个名为"KK Mouth Angry"的单一形态键。眼睛形态键也是如此。眉毛形态键不做任何修改。组合所有形态键后,部分形态键将被删除以清理形态键列表。如果你想保留部分形态键,或阻止插件完全编辑形态键,可以通过更改 KKBP 面板中的形态键设置来实现。
形态键是使用基础 Type 1 头部的形态键名称生成的。不同头部模组的兼容性可能会有所不同,因为不同的头部模组可能具有不同的形态键名称(例如 Yelan 头部模组)。这些不同命名的头部模组形态键可以添加到 [modifymesh.py](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/importing/modifymesh.py) 中的 translate_shapekeys 列表中以使它们工作。如果头部模组尚未添加到列表中,则不会创建 KK 形态键,并且将保留原始头部模组形态键。
可以通过选择 Body 对象并转到数据选项卡来找到所有形态键:
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mesh1.png)
## 泪水和口塞眼睛形态键
口塞眼睛和泪水网格与 Body 分离。它们的形态键通过驱动器自动链接到 Body 的形态键。这样你就不必找到小的泪水对象来更改形态键,你只需点击身体并以这种方式更改泪水形态键。泪水和口塞眼睛网格在不活动时会缩入头部。如果你的角色头部非常小,你可能需要[按照此问题中所示编辑形态键](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/338)。
可以在形态键面板中激活泪水和口塞眼睛
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mat6p1.png)
## 身体接缝
Body 在几个地方有接缝(颈部中间、胸部中间、嘴巴周围)。这些在某些情况下是可见的,因此可以对身体执行"按距离合并"操作以去除接缝。不幸的是,这[会修改一些骨骼权重,如此问题中所示](https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/69)。只有在导入面板上启用"修复身体接缝"选项时,才会执行"按距离合并"操作。
衣服也有接缝,但启用此选项时不会自动合并这些接缝。
## 对象组织
这是导入后你将获得的默认对象组织。如果你没有在 Koikatsu KKBP 导出器面板中启用它们,则某些对象(如变体或额外服装)将丢失。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/mesh2.png)

51
wiki/misc.md Normal file
View File

@@ -0,0 +1,51 @@
## Misc
## Getting info from the Koikatsu console
The Bepinex debug console can be enabled by opening InitSetting.exe in your Koikatsu install folder and checking the Console box
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc1.png)
After you click the KKBP export button, the exporter will start logging it's progress in the console window. These will begin with ```[Info : Console]```
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc2.png)
## Getting info from the Blender console
On Windows, the Blender console is automatically opened when you import a model or bake a material. If an error occurs, the console will stay open so the user can read the error message. The console will automatically close when a model is successfully imported without errors. This log is also saved to Blender's Scripting tab on the top.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc3.png)
## Importing multiple characters
The KKBP importer can't import more than one character into the same file. You have to import characters separately, then merge them into one file by using File > Append, then append the character collection from the second character's .blend file.
## Finalizing materials
Using the "Finalize materials" button in the Export panel will convert all KKBP materials into PNG files. This is done by applying a geometry nodes modifier that flattens each mesh into a flat plane, then a picture is taken of the flat plane. The entire mesh is folded, so some very small gaps are left if there are transparent parts of the mesh. Because of this, a second filler plane is placed right under the folded mesh to fill in those gaps.
Because the mesh is folded, Z-fighting sometimes occurs and leads to a corrupt-looking image. This can be avoided by enabling the "Use old baker" checkbox in the KKBP panel. Using this option wil remove the folded mesh and only use the filler plane to bake images. The filler plane does not contain extra UV maps, so materials that rely on multiple UV maps like Hair will not bake properly with the old baker (for example the hair shine will not show up). Most other materials will bake properly with the old baker.
Only visible objects will be finalized, so if you have alternate outfit pieces or other outfits you want to bake, make sure they're visible in the Outliner before clicking the Finalize button.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc4.png)
## Working with Freestyle outlines
Mark any faces you don't want to be freestyled as freestyle faces, enable Freestyle in Blender, and disable the outline modifier on the body object. Try using these freestyle settings if you don't want to experiment
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc6.png)
Then try these compositor settings if you don't want to experiment
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc7.png)
## Armatures in Unity
The "Very Simple (SLOW)", "Simple" and "Unity - VRM / VRChat Compatible" options in the Export panel will make changes to the armature that allow Unity to automatically identify the bones needed for the Humanoid armature.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc8.png)
## Springbones in Unity
After the Koikatsu model is imported into Unity, springbones from the [UniVRM Unity package](https://github.com/vrm-c/UniVRM/releases) can be added to get realtime hair, skirt and accessory movement.
In the below example, the right twintail is given springbones. The springbone script is added to the twintail bone at the end of the chain. The twintail chain has four bones in the chain: Joint2_002 > Joint3 > Joint4 > Joint5, so the springbone script is added to Joint5. The root bones along the chain are then added to the "Root bone elements" section on the right. There are three remaining bones, so the size is set to 3.
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc9.jpg)
[return to wiki home](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/wiki/Wiki%20top.md)

51
wiki/misc_zh.md Normal file
View File

@@ -0,0 +1,51 @@
## 杂项
## 从 Koikatsu 控制台获取信息
可以通过打开 Koikatsu 安装文件夹中的 InitSetting.exe 并勾选 Console 框来启用 Bepinex 调试控制台
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc1.png)
点击 KKBP 导出按钮后,导出器将开始在控制台窗口中记录其进度。这些将以 ```[Info : Console]``` 开头
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc2.png)
## 从 Blender 控制台获取信息
在 Windows 上当你导入模型或烘焙材质时Blender 控制台会自动打开。如果发生错误,控制台将保持打开状态,以便用户可以阅读错误消息。当模型成功导入且没有错误时,控制台将自动关闭。此日志也保存到 Blender 顶部的脚本选项卡中。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc3.png)
## 导入多个角色
KKBP 导入器无法将多个角色导入到同一文件中。你必须分别导入角色,然后使用"文件">"追加"将它们合并到一个文件中,然后从第二个角色的 .blend 文件中追加角色集合。
## 完成材质
使用导出面板中的"完成材质"按钮将把所有 KKBP 材质转换为 PNG 文件。这是通过应用几何节点修改器来完成的,该修改器将每个网格展平为平面,然后拍摄平面的照片。整个网格被折叠,因此如果网格的透明部分存在,则会留下一些非常小的间隙。因此,在折叠网格下方放置第二个填充平面以填充这些间隙。
由于网格被折叠,有时会发生 Z-fighting 并导致看起来损坏的图像。可以通过在 KKBP 面板中启用"使用旧烘焙器"复选框来避免这种情况。使用此选项将删除折叠网格,仅使用填充平面来烘焙图像。填充平面不包含额外的 UV 贴图,因此依赖多个 UV 贴图的材质(如头发)将无法使用旧烘焙器正确烘焙(例如头发光泽不会显示)。大多数其他材质将使用旧烘焙器正确烘焙。
只有可见对象才会被完成,因此如果你有要烘焙的备用服装件或其他服装,请确保在点击完成按钮之前它们在大纲视图中可见。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc4.png)
## 使用 Freestyle 轮廓
将你不想使用 Freestyle 的任何面标记为 Freestyle 面,在 Blender 中启用 Freestyle并禁用身体对象上的轮廓修改器。如果你不想实验请尝试使用这些 Freestyle 设置
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc6.png)
如果你不想实验,请尝试这些合成器设置
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc7.png)
## Unity 中的骨架
导出面板中的"非常简单(慢)"、"简单"和"Unity - VRM / VRChat 兼容"选项将对骨架进行更改,使 Unity 能够自动识别 Humanoid 骨架所需的骨骼。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc8.png)
## Unity 中的弹簧骨骼
将 Koikatsu 模型导入 Unity 后,可以从 [UniVRM Unity 包](https://github.com/vrm-c/UniVRM/releases)添加弹簧骨骼以获得实时头发、裙子和配饰运动。
在下面的示例中右侧双马尾被赋予弹簧骨骼。弹簧骨骼脚本被添加到链末端的双马尾骨骼。双马尾链在链中有四个骨骼Joint2_002 > Joint3 > Joint4 > Joint5因此弹簧骨骼脚本被添加到 Joint5。然后将链上的根骨骼添加到右侧的"根骨骼元素"部分。还有三个剩余的骨骼,因此大小设置为 3。
![image](https://raw.githubusercontent.com/kkbpwiki/kkbpwiki.github.io/master/assets/images/misc9.jpg)
[返回 wiki 主页](https://github.com/FlailingFog/KK-Blender-Porter-Pack/blob/master/wiki/Wiki%20top.md)

View File

@@ -0,0 +1,34 @@
## Test cases
1. In Koikatsu, export Chika with a single outfit (default exporter settings)
* Also export with only "Export All Outfits" enabled
* Also export with only "Export Variations" and "Export Hit Meshes" checked
* Also export with a pose selected, an emotion pattern selected and only "Freeze Current Pose" and "Freeze Shapekeys" checked
1. In Blender, import the "Export Variations" and "Export Hit Meshes" model
* Check variations + hitboxes were separated
* Check eye shapekeys work
* Check mouth shapekeys work
* Check Gag eye shapekeys work
1. In another file, import the "Freeze Current Pose" and "Freeze Shapekeys" model
* Check armature type was changed to Koikatsu
* Check pose and shapekeys were applied to base mesh
1. In another file, import the 8 outfits export
* Check Outfits 0, 1, 2 exist, and have textures + converted colors
* Check Hair for Outfits 0, 1, 2 exist and have textures + converted colors
1. In another file, import the default settings export
* Check Outfit 0 exists
* Check Hair for Outfit 0 exists
* Check hand IK, leg IK, hips bone and center bone work
* Check eye controller works
* Use the bake material templates button
* Use the "Prep for target application" button
1. In another file, import the default settings export with the "Rigify Armature", "Skip modifying shapekeys", "Use Cycles" options. Check "Fix body seams" and enable the "SFW mode" checkbox
* Check Rigify hand IK, leg IK, hips bone and center bone work
* Check Rigify eye controller works
* Check shapekeys were not modified
* Switch to rendered view and check the model appears in the cycles viewport
* Go into edit mode and check the seam down the middle of the neck is gone
* Check the sfw alphamask was applied to the body material
* Check nsfw meshes were deleted
1. In another file, import the default settings export with the "Separate every object" option selected
* Check all outfit objects are separated

View File

@@ -0,0 +1,34 @@
## 测试用例
1. 在 Koikatsu 中,使用单套服装导出 Chika默认导出器设置
* 还要仅启用"导出所有服装"进行导出
* 还要仅勾选"导出变体"和"导出碰撞网格"进行导出
* 还要选择一个姿势,选择一个情绪模式,并仅勾选"冻结当前姿势"和"冻结形态键"进行导出
1. 在 Blender 中,导入"导出变体"和"导出碰撞网格"模型
* 检查变体 + 碰撞箱是否已分离
* 检查眼睛形态键是否工作
* 检查嘴部形态键是否工作
* 检查口塞眼睛形态键是否工作
1. 在另一个文件中,导入"冻结当前姿势"和"冻结形态键"模型
* 检查骨架类型是否已更改为 Koikatsu
* 检查姿势和形态键是否已应用到基础网格
1. 在另一个文件中,导入 8 套服装导出
* 检查服装 0、1、2 是否存在,并具有纹理 + 转换的颜色
* 检查服装 0、1、2 的头发是否存在并具有纹理 + 转换的颜色
1. 在另一个文件中,导入默认设置导出
* 检查服装 0 是否存在
* 检查服装 0 的头发是否存在
* 检查手部 IK、腿部 IK、臀部骨骼和中心骨骼是否工作
* 检查眼睛控制器是否工作
* 使用烘焙材质模板按钮
* 使用"准备目标应用程序"按钮
1. 在另一个文件中,使用"Rigify 骨架"、"跳过修改形态键"、"使用 Cycles"选项导入默认设置导出。勾选"修复身体接缝"并启用"SFW 模式"复选框
* 检查 Rigify 手部 IK、腿部 IK、臀部骨骼和中心骨骼是否工作
* 检查 Rigify 眼睛控制器是否工作
* 检查形态键是否未被修改
* 切换到渲染视图并检查模型是否出现在 Cycles 视口中
* 进入编辑模式并检查颈部中间的接缝是否消失
* 检查 SFW alpha 蒙版是否已应用于身体材质
* 检查 NSFW 网格是否已删除
1. 在另一个文件中,使用选择的"分离每个对象"选项导入默认设置导出
* 检查所有服装对象是否已分离