Skip to content

Commit c654c7d

Browse files
committed
表示先ボーンが正しくエクスポートできない不具合を修正
1 parent e9429a1 commit c654c7d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mmd_tools/core/pmx/exporter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ def __countBoneDepth(cls, bone):
198198

199199
def __exportBones(self):
200200
""" Export bones.
201-
@return the dictionary to map Blender bone names to bone indices of the pmx.model instance.
201+
Returns:
202+
A dictionary to map Blender bone names to bone indices of the pmx.model instance.
202203
"""
203204
arm = self.__armature
204205
boneMap = {}
@@ -250,7 +251,12 @@ def __exportBones(self):
250251
pmx_bones.append(pmx_tip_bone)
251252
pmx_bone.displayConnection = pmx_tip_bone
252253
elif len(bone.children) > 0:
253-
pmx_bone.displayConnection = list(filter(lambda x: not pose_bones[x.name].is_mmd_shadow_bone, sorted(bone.children, key=lambda x: 1 if pose_bones[x.name].mmd_bone.is_tip else 0)))[0]
254+
for child in bone.children:
255+
if child.use_connect:
256+
pmx_bone.displayConnection = child
257+
if not pmx_bone.displayConnection:
258+
pmx_bone.displayConnection = bone.tail - bone.head
259+
254260

255261
for i in pmx_bones:
256262
if i.parent is not None:

0 commit comments

Comments
 (0)