Speed up some exports by providing the option to skip mesh data in Scene.frame_set()
Scene.frame_set() in the Python API is used by some exporters, notably the included glTF, FBX and animation data exporters, to sample animations per timeline frame. This method slows down significantly when the scene has complex meshes with skinning or other geometry altering modifiers. I assume the extra work comes from transforming the geometry, and it serves no purpose when the caller is only interested in the matrices or other animation data.
Currently, it seems the issue can be sidestepped by hiding the troublesome objects (or everything) from the Viewport for the duration of sampling. The workaround presumably works because the Dependency Graph evaluation skips meshes but still updates bones and other transformations for some reason. This sounds like "feature" that shouldn't be depended on.
Including the option to leave mesh data untouched directly in the frame_set()-call sounds like a useful addition to the API that speeds up some operations. I'd be surprised if adding this to the Depsgraph internals wouldn't benefit Blender internally as well, if it's not already supported.
EDIT: Looks like the WAR was a fluke in some internal state as I can no longer reproduce it :D
0 Comments