4.4 - Ply Data Format

Another cross-platform file format that is useful for transferring data between modelers is the Stanford’s PLY file format. This format is needed if you want to associate a different color with specific vertices of a face. (The OBJ file format only allows you to assign a material property (color) to a complete face (or triangle), not individual vertices.

Exporting PLY Data from Blender

As previously stated, always save your models in the native Blender format which uses a .blend file extension. This guarantees that all attributes of your models can be retrieved if you open and edit the models at a later time.

Note: Exporting complex geometry to a PLY data file typically fails with errors in Blender 2.76. Only use PLY files for simple models.

A PLY file contains a single model. If you have multiple models in a Blender scene, you will have to save them one model at a time.

If you want to export model data to a PLY data format, do the following:

  1. Select the File menu, Export command, and the Stanford (.ply) sub-command.

  2. Enter an appropriate file name. Don’t include any spaces in your name and use all lower cases letters. The filename will be used to name the model. The contents of a PLY file does not contain a model name.

  3. In the lower left corner there is a set of options for the export. Set the options as follows:

    • Apply Modifiers: OFF
    • UV's: OFF (unless you defined a texture map, which we will cover later.)
    • Normals: OFF (To make the file as small as possible.)
    • Vertex Colors: ON (to specify a different color for each vertex.)
    • Forward:: -Z Forward (to rotate to a WebGL orientation)
    • Up:: Y Up (to rotate to a WebGL orientation)

    An example of the export settings can be seen in the following image:

    ../_images/ply_export_options.png
  4. Select the “Export PLY” button in the upper right corner.

Example PLY Data File

A PLY file contains three sections:

  • A header which describes the format of the data.
  • A vertex list section that contains the vertex data.
  • A face list section that contains the face data.

The example PLY file below describes a simple cube. This example contains no color information. The header is highlighted.

ply
format ascii 1.0
comment Created by Blender 2.76 (sub 0) - www.blender.org, source file: ''
element vertex 8
property float x
property float y
property float z
element face 6
property list uchar uint vertex_indices
end_header
1.000000 1.000000 -1.000000
1.000000 -1.000000 -1.000000
-1.000000 -1.000000 -1.000000
-1.000000 1.000000 -1.000000
1.000000 0.999999 1.000000
-1.000000 1.000000 1.000000
-1.000000 -1.000000 1.000000
0.999999 -1.000001 1.000000
4 0 1 2 3
4 4 5 6 7
4 0 4 7 1
4 1 7 6 2
4 2 6 5 3
4 4 0 3 5

File Format Details

All of the details for an PLY file are beyond the scope of these tutorials. If you are interested in more details, http://paulbourke.net/dataformats/ply/ is an excellent reference.

Glossary

PLY file format
A cross-platform, text or binary based file format for the exchange of geometry modeling data.