Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************************************************************************************
- //Content browser reference to object PTR
- /***********************************************************************************************************/
- template <typename ObjClass>
- static FORCEINLINE ObjClass* LoadObjFromPathPTR(const FName& Path)
- {
- if (Path == NAME_None) return NULL;
- return Cast<ObjClass>(StaticLoadObject(ObjClass::StaticClass(), NULL, *Path.ToString()));
- }
- // Load Static Mesh From Path
- static FORCEINLINE USkeletalMesh* LoadSkelMeshFromPath(const FName& Path)
- {
- if (Path == NAME_None) return NULL;
- return LoadObjFromPathPTR<USkeletalMesh>(Path);
- }
- USkeletalMesh * ARPG_State::ConvertPathToUSkeletalMesh(FString Path)
- {
- USkeletalMesh* skelObject = LoadSkelMeshFromPath(*Path);//load the object as per tutorial below or use static load object directly, or use ObjectFinder.
- return skelObject;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement