Morph Targets on Clothing Mesh Worn By Current Character

This will be a fairly long post, but, I want to get all the info I can up front on my problem. I am building a game that has the ability to have characters and change their clothes as a part of it. I am having problems with setting morph targets on clothing that is being worn by the current player character. I can get the Character meshes to change, but, not the clothes meshes. The current character has the following meshes.

hierarchy.png&stc=1

Here is what the morphs look like for my character in the previewer.

&stc=1

I apply the Fear 2 Morph in the Previewer and it works.

&stc=1

In my game I have Menu System that reads all the morphs from a mesh that is passed to it and displays it on the screen. For example, the next two pictures show the Character in the game with it’s morphs and the same Fear 2 morph being applied in the game.

&stc=1

&stc=1

So, I know that the meshes and the morphs can be changed at least for the character using my menu system and related blueprints. I imported clothes for the character with the morphs as well. Here is an example of the shirt with the morphs in the Previewer. I am applying a morph in the Previewer that flares out the bottom of the shirt. It works in the Previewer just like the morphs worked for the Character in the Previewer.

&stc=1

&stc=1

So, when I try applying the same morph in the game here is what happens. The menu system also has a combo box that allows the player to select the clothes for the figure. I select the shirt mesh and apply the same Stocky Hip mesh that flares the shirt in the Previewer and it doesn’t work. I have messages from the blueprint to make sure that I am selecting the correct mesh, morph and morph value/weight.

&stc=1

Before Morph:

&stc=1

After Morph:

&stc=1

Output Log:

&stc=1

It doesn’t work. The Blueprint code is the same. It passes the skeletal mesh component to change the morphs (for both the Character morphing and the Clothes).

Here is the Blueprint snippet for getting the morphs to populate the menu. It obviously gets the morphs as shown above.

BlueprintToDisplayMorphsInMenu.png&stc=1

This is the Blueprint snippet that then gets the Skeletal Mesh to pass to the code that will apply the morphs for the Shirt.

CodeToGetShirtComponentInCurrentFigure.png&stc=1

Finally, the Blueprint snippet that changes the morph when the value of the slider bar was changed in the menu.

&stc=1

I am wits end trying to figure this out. It has been a couple of days of trying all kinds of things and no luck so far.

Does anybody have any idea why this wouldn’t seem to work with the Shirt Mesh, but, works just fine for the Character Mesh? Any insight would be appreciated.

I figured it out and the solution is totally counterintuitive.

  1. First make sure that the clothes are on the same level as the Character. They should not be slaves in the hierarchy.

&stc=1

  1. When you apply the morph, instead of applying it to the clothes skeletal mesh you apply it to the character skeletal mesh.

&stc=1

What sense does that make. The clothes are no longer related to the character in a master slave relationship, but, when you apply the morph target for let’s say a shirt to make it “looser” you apply it against the character skeletal mesh which doesn’t even have a morph for “looser”. All I can figure is that when you get the mesh for the current figure it gets all the meshes associated with it instead of just the character mesh.

1 Like