Blender Git Loki

Git Commits -> Revision 2166835

Revision 2166835 by Sergey Sharybin (master)
July 3, 2019, 14:32 (GMT)
Fix T66234: Issue on switching material mode between Object and Data

The root of the issue comes to the fact that part of dependency graph
is being removed, without doing any further remapping.
This was happening because only materials used by objects were pulled
in, so when material mode is changed some material became unused and
removed from the dependency graph and freed, causing object or its
data to point to a freed memory in its materials array.

Simplest and safest way to solve this is to pull materials referenced
by both object and object data. This causes somewhat higher memory
usage but keeps evaluated state of scene in an always consistent state,
without any need to tag/update object's data on material mode change.

Don't think it is a problem in practice.

Reviewers: brecht, fclem

Reviewed By: brecht, fclem

Differential Revision: https://developer.blender.org/D5172

Commit Details:

Full Hash: 21668359b79bd4a44a1f34e479a7bd8072ecdc69
Parent Commit: 5b2705a
Lines Changed: +36, -16

4 Modified Paths:

/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc (+17, -8) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_nodes.h (+1, -0) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_relations.cc (+17, -8) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_relations.h (+1, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021