From a016ad2ea8d718a8f48be841fe463bc5a54e3be8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 28 Mar 2019 15:05:04 +0100 Subject: Fix part of T60735: invalid CD_ORIGINDEX data in some modifier stack evaluations. BKE_mesh_new_nomain automatically added a CD_ORIGINDEX layer initialized to 0, which was never filled in correctly. In 2.7 the equivalent function used to modify the source derivedmesh and add valid original indices to it, but this is no longer possible in the new design and was quite unpredictable anyway. Now instead rely on mesh_calc_modifiers and the depsgraph to determine when CD_ORIGINDEX should be added. --- source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/depsgraph') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 33850181f60..f0c1dc8ffc3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -931,6 +931,11 @@ void DepsgraphRelationBuilder::build_object_parent(Object *object) * so we onl;y hook up to transform channel here. */ add_relation(parent_geometry_key, ob_key, "Parent"); } + + /* Dupliverts uses original vertex index. */ + if (parent->transflag & OB_DUPLIVERTS) { + add_customdata_mask(parent, DEGCustomDataMeshMasks::MaskVert(CD_MASK_ORIGINDEX)); + } } void DepsgraphRelationBuilder::build_object_pointcache(Object *object) -- cgit v1.2.3