diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-03 16:15:11 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-03 17:32:13 +0300 |
commit | 21668359b79bd4a44a1f34e479a7bd8072ecdc69 (patch) | |
tree | 04380c4a057651c768eb00f8b81015239274f2d9 /source/blender/depsgraph/intern/builder/deg_builder_nodes.h | |
parent | 5b2705adf659455399cecf873f7548e5e293f521 (diff) |
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
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.h')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 9983b346355..de9f0e4d6cd 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -202,6 +202,7 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { void build_light(Light *lamp); void build_nodetree(bNodeTree *ntree); void build_material(Material *ma); + void build_materials(Material **materials, int num_materials); void build_texture(Tex *tex); void build_image(Image *image); void build_world(World *world); |