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

Animation broken. Following wrong bone #11

Open
vmol621 opened this issue Jun 15, 2022 · 1 comment
Open

Animation broken. Following wrong bone #11

vmol621 opened this issue Jun 15, 2022 · 1 comment

Comments

@vmol621
Copy link
Contributor

vmol621 commented Jun 15, 2022

Looks like animation is broken. This is basically the example plus the 2 lines copying the animation from the original mesh. The skeletal mesh works fine is it's just static without the animation.

The video attached is using the skeletalmesh and animation from the content examples. I've tried with other skeletal meshes and same issue.

This is tested with 4.27.2

void ADuplicateSkeletalMesh::Duplicate()
{
	TArray<FMeshSurface> OutSurfaces;                  
	TArray<int32> OutSurfacesVertexOffsets;            
	TArray<int32> OutSurfacesIndexOffsets;             
	TArray<UMaterialInterface*> OutSurfacesMaterial;   
	
	USkeletalMeshComponent* SkeletalMeshComp = SkeletalMeshActor->GetSkeletalMeshComponent();
	FRuntimeSkeletalMeshGenerator::DecomposeSkeletalMesh(
		SkeletalMeshComp->SkeletalMesh,
		OutSurfaces,
		OutSurfacesVertexOffsets,
		OutSurfacesIndexOffsets,
		OutSurfacesMaterial);

	USkeletalMeshComponent* comp = FRuntimeSkeletalMeshGenerator::GenerateSkeletalMeshComponent(
		this,
		SkeletalMeshComp->SkeletalMesh->Skeleton,
		OutSurfaces,
		OutSurfacesMaterial);

	comp->AnimationData = SkeletalMeshComp->AnimationData;
	comp->SetAnimationMode(EAnimationMode::AnimationSingleNode);
}

Skeletalmesh on the left is the original and the right is the duplicated one.

SkelAnimBroken.mp4
@vmol621
Copy link
Contributor Author

vmol621 commented Jun 15, 2022

Found the bug and requested merge request for fix.

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

1 participant