4.11 - SkeletalMeshComponent::SetSkeletalMesh(), SetRootBodyIndex() Crash

Hello anyone more getting the Array invalid index crash on this? Any fix without directly override the method?

I have described the issue here, to be sincere, I would love to know the origin, I don’t think it’s a “bug”, if so all SetSkeletalMesh( ) called on ACharacter components would shoot the crash.

The log points directly to SetRootBodyIndex().

Best Regards

creasso

Started experiencing the same issue with 4.9.2 and still with 4.11.
Going back to the 4.9.2 code, I simply added a SpaceBases.IsValidIndex() check to USkeletalMeshComponent::SetRootBodyIndex() to get past it.
I have no idea if there are any lasting affects from doing so :frowning:



                    int32 ParentIndex = SkeletalMesh->RefSkeleton.GetParentIndex(BoneIndex);
                    if (BoneIndex != 0 && ensure(ParentIndex != INDEX_NONE))
                    {
                        const TArray<FTransform>& RefPose = SkeletalMesh->RefSkeleton.GetRefBonePose();

                        const TArray<FTransform>& SpaceBases = GetSpaceBases();

+                        if (SpaceBases.IsValidIndex(BoneIndex))
+                        {
+                            FTransform RelativeTransform = SpaceBases[BoneIndex].GetRelativeTransformReverse(SpaceBases[ParentIndex]);
+                            // now get offset 
+                            RootBodyData.TransformToRoot = RelativeTransform;
+                        }
                    }


The trouble with this fix is the need to get a Custom engine build at each update (so much easy simply go with Epic default ones).
Let’s see if someone from the dev team watch this and help us (maybe adding your check right to SkelatalMeshComponent code).

Thanks for point this Kris.

Seems the 4.11 hotfix 1 has added this fix.
Was just comparing versions when I noticed it.
So both the binary & custom builds should now be ok.

The default release (updated by launcher today to 4.11.1) doesn’t contains the change in the line 2192 of SkeletalMeshComponent.
Are you talking about the git version Kris?

Confirmed, the fix is already implemented on the git Branch, but didn’t came on hotfix 1.
Well, since there is also a fix about mouse on hotfix 2 will be just a matter of time, I’ll get it on the next one. I still have some things that I could implement on 4.10.

Thanks for your attention.

Odd… I swear I grabbed the 4.11.1 hot fix, not release (from github).