Skip to content

Commit

Permalink
Pass along texture_triangle_indices to sample_to_mesh in all Morphabl…
Browse files Browse the repository at this point in the history
…eModel member functions

Previously, get_mean and the draw_sample functions (except for the one that takes shape, colour and expression coefficients) would have returned a mesh without the texture triangle indices (if the MorphableModel contained them).
This might actually have been causing wrong code to be run or some bad memory access to happen in Release and RelWithDebInfo builds, because the assert that checks for that in sample_to_mesh(...) wouldn't have been triggered.
  • Loading branch information
patrikhuber committed Jan 29, 2019
1 parent 21fbc62 commit e598203
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions include/eos/morphablemodel/MorphableModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ class MorphableModel
core::Mesh mesh;
if (has_texture_coordinates())
{
mesh = sample_to_mesh(shape, color, shape_model.get_triangle_list(),
color_model.get_triangle_list(), texture_coordinates);
mesh =
sample_to_mesh(shape, color, shape_model.get_triangle_list(), color_model.get_triangle_list(),
texture_coordinates, texture_triangle_indices);
} else
{
mesh = sample_to_mesh(shape, color, shape_model.get_triangle_list(),
Expand Down Expand Up @@ -214,7 +215,8 @@ class MorphableModel
if (has_texture_coordinates())
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
color_model.get_triangle_list(), texture_coordinates);
color_model.get_triangle_list(), texture_coordinates,
texture_triangle_indices);
} else
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
Expand Down Expand Up @@ -265,7 +267,8 @@ class MorphableModel
if (has_texture_coordinates())
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
color_model.get_triangle_list(), texture_coordinates);
color_model.get_triangle_list(), texture_coordinates,
texture_triangle_indices);
} else
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
Expand Down Expand Up @@ -353,7 +356,8 @@ class MorphableModel
if (has_texture_coordinates())
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
color_model.get_triangle_list(), texture_coordinates);
color_model.get_triangle_list(), texture_coordinates,
texture_triangle_indices);
} else
{
mesh = sample_to_mesh(shape_sample, color_sample, shape_model.get_triangle_list(),
Expand Down

0 comments on commit e598203

Please sign in to comment.