Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rockyappdev opened this issue May 31, 2015 · 1 comment

Comments

@rockyappdev
Copy link

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);
...
}
...
}

@rockyappdev
Copy link
Author

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);

@bm9 bm9 closed this as completed Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants