Former-commit-id: 564346995cfbd8df95a2e15050937b01e4f0405a
@@ -363,7 +363,9 @@ namespace viewer
Eigen::Vector3d(255.0/255.0,228.0/255.0,58.0/255.0),
Eigen::Vector3d(255.0/255.0,235.0/255.0,80.0/255.0));
if (data.V_uv.rows() == 0)
+ {
data.grid_texture();
+ }
core.align_camera_center(data.V,data.F);
@@ -393,6 +393,12 @@ IGL_INLINE void igl::viewer::ViewerData::uniform_colors(Eigen::Vector3d ambient,
IGL_INLINE void igl::viewer::ViewerData::grid_texture()
{
+ // Don't do anything for an empty mesh
+ if(V.rows() == 0)
+ V_uv.resize(V.rows(),2);
+ return;
if (V_uv.rows() == 0)
V_uv = V.block(0, 0, V.rows(), 2);