Page MenuHome

Armature modifier on hidden objects
Closed, ArchivedPublic

Description

System Information
Win 7, GeForce 970

Blender Version
Broken: 2.78c

Armature modifiers are still being calculated for hidden objects, resulting in degraded performance for animation previews of an armature driving multiple objects, even when not all modified objects are visible.

Exact steps for others to reproduce the error
With attached file, preview animation, and observe playback rate. Remove or disable armature modifiers on hidden clothing or hair items (under respective dummy holders): alternatively, delete hidden objects. Preview animation and observe playback rate again. On my system, playback rate increased from 5fps to 30fps

Details

Type
Bug

Event Timeline

Played at about 5 fps,
then deleted Dummy Hair and Dummy Clothing, no difference in playback.
That was with 2.79

Played at about 5 fps,
then deleted Dummy Hair and Dummy Clothing, no difference in playback.
That was with 2.79

The dummy objects aren't rigged. It's all the child objects parented to them that have armature modifiers applied. Were those deleted as well, or just the dummy objects?

Just dummy objects. That's what I thought you meant by "alternatively, delete hidden objects. "

While it is very well possible that hidden objects need to be evaluated (think of something shrinkwrapped to a hidden deformed object - you would want the deformations to be evaluated), it doesnt have to be so (agree, it would make sense to skip evaluation in that case).

I set up a little testcase with 50 armature-deformed grids (making sure none of them is a dependency elsewhere) and get this:

# hidden, modifier disabled = 60 fps
# hidden, modifier enabled = 20 fps
# visible, modifier enabled = 7.4 fps
# visible, modifier disabled = 10.4 fps
# on hidden layer, modifier enabled = 60 fps

Makes no difference if I use old or new dependency graph.
Note that evaluation gets properly skipped if stuff is on a hidden layer.
To me it seems there is really room for optimization here, but needs further investigation in the dependency graph

At a quick glance at the code, dependency graph is only aware of layers, not object visibilities at all.
This is not limited to the Armature modifier, seems all modifiers evaluated (e.g. on frame change)
(Above difference in fps between visible vs. hidden is probably drawing code etc, not modifier evaluation).
So in that case, I would think this is a (somewhat known) limitation to the depsgraph?

In 2.8, object visibilities are moved to collections to my knowledge, not sure how much that will change things.
I would still suspect modifiers to be evaluated in a hidden collections on a layer, but maybe @Sergey Sharybin (sergey) can share his wisdom?
Is there something about evaluation-'untag' [in case its hidden and nothing else depends on it] up your sleeve?

Can we archive this as "by design" (and not a bug)?

Sergey Sharybin (sergey) closed this task as Archived.Apr 27 2018, 1:31 PM

Depsgraph indeed only takes layers into account. This way it's cheap to see if some object from hidden layer affects something currently visible. In Blender 2.8 we are switching to collections visibility instead of object visibility. This part is still being worked on, so need some work to make depsgraph aware of that once rest of design is locked down.

So thanks for the report, but it's not a bug.