Load a static mesh based on the name?

Hi!
Is there anyway to use a string to load a new static mesh… for instance in my case I have a series of meshes that I would like to load with a small interval of time, so basically I would like to “key frame” a bunch of meshes to switch between…
And in this case it would be very handy to just be able to dynamically build the staticmesh name, add an index to the string and then swap the old static mesh with the new static mesh based on the new string-name.

Any ideas?

Br,
Inx

Looking for this too, in blueprint that is. You can do it in C++ though…

I’m also looking for something like that too. Please devs, give us something!

Dont think think its possible to get the name of static mesh from content browser…

I am a newbie in UE4 and I am not sure to understand your question correct. Do you have a folder including with some static meshes (.obj) connected with some textures (.png) and the material linker (.obj.mtl)? I try to do something similar like you (animation of some static mesh). First of all I imported all obj files by the importer to Unreal. Next, I saved all files to (.uasset). You can use the ObjectLibrary() to load all assets in the folder. Finally, I created an EmptyActor and attached each mesh from the library. Is this what you are looking for?

BeginPlay()
`TArray ar_asset;
UObjectLibrary* ObjectLibrary;
ObjectLibrary = UObjectLibrary::CreateLibrary(UStaticMesh::StaticClass(), true, GIsEditor);
ObjectLibrary->AddToRoot();

	ObjectLibrary->LoadAssetDataFromPath(path);
	
	ObjectLibrary->GetAssetDataList(ar_asset);`

Tick()

st_mesh = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, *ar_name[ar_count], NULL, LOAD_SeekFree, NULL));
1 Like

I’m also trying to find a way to set a static mesh from a name or string. Any thoughts?