Download

Losing all shaders/materials on SetMorphTarget?

I’m sure this is some minor thing i forgot, but when i use SetMorphTarget and change the value of some Morph Target from 0 to 1 via Blueprint i seem to lose all shaders/Materials.

I already checked the materials and they have “use with Morph Targets” checked. Any idea what the problem could be?

So here’s the model with the morph set to 0 (Default on import) - all looking fine.

And here after i push the button which calls “SetMorphTarget” to a value of “1”…

Any help or comment appreciated!

Open the material(s), click on the main material node and you see that on the side tab ( usually bottom left of the window ) you have some properties…scroll until you find “Use with Morph Target”, and its done :wink:

Nope, “use with morph target” was already ticked.

The problem actually affects the WHOLE level, ALL assets lose their shaders.

Buuuuut - i found the problem. Imho a BUG. 4.17.1 here…

I had used a skeletal mesh and applied the morphs. Then the problem occurs. When i use an Animation sequence it works as expected. So NEVER apply morphs on the mesh, apply them to an animation sequence, even if you don’t plan to animate the mesh.

I say it’s a bug because if SetMorphTarget isn’t supposed to work with skeletal meshes it should throw an error, NOT crash all shaders.

Edit: Interstingly “SetMaterial” (Rendering) has the same bug, just vice versa. So if you use SetMaterial on the Animation Sequence it will also kill all shaders…

Edit: OK no bug, but silly problem…

For debugging purposes i had put the functions on “random” keys. So F2, F3, F4…

While you CAN use the F-Keys and they do run the functions they also seem to have some engine specific stuff, like F4 turns off shaders or so…

Have put the functions on other keys and all weird behaviour disappeared. Oh well, lesson learned i guess…