本文整理汇总了C++中USkeleton::MergeAllBonesToBoneTree方法的典型用法代码示例。如果您正苦于以下问题:C++ USkeleton::MergeAllBonesToBoneTree方法的具体用法?C++ USkeleton::MergeAllBonesToBoneTree怎么用?C++ USkeleton::MergeAllBonesToBoneTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USkeleton
的用法示例。
在下文中一共展示了USkeleton::MergeAllBonesToBoneTree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FactoryCreateText
//.........这里部分代码省略.........
SkeletalMesh->LODInfo.AddZeroed();
SkeletalMesh->LODInfo[0].LODHysteresis = 0.02f;
FSkeletalMeshOptimizationSettings Settings;
// set default reduction settings values
SkeletalMesh->LODInfo[0].ReductionSettings = Settings;
// Create initial bounding box based on expanded version of reference pose for meshes without physics assets. Can be overridden by artist.
// FBox BoundingBox(SkelMeshImportDataPtr->Points.GetData(), SkelMeshImportDataPtr->Points.Num());
// FBox Temp = BoundingBox;
// FVector MidMesh = 0.5f*(Temp.Min + Temp.Max);
// BoundingBox.Min = Temp.Min + 1.0f*(Temp.Min - MidMesh);
// BoundingBox.Max = Temp.Max + 1.0f*(Temp.Max - MidMesh);
// // Tuck up the bottom as this rarely extends lower than a reference pose's (e.g. having its feet on the floor).
// // Maya has Y in the vertical, other packages have Z.
// //BEN const int32 CoordToTuck = bAssumeMayaCoordinates ? 1 : 2;
// //BEN BoundingBox.Min[CoordToTuck] = Temp.Min[CoordToTuck] + 0.1f*(Temp.Min[CoordToTuck] - MidMesh[CoordToTuck]);
// BoundingBox.Min[2] = Temp.Min[2] + 0.1f*(Temp.Min[2] - MidMesh[2]);
// SkeletalMesh->Bounds = FBoxSphereBounds(BoundingBox);
// Store whether or not this mesh has vertex colors
// SkeletalMesh->bHasVertexColors = SkelMeshImportDataPtr->bHasVertexColors;
// Pass the number of texture coordinate sets to the LODModel. Ensure there is at least one UV coord
LODModel.NumTexCoords = 1;// FMath::Max<uint32>(1, SkelMeshImportDataPtr->NumTexCoords);
// Create the reference skeleton and update LOD0
FReferenceSkeleton& RefSkeleton = SkeletalMesh->RefSkeleton;
HierarchyBuilder.CopyToRefSkeleton(RefSkeleton);
SkeletalMesh->CalculateRequiredBones(LODModel, RefSkeleton, /*BonesToRemove=*/ nullptr);
SkeletalMesh->CalculateInvRefMatrices();
// Initialize the skeleton asset
EntitySkeleton->MergeAllBonesToBoneTree(SkeletalMesh);
// Point the mesh and skeleton at each other
SkeletalMesh->Skeleton = EntitySkeleton;
EntitySkeleton->SetPreviewMesh(SkeletalMesh);
// Create the animations
for (const FSpriterAnimation& Animation : Entity.Animations)
{
//@TODO: That thing I said...
const FString TargetAnimationName = Animation.Name;
const FString TargetAnimationPath = LongPackagePath / TEXT("Animations");
UAnimSequence* AnimationAsset = CastChecked<UAnimSequence>(CreateNewAsset(UAnimSequence::StaticClass(), TargetAnimationPath, TargetAnimationName, Flags));
AnimationAsset->SetSkeleton(EntitySkeleton);
// if you have one pose(thus 0.f duration), it still contains animation, so we'll need to consider that as MINIMUM_ANIMATION_LENGTH time length
const float DurationInSeconds = Animation.LengthInMS * 0.001f;
AnimationAsset->SequenceLength = FMath::Max<float>(DurationInSeconds, MINIMUM_ANIMATION_LENGTH);
const bool bSourceDataExists = (AnimationAsset->SourceRawAnimationData.Num() > 0);
TArray<struct FRawAnimSequenceTrack>& RawAnimationData = bSourceDataExists ? AnimationAsset->SourceRawAnimationData : AnimationAsset->RawAnimationData;
int32 TotalNumKeys = 0;
for (const FSpriterTimeline& Timeline : Animation.Timelines)
{
if (Timeline.ObjectType != ESpriterObjectType::Bone)
{
continue;