Invisible Mesh during animation

Engine Version: Using UE4.9.2

I have a character mesh which is animated with an animation blueprint. I’m using a state machine to drive the animations. For the very first state, I play a “spawning” animation. The problem is that if the skelmesh is not visible for the first animation sequence unless there is some way to cause a refresh, by the following means:

  • Rotate the camera view frustum so that the character capsule is off screen, then rotate camera so capsule is back on screen. If the center position of the capsule component gets clipped by the camera view frustum, the skelmesh appears.
  • Change the view mode to wireframe or unlit, and then back to lit.
  • Pause the game, alt tab to another window, put game window back into focus, resume game
  • If you do nothing: As soon as the animation state machine transitions into another state, the skelmesh becomes visible
  • The camera view frustum must be centered on the character when they spawn.

What’s weird is that when I pause the game, switch to wireframe mode, the animation is locked on frame #0 in the spawning sequence. When I resume playing, the animation jumps immediately to the correct frame it should be on. I looked at the animation play rate: It is fixed at 1.0f

Here are some screenshots I took of the problem. I paused the game, took a screenshot, pasted into photoshop, switched to wireframe, repeated. Then I quickly double tapped the pause button to progress to the next frame and repeated the process. You can see that there is a huge animation discontinuity between the frames.

Wire Frame #X:

Wire Frame #X+1

Lit Frame #X

Lit Frame #X+1

Hi Slayemin,

I’m having trouble reproducing this issue. Any chance you could use the migrate feature to transfer that BP to a blank project and send it to me? Could you also test to ensure it occurs in the blank project before sending it? You can upload to a filesharing site and PM me the link.

-.

That’s going to be a lot of work. The game is a of C++ and blueprints, so I’d have to send you the whole code base. I’ve also made some small modifications to the engine source code, so I’d have to include those so you can build and run the project. I will work to build an isolated new project with this, but it may take me a while. The game also has some assets which I purchased on the market place, so I’d want to take reasonable measures to protect those third party assets from being publicly available. Is there a good site we can use to upload larger projects like mine?

Any chance you could bring over the skeletal mesh and animations and try to recreate the bug in a blank project? I totally understand wanting to protect your assets and marketplace assets. Generally people use Google Drive or Dropbox, but whatever service you choose make sure you always use a “with link only” or password protected file. And ensure that you PM me and don’t respond here.

I don’t mean to seem like I’m asking you to do a lot of leg work, but I could also be misunderstanding the bug. Isolating the bug in a standalone project will help us track down better repro steps.

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

-.

Okay, I’ve narrowed down the problem significantly and have been able to reliably reproduce the issue and I have really hackish work around which resolves the issue. So, the issue is a matter of skelmesh occlusion and the renderer. If you have a character such as a zombie, and the very first animation the zombie plays is one where it emerges from beneath the ground, the renderer will think that the skelmesh isn’t visible based off of the first frame of the start animation, so it skips rendering the mesh entirely. It doesn’t matter whether you use an animation blueprint or use an animation instance, the result is reproducible. When the mesh comes into the camera frustum, the renderer still doesn’t draw the mesh for some reason. This happens with two separate zombie packs I got off the market place, so I am ruling out something with the animation or mesh itself. The further odd issue is that when the animation blueprint transitions to another animation state, that mesh is also invisible. It is ONLY the mesh that is hidden, however. Any anim notify events in the animation sequence still fire as normal, so the animation is certainly playing. One way to get the skelmesh to become visible is to either switch into wireframe mode and then back into lit mode, or to use the custom depth buffer to briefly create an outline around the skelmesh.

My really bad and dirty hack is to initialize the animation blueprint with an animation which initializes above the ground, plays for one frame, then switches to the animation which causes the zombie to emerge from underground. I can do this reliably, but there is a very noticeable pop as it transitions from a standing animation to crawling out of the ground. If I knew more about the renderer on the engine side, I could dig deeper to isolate the source of the problem, but this is about the extent of my current engineering capabilities.

The current “best” workaround is to manually set the skelmesh to “hidden in game” to true. Within the “begin play” node, set the skelmesh “hidden in game” to false. I think this forces the renderer to refresh the visibility check. Through about 30 tests, I can reliably toggle the bug on and off and this is the fix until it gets fixed engine side.

Hey Slayemin,

Can you tell me if changing the MeshComponentUpdateFlag in SkelMesh details to “Always Tick Pose and Refresh Bones” has any effect?

-.

1 Like

Yes, that appears to fix the problem as well.