Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-03-04 17:27:10 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-03-04 22:20:05 +0300
commit1668f883fbe555bebf992bc77fd1c78203b23b14 (patch)
tree8b331cdd7c0a5bed2e137718145f2cf0ed184155 /source/blender/modifiers
parent63b7ff9f4e5f5b0ff5d6bdb726fcd4e1d118e141 (diff)
Fix T59376: UV project modifier not working after modifiers that dont provide a UVMap
This was reported for remesh and skin modifiers. These dont preserve UV layers (and probably cannot in a reasonable way), so instead let the UV Project modifier create a new (equally named) UV layer (as was suggested by @brecht in T59376). Maniphest Tasks: T59376 Differential Revision: https://developer.blender.org/D10617
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 8122f4617c1..2d4618b15df 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -135,10 +135,11 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
return mesh;
}
- /* make sure there are UV Maps available */
-
+ /* Create a new layer if no UV Maps are available (e.g. if a preceeding modifier could not
+ * preserve it). */
if (!CustomData_has_layer(&mesh->ldata, CD_MLOOPUV)) {
- return mesh;
+ CustomData_add_layer_named(
+ &mesh->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, mesh->totloop, umd->uvlayer_name);
}
/* make sure we're using an existing layer */