bm9/IM4U

UPmxFactory::CreateMMDExtendFromMMDModel() should assigned the BoneIndex in MMDExtendAsset.

rockyappdev opened this issue · 1 comments

I would like to have set the BoneIndex in CreateExtedFromMMDModel() function.

USTRUCT()
struct ENGINE_API FMMD_IKLINK
{
UPROPERTY(EditAnywhere, Category = IK, meta = (ToolTip = "ue4 link bone index"))
int32 BoneIndex; // Link bone index ( for skeleton bone index ,use ik func)
}
USTRUCT()
struct ENGINE_API FMMD_IKInfo
{
UPROPERTY(EditAnywhere, Category = IK, meta = (ToolTip = "ue4 IK bone index"))
int32 IKBoneIndex; // IK target bone index ( use ik func. ref skeleton.)
}

UMMDExtend* UPmxFactory::CreateMMDExtendFromMMDModel(
UObject* InParent,
USkeletalMesh* SkeletalMesh,
MMD4UE4::PmxMeshInfo * PmxMeshInfo
)
{
const FReferenceSkeleton ReferenceSkeleton = SkeletalMesh->Skeleton->GetReferenceSkeleton();
const FName& Name = FName(*SkeletalMesh->GetName());
...
addMMDIkInfo.IKBoneIndex = ReferenceSkeleton.FindBoneIndex(addMMDIkInfo.IKBoneName);
for (int ikInfoID = 0; ikInfoID < tempPmxIKPtr->LinkNum; ++ikInfoID)
{
addMMDIkInfo.ikLinkList[ikInfoID].BoneIndex = ReferenceSkeleton.FindBoneIndex(addMMDIkInfo.ikLinkList[ikInfoID].BoneName);
...
}
...
}

I have missed the another member variable TargetBoneIndex, please handle as same as IKBoneindex.

MMDExtendAsset.h
USTRUCT()
struct FMMD_IKInfo
{
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MMD", meta = (ToolTip = "ue4 target bone index"))
int32 TargetBoneIndex; // IK target bone index ( use ik func. ref skeleton.)
};

PmxFactory.cpp
Line: 1471
//this bone(ik-bone) index, from skeleton.
addMMDIkInfo.TargetBoneIndex = ReferenceSkeleton.FindBoneIndex(addMMDIkInfo.TargetBoneName);