Advertisement
shoiko

Using Rama's dynamic loading

Aug 15th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1.  
  2. /***********************************************************************************************************
  3. //Content browser reference to object PTR
  4. /***********************************************************************************************************/
  5. template <typename ObjClass>
  6. static FORCEINLINE ObjClass* LoadObjFromPathPTR(const FName& Path)
  7. {
  8.     if (Path == NAME_None) return NULL;
  9.     return Cast<ObjClass>(StaticLoadObject(ObjClass::StaticClass(), NULL, *Path.ToString()));
  10. }
  11.  
  12. // Load Static Mesh From Path
  13. static FORCEINLINE USkeletalMesh* LoadSkelMeshFromPath(const FName& Path)
  14. {
  15.     if (Path == NAME_None) return NULL;
  16.     return LoadObjFromPathPTR<USkeletalMesh>(Path);
  17. }
  18.  
  19.  
  20. USkeletalMesh *  ARPG_State::ConvertPathToUSkeletalMesh(FString Path)
  21. {
  22.     USkeletalMesh* skelObject = LoadSkelMeshFromPath(*Path);//load the object as per tutorial below or use static load object directly, or use ObjectFinder.
  23.     return skelObject;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement