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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-05-22 11:06:48 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-05-22 11:06:48 +0400
commitacd468f2b313ae576d2a4a06d26f19aad19f716c (patch)
treec651d162145e80781e44204c80fff1ac078f91b3 /source
parent72f38b4f097120e6d4c5b3b0c9aceda7d1782583 (diff)
Fix #31500: Displacement Baking from Multires doesn't work
Issue was caused by wrong calculation of grid coordinates when switching from low resolution mesh to high resolution mesh. Somehow was affected only for face U or V equals to 1.0f. Checked fix using all test files used during initial implementation of multires baker and tested sample file from bug/ Seems everything is OK.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_bake.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index b89562e772b..810fe244984 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -534,7 +534,7 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
int grid_index = origindex[face_index];
int loc_offs = face_index % (1 << (2 * lvl));
int cell_index = loc_offs % ((side - 1) * (side - 1));
- int cell_side = grid_size / (side - 1);
+ int cell_side = (grid_size - 1) / (side - 1);
int row = cell_index / (side - 1);
int col = cell_index % (side - 1);