From dbdd79fabe2934de6184c0230f91b2e8af716a7b Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 5 Mar 2019 21:34:48 +0100 Subject: UV/VCol layers creation: add option to not init those new data. `ED_mesh_uv_texture_add()`/`ED_mesh_color_add()` would always either copy data from current active one, or (for UVs), generate default 'valid' UVs for every face. This commit adds an option to not do that, just keeping default values from raw CDLayer creation. It is only used/exposed from RNA API currently. This is especially useful for importer add-ons, since some formats support multiple layers of those kind, as well as 'partial' dataset not explicitely defining values for all mesh items. Preliminary step to fix T62224. --- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/uvedit/uvedit_unwrap_ops.c') diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 1dc681e8ec1..19925c2fcd7 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -111,7 +111,7 @@ static bool ED_uvedit_ensure_uvs(bContext *C, Scene *UNUSED(scene), Object *obed return 1; if (em && em->bm->totface && !CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV)) - ED_mesh_uv_texture_add(obedit->data, NULL, true); + ED_mesh_uv_texture_add(obedit->data, NULL, true, true); if (!ED_uvedit_test(obedit)) return 0; -- cgit v1.2.3