Change Skeletal mesh by name

Hello there,

I want to change the gender of my character model at runtime based on its path name with the following method:

And it works perfectly IF I dragged the character models into the map beforehand. It seems that this way the model is loaded into memory once and therefore the asset registry works. But when I newly start the editor and execute these nodes without dragging in models, it doesn’t work.

My question: Is there a node with which you can force load the skeletal mesh before changing/applying it? Thanks in advance.

How about this ?

The conversion node in the middle is called ToSoftObjectReference (SoftObjectPath)

Thanks for your answer, Chatouille. Somehow it doesn’t work and the cast fails. But I have to investigate that further.

Edit: Ok maybe I should have said that the character consists of multiple body parts. And I am loading the body parts in a row (loop) , now the problem with this Asynch Load method is, that it only loads the last body part in a loop and somehow ignores the previous ones

You could try adding a Map of skeletal meshes to your character so that you have a reference to the meshes (you might look into lazy loading also).

Here is an example from my mechanics library.

In my solution, I created a struct to represent my characters. And then used a datatable to fill in the properties such as the meshes that can be used for each actor variation.

1 Like

Async nodes and loops don’t mix well together.

If you have a small fixed amount of body parts I’d suggest simply duplicate as many branches as needed.

If that is not an option (huge/variable amount), you’ll have to implement async loop manually in some way. Something like this :

4 Likes

Thanks @koda and thanks @Chatouille … The extra map is a really creative solution but I went with Chatouille’s , because it seemed faster to implement for my cause. Works like a charm. Thank you guys! <3