How do I retrieve the USkeletalMesh from the USkeletalMeshComponent? I can’t find it anywhere I must be overlooking it somewhere. I also checked USkeletalMeshComponent | Unreal Engine Documentation and various other sites but couldn’t find it. I would have expected it to be called GetSkeletalMesh() but it doesn’t exist. I do know that it seems to be located inside FAnimationEvaluationContext but that variable is also private now.
if (StaticMeshComp->StaticMesh != nullptr) { return StaticMeshComp; } // no longer works
if (StaticMeshComp->GetStaticMesh() != nullptr) { return StaticMeshComp; } // works (probably changed in the last 3 patches somewhere)
if (SkeletalMeshComp->SkeletalMesh != nullptr) { return SkeletalMeshComp; } // no longer works in UE 4.18 How to retrieve it now? EDIT: This however still works.
The skeletal mesh value is actually stored in USkinnedMeshComponent, although not specifically declared as such it is public as the GENERATED_UCLASS_BODY() adds a public declaration in it’s macro magic - the newer version of this macro GENERATED_BODY() does not do this.
class ENGINE_API USkinnedMeshComponent : public UMeshComponent
{
GENERATED_UCLASS_BODY()
/** The skeletal mesh used by this component. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Mesh")
class USkeletalMesh* SkeletalMesh;
so that TWeakObjectPtr< class USkinnedMeshComponent > MasterPoseComponent; under the declaration of SkeletalMesh is also public?
Is there a place to check the difference of those macros?.
The macros can be found in the corresponding .generated.h file, search for GENERATED_BODY or GENERATED_BODY_LEGACY. I don’t understand what is going on fully though
The GENERATED_BODY macro simply redirects you to one of the macros in the .generated.h file - it contains to code itself. For the definition of GENERATED_BODY look in ObjectMacros.h
Getting this exact same error in UE 5.1 and this was the only post I could find on this topic and with this error message. Does anyone know what the issue might be?
So this is actually throwing a warning when compiling Metahumans in 5.1 blueprints. Understood this is the programming forum, but it’s literally the only thread about this topic. Should I start one in blueprints forum? The effect it’s having is that when I choose a new skeletal mesh for (body, feet, legs, etc.) a part of my MH, the editor menu doesn’t reflect this change, even though the MH in the viewport does.
I imported a Metahuman character into UE5.1 ,errors showed “Use USkeletalMeshComponent::GetSkeletalMeshAsset() or GetSkinnedAsset() instead.”, I saw this post, and your this reply, I searched “GetSkeletalMeshAsset” node,and set it into the blueprint,the errors disapear,but I don’t know if this behavior will influnce the progarm running normally.