PlyImporter icon indicating copy to clipboard operation
PlyImporter copied to clipboard

Various issues

Open DCxDemo opened this issue 3 years ago • 0 comments

As I tried this snippet, I found out the format support is very limited, as well as various bugs are present in the code. If it's still supported, here's the small list of issues I found:

  1. Empty file without the data crashes the code (i.e. blender's empty scene PLY export).
  2. Various exporters use vertex_indices line even if they export in ascii mode. Only vertex_index is hardcoded to the switch though, meaning that perfectly fine ascii models that can be parsed will fail to do so, unless added extra cases. Correct way to implement this would be to actually parse this property line.
case "property list uchar int vertex_index":
case "property list uchar int vertex_indices":
case "property list uchar uint vertex_indices":
  1. Wrong indexing in this line of code, requires -1 on both params to work properly. Didn't check the exact reason why, but other combinations crashed the code.
List<string> lines = plyFile.GetRange(faceStartIndex-1, header.FaceCount-1);
  1. Tristrips are only supported for quads. Users are forced to manually triangulate the model, if they want it to work with this code.

DCxDemo avatar Mar 06 '21 14:03 DCxDemo