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:
authorMartijn Versteegh <Baardaap>2022-04-08 18:43:44 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-04-10 17:31:11 +0300
commit811371a6bddd5c3d7ea33fa8a5ccb7d3d36baf43 (patch)
tree152b110f2f9aa82331a611590f97e9835fe413ea /source/blender/editors/object/object_bake.c
parent1db3e26c743a1c914b6db985ee11073248d0baf9 (diff)
Fix T96942: disable Adjacent Faces margin for UVs and tangent space bake
Use the Extend method for these, as these do not work correctly. For UVs it's better to extend the UVs from the same face, and for tangent space the normals should be encoded in a matching tangent space. Later the Adjacent Faces method might be improved to support these cases. Ref T96977 Differential Revision: https://developer.blender.org/D14572
Diffstat (limited to 'source/blender/editors/object/object_bake.c')
-rw-r--r--source/blender/editors/object/object_bake.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index d93edd2776b..d469efbd0a1 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -359,7 +359,12 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
/* copy data stored in job descriptor */
bkr.scene = scene;
bkr.bake_margin = scene->r.bake_margin;
- bkr.bake_margin_type = scene->r.bake_margin_type;
+ if (scene->r.bake_mode == RE_BAKE_NORMALS) {
+ bkr.bake_margin_type = R_BAKE_EXTEND;
+ }
+ else {
+ bkr.bake_margin_type = scene->r.bake_margin_type;
+ }
bkr.mode = scene->r.bake_mode;
bkr.use_lores_mesh = scene->r.bake_flag & R_BAKE_LORES_MESH;
bkr.bias = scene->r.bake_biasdist;
@@ -404,7 +409,12 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj)
/* backup scene settings, so their changing in UI would take no effect on baker */
bkj->scene = scene;
bkj->bake_margin = scene->r.bake_margin;
- bkj->bake_margin_type = scene->r.bake_margin_type;
+ if (scene->r.bake_mode == RE_BAKE_NORMALS) {
+ bkj->bake_margin_type = R_BAKE_EXTEND;
+ }
+ else {
+ bkj->bake_margin_type = scene->r.bake_margin_type;
+ }
bkj->mode = scene->r.bake_mode;
bkj->use_lores_mesh = scene->r.bake_flag & R_BAKE_LORES_MESH;
bkj->bake_clear = scene->r.bake_flag & R_BAKE_CLEAR;