This commit extends dependency graph API with an argument which
denotes that all custom data layers are to be preserved. This
forces modifier stack re-evaluation with more inclusive mask.
Far from ideal, since this might fail in certain configurations
with indirectly used objects which might be missing layers needed
for the current object evaluation. But this is how it worked for
a long time, so should be good enough for until more sophisticated
solution is found.
One thing which is still not covered is the shape keys. Not sure
what is the correct way for them and this is something where
input from Bastien is appreciated. Maybe share shape key datablock,
or duplicate it as well?
In order to use this new behavior two things are to be passed:
- Pass keep_all_data_layers=True
- Pass valid dependency graph.
The dependency graph is only needed if keep_all_data_layers=True
and is NOT to be passed if keep_all_data_layers=False.
If keep_all_data_layers=True the dependency graph MUST be passed.