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

202
better_fbx_bone_data.py Normal file
View File

@@ -0,0 +1,202 @@
# Better FBX 导入的骨骼尾部位置数据
# 这些数据可以用来替换 KKBP 中的 reorient 逻辑
# 从 better_fbx 导入的 Koikatsu 模型骨架中提取
better_fbx_bone_tails = {
'p_cf_body_00': (0.0000000000, 0.0000000000, 0.5717499852),
'cf_o_root': (0.0000000000, 0.0000000000, 0.0214350224),
'n_body': (0.0000000000, 0.0000000000, 0.0214350224),
'o_body_a': (0.0000000000, 0.0000000000, 0.0214350224),
'cf_j_root': (0.0000000000, 0.0000000000, 0.0099999998),
'cf_n_height': (0.0000000000, 0.0000000000, 1.1434999704),
'cf_j_hips': (0.0000000000, 0.0000000000, 0.0214350224),
'cf_j_waist01': (0.0000000050, 0.0082969246, -0.0676312447),
'cf_j_waist02': (0.0000061035, 0.0022072941, -0.0269574523),
'cf_d_ana': (0.0000000011, -0.0037057437, 0.0183483958),
'cf_j_ana': (0.0000000000, 0.0004356094, -0.0009342432),
'cf_s_ana': (0.0000000000, 0.0004356094, -0.0009342432),
'cf_d_kokan': (0.0000000003, -0.0000340615, 0.0193923712),
'cf_j_kokan': (0.0000000003, -0.0000340852, 0.0193923712),
'cf_d_siri_L': (0.0006995648, 0.0001653936, 0.0200324059),
'cf_d_siri01_L': (-0.0000022426, 0.0499999970, 0.0000028610),
'cf_j_siri_L': (0.0006995425, 0.0006653816, 0.0200324059),
'cf_s_siri_L': (0.0006995425, 0.0006653816, 0.0200324059),
'cf_d_siri_R': (-0.0007000044, 0.0001655202, 0.0200324059),
'cf_d_siri01_R': (0.0000000000, 0.0499999858, 0.0000020266),
'cf_j_siri_R': (-0.0007000044, 0.0006655231, 0.0200324059),
'cf_s_siri_R': (-0.0007000044, 0.0006655082, 0.0200324059),
'cf_j_thigh00_L': (0.0000000000, 0.0045367014, -0.2599085569),
'cf_d_thigh01_L': (0.0008304268, -0.0000085849, 0.0197808743),
'cf_s_thigh01_L': (0.0008304268, -0.0000085849, 0.0197808743),
'cf_d_thigh02_L': (0.0008304268, 0.0000311676, 0.0175034404),
'cf_s_thigh02_L': (0.0008304268, 0.0000311676, 0.0175034404),
'cf_d_thigh03_L': (0.0008304268, 0.0000528507, 0.0162612200),
'cf_s_thigh03_L': (0.0008304268, 0.0000528507, 0.0162612200),
'cf_j_leg01_L': (-0.0000001565, -0.0001882389, -0.2238392234),
'cf_d_kneeF_L': (-0.0000010356, -0.0399756283, -0.0013961792),
'cf_d_leg02_L': (0.0008304194, -0.0000160560, 0.0126936734),
'cf_s_leg02_L': (0.0004141256, 0.0006808266, -0.0072855055),
'cf_d_leg03_L': (0.0008304194, 0.0000490360, 0.0108296350),
'cf_s_leg03_L': (0.0008304194, 0.0000490360, 0.0108296350),
'cf_j_leg03_L': (0.0000000000, 0.0117738210, -0.0496065579),
'cf_j_foot_L': (-0.0000000075, -0.1070634499, -0.0073633678),
'cf_j_toes_L': (-0.0000000075, -0.1070634536, -0.0073633678),
'cf_s_leg01_L': (0.0000015497, 0.0599634517, 0.0020940304),
'cf_s_kneeB_L': (0.0000015497, 0.0599634424, 0.0020940304),
'cf_j_thigh00_R': (0.0000000149, 0.0045371708, -0.2599344850),
'cf_d_thigh01_R': (-0.0008299947, -0.0000085682, 0.0197798610),
'cf_s_thigh01_R': (-0.0008299947, -0.0000085682, 0.0197798610),
'cf_d_thigh02_R': (-0.0008299947, 0.0000311676, 0.0175034404),
'cf_s_thigh02_R': (-0.0008299947, 0.0000311676, 0.0175034404),
'cf_d_thigh03_R': (-0.0008299947, 0.0000528507, 0.0162612200),
'cf_s_thigh03_R': (-0.0008299947, 0.0000528507, 0.0162612200),
'cf_j_leg01_R': (0.0000000000, -0.0001882352, -0.2238395214),
'cf_d_kneeF_R': (-0.0000000894, -0.0399756199, -0.0013961196),
'cf_d_leg02_R': (-0.0008300021, -0.0000160560, 0.0126936436),
'cf_s_leg02_R': (-0.0008300021, -0.0000160560, 0.0126936436),
'cf_d_leg03_R': (-0.0008300021, 0.0000490360, 0.0108296126),
'cf_s_leg03_R': (-0.0008300021, 0.0000490360, 0.0108296126),
'cf_j_leg03_R': (0.0000000745, 0.0117738321, -0.0495891199),
'cf_j_foot_R': (0.0000000447, -0.1070637517, -0.0073810909),
'cf_j_toes_R': (0.0000000447, -0.1070637591, -0.0073810909),
'cf_s_leg01_R': (0.0000001490, 0.0599634480, 0.0020939708),
'cf_s_kneeB_R': (0.0000001490, 0.0599634498, 0.0020939708),
'cf_s_waist02': (0.0000041698, 0.0000045616, 0.0999919176),
'cf_s_leg_L': (0.1000121087, 0.0000034906, 0.0999964476),
'cf_s_leg_R': (-0.1000037491, 0.0000056308, 0.0999873877),
'cf_s_waist01': (0.0000000001, 0.0000000000, 0.0213849545),
'cf_j_spine01': (0.0000000000, 0.0032969250, 0.0450000763),
'cf_s_spine01': (0.0000000000, 0.0000000000, 0.0214849710),
'cf_j_spine02': (0.0000000000, 0.0050841947, 0.0449999571),
'cf_s_spine02': (0.0000000000, 0.0000659386, 0.0223850012),
'cf_j_spine03': (0.0000064438, 0.0028000008, 0.0566434860),
'cf_j_neck': (0.0000000000, 0.0000000000, 0.0325000286),
'cf_j_head': (0.0000000000, 0.0001676232, 0.0251541138),
'cf_s_head': (0.0000000000, 0.0001676232, 0.0251541138),
'cf_s_neck': (0.0000000000, 0.0001676232, 0.0245041847),
'cf_s_spine03': (0.0000000000, 0.0001676232, 0.0232850313),
'cf_d_shoulder_L': (0.0001563374, 0.0002376232, 0.0241320133),
'cf_j_shoulder_L': (0.0940132719, -0.0000001993, 0.0000000000),
'cf_d_shoulder02_L': (0.0010964721, 0.0002376176, 0.0241320133),
'cf_s_shoulder02_L': (0.0010964721, 0.0002376176, 0.0241320133),
'cf_j_arm00_L': (0.1489044800, 0.0066715311, 0.0000000000),
'cf_d_arm01_L': (0.0012971163, 0.0002268590, 0.0241320133),
'cf_s_arm01_L': (0.0012968481, 0.0002330560, 0.0241320133),
'cf_d_arm02_L': (0.0022885203, 0.0002723690, 0.0241320133),
'cf_s_arm02_L': (0.0022885203, 0.0002723690, 0.0241320133),
'cf_d_arm03_L': (0.0031349957, 0.0003089495, 0.0241320133),
'cf_s_arm03_L': (0.0031350553, 0.0003072731, 0.0241320133),
'cf_j_forearm01_L': (0.1090970039, 0.0050626770, 0.0000000000),
'cf_d_forearm02_L': (0.0046593249, 0.0003493950, 0.0241320133),
'cf_s_forearm02_L': (0.0046591461, 0.0003536306, 0.0241320133),
'cf_d_wrist_L': (0.0055440068, 0.0003493391, 0.0241320133),
'cf_s_wrist_L': (0.0250180364, -0.0004227310, 0.0000002384),
'cf_d_hand_L': (0.0250180364, -0.0004227310, 0.0000002384),
'cf_j_hand_L': (0.0061240196, 0.0003494397, 0.0241320133),
'cf_s_hand_L': (0.0434948206, -0.0036587194, -0.0018885136),
'cf_j_index01_L': (0.0308244824, -0.0027071098, -0.0026963949),
'cf_j_index02_L': (0.0205492973, -0.0018050103, -0.0018019676),
'cf_j_index03_L': (0.0205492973, -0.0018050103, -0.0018019676),
'cf_j_little01_L': (0.0280875564, 0.0039625615, -0.0024572611),
'cf_j_little02_L': (0.0152931809, 0.0021575317, -0.0013381243),
'cf_j_little03_L': (0.0152931809, 0.0021575317, -0.0013381243),
'cf_j_middle01_L': (0.0340363383, 0.0000000112, -0.0029777288),
'cf_j_middle02_L': (0.0226911902, 0.0000002403, -0.0019830465),
'cf_j_middle03_L': (0.0226911902, 0.0000002403, -0.0019830465),
'cf_j_ring01_L': (0.0324101448, 0.0022749901, -0.0028355122),
'cf_j_ring02_L': (0.0216068029, 0.0015166700, -0.0018904209),
'cf_j_ring03_L': (0.0216068029, 0.0015166700, -0.0018904209),
'cf_j_thumb01_L': (0.0274280310, -0.0195015902, -0.0048363209),
'cf_j_thumb02_L': (0.0201677084, -0.0143394098, -0.0035561323),
'cf_j_thumb03_L': (0.0201677084, -0.0143394079, -0.0035561323),
'cf_s_elbo_L': (-0.0000313818, 0.0248819850, 0.0000001192),
'cf_s_forearm01_L': (0.0004531145, -0.0307315015, 0.0000000000),
'cf_s_elboback_L': (0.0004531145, -0.0307315006, 0.0000000000),
'cf_d_bust00': (0.0000000000, 0.0001676232, 0.0232039690),
'cf_s_bust00_R': (-0.0575999990, -0.0454922598, 0.0026999712),
'cf_d_bust01_R': (-0.0002007224, 0.0006882958, 0.0231761932),
'cf_j_bust01_R': (-0.0051772669, -0.0134591460, 0.0015155077),
'cf_d_bust02_R': (-0.0003042668, 0.0004191138, 0.0232065916),
'cf_j_bust02_R': (-0.0046416745, -0.0120668225, 0.0013588667),
'cf_d_bust03_R': (-0.0003971010, 0.0001777783, 0.0232336521),
'cf_j_bust03_R': (-0.0017852709, -0.0046411008, 0.0005227327),
'cf_d_bnip01_R': (-0.0006545857, -0.0017017275, 0.0001918077),
'cf_j_bnip02root_R': (-0.0048966482, -0.0061617792, 0.0016967058),
'cf_s_bnip02_R': (-0.0004578009, 0.0000199825, 0.0232515335),
'cf_j_bnip02_R': (-0.0004578009, 0.0000199825, 0.0232515335),
'cf_s_bnip025_R': (-0.0083650872, -0.0086106881, 0.0029753447),
'cf_s_bnip01_R': (-0.0004328042, 0.0000849515, 0.0232441425),
'cf_s_bnip015_R': (-0.0008926094, -0.0023205206, 0.0002615452),
'cf_s_bust03_R': (-0.0003971010, 0.0001777783, 0.0232336521),
'cf_s_bust02_R': (-0.0003042668, 0.0004191138, 0.0232064724),
'cf_s_bust01_R': (-0.0002007224, 0.0006882958, 0.0231761932),
'cf_s_bust00_L': (0.0575999990, -0.0454922598, 0.0026999712),
'cf_d_bust01_L': (0.0002007224, 0.0006882958, 0.0231761932),
'cf_j_bust01_L': (0.0051772669, -0.0134591460, 0.0015155077),
'cf_d_bust02_L': (0.0003042668, 0.0004191138, 0.0232065916),
'cf_j_bust02_L': (0.0046416819, -0.0120668299, 0.0013588667),
'cf_d_bust03_L': (0.0003971010, 0.0001777783, 0.0232336521),
'cf_j_bust03_L': (0.0017852709, -0.0046411008, 0.0005227327),
'cf_d_bnip01_L': (0.0006546006, -0.0017017350, 0.0001916885),
'cf_j_bnip02root_L': (0.0049032941, -0.0061767399, 0.0016988516),
'cf_s_bnip02_L': (0.0004578009, 0.0000199825, 0.0232515335),
'cf_j_bnip02_L': (0.0004578009, 0.0000199825, 0.0232515335),
'cf_s_bnip025_L': (0.0083783790, -0.0086406097, 0.0029795170),
'cf_s_bnip01_L': (0.0004328042, 0.0000849515, 0.0232441425),
'cf_s_bnip015_L': (0.0008926317, -0.0023205578, 0.0002613068),
'cf_s_bust03_L': (0.0003971010, 0.0001777783, 0.0232336521),
'cf_s_bust02_L': (0.0003042668, 0.0004191138, 0.0232064724),
'cf_s_bust01_L': (0.0002007224, 0.0006882958, 0.0231761932),
'cf_d_shoulder_R': (-0.0001560142, 0.0002376232, 0.0241320133),
'cf_j_shoulder_R': (-0.0939531336, -0.0000126194, 0.0000000000),
'cf_d_shoulder02_R': (-0.0010954589, 0.0002373699, 0.0241320133),
'cf_s_shoulder02_R': (-0.0010954589, 0.0002373699, 0.0241320133),
'cf_j_arm00_R': (-0.1495516151, 0.0065441933, 0.0000001192),
'cf_d_arm01_R': (-0.0012957752, 0.0002367441, 0.0241320133),
'cf_s_arm01_R': (-0.0012955368, 0.0002426561, 0.0241320133),
'cf_d_arm02_R': (-0.0022943318, 0.0002824105, 0.0241320133),
'cf_s_arm02_R': (-0.0022938997, 0.0002823994, 0.0241320133),
'cf_d_arm03_R': (-0.0031512678, 0.0003276281, 0.0241320133),
'cf_s_arm03_R': (-0.0031512082, 0.0003276169, 0.0241320133),
'cf_j_forearm01_R': (-0.1111739874, 0.0051015355, -0.0000002384),
'cf_s_elbo_R': (0.0000000298, 0.0251077451, 0.0000021458),
'cf_s_forearm01_R': (-0.0000276864, -0.0304288915, -0.0000027418),
'cf_s_elboback_R': (-0.0000276864, -0.0304288925, -0.0000027418),
'cf_d_forearm02_R': (-0.0047625899, 0.0003447086, 0.0241320133),
'cf_s_forearm02_R': (-0.0047624111, 0.0003491975, 0.0241320133),
'cf_d_wrist_R': (-0.0055437088, 0.0003451817, 0.0241320133),
'cf_s_wrist_R': (-0.0250178576, -0.0004224181, 0.0000003576),
'cf_d_hand_R': (-0.0250178576, -0.0004224181, 0.0000003576),
'cf_j_hand_R': (-0.0061238408, 0.0003451258, 0.0241320133),
'cf_s_hand_R': (-0.0434947014, -0.0036587510, -0.0018894672),
'cf_j_little01_R': (-0.0281152725, 0.0039664730, -0.0024597645),
'cf_j_little02_R': (-0.0152906775, 0.0021577775, -0.0013365746),
'cf_j_little03_R': (-0.0152906775, 0.0021577775, -0.0013365746),
'cf_j_middle01_R': (-0.0340698957, -0.0000000205, -0.0029808283),
'cf_j_middle02_R': (-0.0227140188, 0.0000003595, -0.0019767284),
'cf_j_middle03_R': (-0.0227140188, 0.0000003595, -0.0019767284),
'cf_j_ring01_R': (-0.0323968530, 0.0022740699, -0.0028343201),
'cf_j_ring02_R': (-0.0215651989, 0.0015144981, -0.0018799305),
'cf_j_ring03_R': (-0.0215651989, 0.0015144981, -0.0018799305),
'cf_j_thumb01_R': (-0.0274280310, -0.0195016302, -0.0048363209),
'cf_j_thumb02_R': (-0.0201677680, -0.0143393399, -0.0035561323),
'cf_j_thumb03_R': (-0.0201677680, -0.0143393390, -0.0035561323),
'cf_j_index01_R': (-0.0308635831, -0.0027105501, -0.0027000904),
'cf_j_index02_R': (-0.0205416679, -0.0018021995, -0.0018149614),
'cf_j_index03_R': (-0.0205416679, -0.0018021995, -0.0018149614),
}
# 使用方法:
# 在 modifyarmature.py 的 modify_finger_bone_orientations 函数中
# 将 reorient 函数替换为:
#
# from mathutils import Vector
#
# def reorient(bone):
# if bone in better_fbx_bone_tails:
# offset = Vector(better_fbx_bone_tails[bone])
# armature.data.edit_bones[bone].tail = armature.data.edit_bones[bone].head + offset
# else:
# # 如果骨骼不在字典中,使用原来的默认行为
# height_adjust = Vector((0,0,0.1))
# armature.data.edit_bones[bone].tail = armature.data.edit_bones[bone].head + height_adjust