Flower Text File Schema
This document describes the file structure and allowed properties of the Flower file format for Flour.
Each file is text based and can be edited by a normal text editor. Encoding is a non-issue as each command and property uses characters from the lower half of the standard ASCII character set. A flower file has the file extension
Comments may take up an entire line or be placed within a line. A comment is prefixed with the
# character. Once the
# character is read, the rest of the line is ignored. Line and inline comments may use unicode.
Numbers and Number Lists
A number can be an integer or real, and be like the following;
A list of numbers is seperated by a comma
, character, whitespace is ignored.
A string value may take up the entire line. The first character of the string is the first character in the value is not whitespace. The string is terminated by the last non-whitespace character in the line.
property I am a string. property I am a string.
A flag is a PhysX mesh flag to change the mesh properties or the options of the cooker. Flags are strings prefixed with a
List of Flags;
|Flag name||NxOgre Flag||Description|
||MeshConstructionsFlags_FlipNormals||Flip the normals|
||MeshConstructionsFlags_16bitIndices||Use smaller 16bit indices|
||MeshConstructionsFlags_HardwareMesh||Simulate the mesh on hardware|
||None.||Welds vertices of cloth within distance from each other.|
A property is a line that has a property name, some whitespace (tabs or spaces) then the value.
A property value may not be spanned across many lines. But some properties can be spread across many lines.
property_name property_value property_name property_value2
The behavior of multiple properties is so;
- If the property accepts a range of numbers then any additional values are appended.
- If the property accepts a single value, then the new value replaces the previous one.
Depending on the mesh some properties may be ommitted.
- Vertices; Triangle, Convex, Cloth and SoftBodies
- Indexes; Triangle, Convex (Optional), Cloth and SoftBodies
- Normals; Cloth and SoftBodies
- Texture Coordinates; Cloth (Optional) and SoftBodies (Optional)
- Index Materials; Triangle (Optional)
- Vertex Flags; Cloth (Optional) and SoftBodies (Optional)
- Vertex Masses; Cloth (Optional) and SoftBodies (Optional)
List of Properties
|Property Name||Property Description||Property type||Restriction|
|type||Type of mesh||String||‘convex’, ‘triangle’, ‘cloth’, ‘softbody’ or ‘skeleton’|
|vertices||Vertices||Real list||list count must be divisible by 3|
|indices or indexes||Indices||Integer list||list count must be divisible by 3|
|normals||Vertex Normals||Real list||list count must be vertices size|
|texturecoords||Texture coordinates||Real list||list count must be vertices size|
|materials||Material indexes||Integer list||list count must be vertices size|
|vertexflags||Vertex flags||Integer list||list count must be vertices size|
|vertexmasses||Vertex masses||Real list||list count must be vertices size|
|weldingdistance||Welding distance for cloth/softbodies||Real||Used with the weld vertices flag|
Example “cube.flower” file
# Cube type convex vertices -100.0,100.0,-100.0 #0 vertices 100.0,100.0,-100.0 #1 vertices 100.0,-100.0,-100.0 #2 vertices -100.0,-100.0,-100.0 #3 vertices -100.0,100.0,100.0 #4 vertices 100.0,100.0,100.0 #5 vertices 100.0,-100.0,100.0 #6 vertices -100.0,-100.0,100.0 #7
indexes 0,2,3, 0,1,2, 1,6,2, 1,5,6, 4,6,5, 4,7,6, 0,7,4, 0,3,7, 0,5,1, 0,4,5, 2,7,3, 2,6,7
Future extensions to the flower file format may be the following;
- Support for multiple meshes
Version: 0.25, Last modified; 03-June-2010, Authors: Robin Southern