diff options
author | Hans Goudey <h.goudey@me.com> | 2022-03-21 22:44:39 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-03-23 19:50:08 +0300 |
commit | c9290d23ca52a1d5986c21b3f947b7dd2e2de4b1 (patch) | |
tree | 9c6dd2433d4b22f3cb4b3e091859f1f7934fce57 /source/blender/modifiers/intern/MOD_array.c | |
parent | b444ed2b3835f46b63c0d398ac499debbec291a2 (diff) |
Fix T96494: Array modifier with caps crash on curve objects
Since 3b6ee8cee7080af20, a list of vertex groups cannot be retrieved
from curve objects for merging because curve objects do not support
vertex groups. Previously the empty list on the object was returned.
Only mesh objects are supported for the caps.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_array.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index de129888060..df02cc33507 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -412,8 +412,10 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, Object *start_cap_ob = amd->start_cap; if (start_cap_ob && start_cap_ob != ctx->object) { - vgroup_start_cap_remap = BKE_object_defgroup_index_map_create( - start_cap_ob, ctx->object, &vgroup_start_cap_remap_len); + if (start_cap_ob->type == OB_MESH && ctx->object->type == OB_MESH) { + vgroup_start_cap_remap = BKE_object_defgroup_index_map_create( + start_cap_ob, ctx->object, &vgroup_start_cap_remap_len); + } start_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(start_cap_ob, false); if (start_cap_mesh) { @@ -425,8 +427,10 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, } Object *end_cap_ob = amd->end_cap; if (end_cap_ob && end_cap_ob != ctx->object) { - vgroup_end_cap_remap = BKE_object_defgroup_index_map_create( - end_cap_ob, ctx->object, &vgroup_end_cap_remap_len); + if (start_cap_ob->type == OB_MESH && ctx->object->type == OB_MESH) { + vgroup_end_cap_remap = BKE_object_defgroup_index_map_create( + end_cap_ob, ctx->object, &vgroup_end_cap_remap_len); + } end_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(end_cap_ob, false); if (end_cap_mesh) { |