Steps to Reduce Animation Scene Crashes
Kiel Figgins - 3dFiggins.com



Table of Contents
  • Overview
  • Scene Issues
  • Rig Issues
  • Additional Solutions




  • Overview

    Crashing is as frustrating as it is hard to track down. These crashes can be caused from memory leaks, segment faults or a whole host of other issues. If you're experiencing frequent crashes, hopefully the steps below will help reduce the number.

    First, you'll want to figure out if the crashes are coming from the animation scene or the rig itself. To find this out, try:
             1. Create a new scene
             2. Reference in the rig
             3. Work for a bit and try to recreate the issue

    If you find that you can work with the rig without issue, it's likely a Scene related matter, if however it crashes with just the rig, it's Rig issue.



    Scene Issues
    If the rig works in a stand alone scene, you may need to optomize your anim scene.

    A) Close other running programs to free up memory (other Mayas, Photoshop, streaming content, etc)

    B) Clean up your anim scene file
             -Remove/unload other assets/references that may be causing memory loss (other rigs, caches)
             -Turn off dynamics, nucleus evaluations, particles
             -Turn off 'Echo All Commands' in the Script Editor (Windows > General Editors > Script Editor > History > [ ] Echo All Commands)
             -Find/remove unknown nodes in your scene. You can do this by running the following MEL commands in the Script Editor

    string $unk[] = `ls -type unknown`;
    delete `ls -type unknown`;



    IMAGE 1 - Showing Script Editor with MEL lines


    C) Reduce viewport usage. Maya's viewports can really effect playback, try turning off the following
             -polyDisplaySmooth
             -Textures
             -Lights/shadows
             -Ambient Occulsion/anti alias/motion blur
             -Hardware fog
             -Image planes


    IMAGE 2 - Viewport Options to turn off


    D) Clamp the Viewport 2.0 textures to 2048


    IMAGE 3 - Viewport Texture Clamping


    E) Switch Viewport 2.0 to Legacy Viewport


    IMAGE 4 - Viewport to Legacy


    F) Toggle between DG and Parallel evaluation
             -Window > Settings / Perferences / Preferences > Preferences > Settings > Animation > Evaluation Mode


    IMAGE 5 - DG / Parallel evaluation




    Rig Issues
    If you find the rig itself is the issue, you can try the following. However, depending on your pipeline, you may not have the ability to edit the rig directly. If that's the case, you may need to talk with your Rigging department to explore these options.

    A) Copy rig file from the server to a local directory, then remap the reference to point to the local file instead of the network one. The same would need to be done for the textures.

    B) Save the rig locally from your own version of Maya. Different versions of Maya create different nodes and attributes that may be causing a conflict.
             -Open the rig file
             -File > Save As
             -Save to a local directory
             -Remap the reference to point to this version of the rig file

    C) Save version of the rig locally with the textures deleted. If memory is an issue, loading in possbily huge texture files into RAM can cause more crashes.
             -Open the rig file
             -Windows > Hypdershade
             -Textures Tab


    IMAGE 6 - Hypershade Textures to Delete


    D) Delete All the character meshes in the rig file and create your own anim proxy meshes. This would likely be done in conjuction with the above steps as you're essentially creating your own anim proxy file. The goal of which is to remove the heavy calculations of the skinning or deformations.
             -Open the rig file
             -Create proxy polygon meshes (cubes/sphers/cylindars)
             -Constrain these proxies to the joints/rig. On rigs from my Store (3dFiggins.com/Store), the joints can be shown from the character's World Control > JointVis channel
             -Delete the character meshes
             -Save a new version of the rig

    E) Delete any unknown nodes in the rig or anim scene. Run the following MEL script in a MEL tab in the Script Editor:
    string $unknownNodes[] = `lsType unknown`;
    for($node in $unknownNodes){
    if($node=="")
    break;
    if(`objExists $node`)
    {
    int $lockState[] = `lockNode -q -l $node`;
    if($lockState[0]==1)
    lockNode -l off $node;
    delete $node;
    }
    }
    


    F) Optomize the rig file. Now this is a really nuclear option, especially if you didn't build the rig. As removing nodes or connections may disable tools or connections later on. However, since the goal is to keep animating and you should still have the old rig you can swap the reference back to.
             -Open the rig file
             -File > Optomize Scene Size > Option Box
             -Check All, except for Remove Empty Transforms
             -Click Optomize
             -Save new version of the rig


    IMAGE 7 - Optomize Settings




    Conclusion

    Hopefully one of these, or a combination is enough to reduce the amount of crashing. If you have any others, do let me know and I'll add them.

    For an on going thread with additional solutions, do check out the replies to the original tweet

    ➡️Steps to Reduce the number of Scene Crashes

    New writeup on possible options to reduce the number crashes with rigs and while animating in Mayahttps://t.co/4DO6nRsdPP

    If you have any others, do let me know and I'll add them to the list! pic.twitter.com/zsSio5tpJr

    — Kiel Figgins (@KielFiggins) November 8, 2020




    Other Opinions, Further References, Typos, and Grammar Issues please contact KielFiggins22@gmail.com