public class MeshHelper extends AbstractBlenderHelper
| Modifier and Type | Field and Description |
|---|---|
static int |
UV_DATA_LAYER_TYPE_BMESH
A type of UV data layer in bmesh type.
|
static int |
UV_DATA_LAYER_TYPE_FMESH
A type of UV data layer in traditional faced mesh (triangles or quads).
|
blenderContext, blenderVersion, fixUpAxis, upAxisRotationQuaternion| Constructor and Description |
|---|
MeshHelper(java.lang.String blenderVersion,
BlenderContext blenderContext)
This constructor parses the given blender version and stores the result.
|
| Modifier and Type | Method and Description |
|---|---|
Material |
getBlackUnshadedMaterial(BlenderContext blenderContext)
Returns the black unshaded material.
|
boolean |
isBMeshCompatible(Structure meshStructure)
Tells if the given mesh structure supports BMesh.
|
java.util.LinkedHashMap<java.lang.String,java.util.List<Vector2f>> |
loadUVCoordinates(Structure meshStructure)
The method loads the UV coordinates.
|
void |
loadVerticesAndNormals(Structure meshStructure,
java.util.List<Vector3f> vertices,
java.util.List<Vector3f> normals)
This method returns the vertices: a list of vertex positions and a list
of vertex normals.
|
java.util.List<byte[]> |
loadVerticesColors(Structure meshStructure,
BlenderContext blenderContext)
This method returns the vertices colors.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Float>> |
loadVerticesGroups(Structure meshStructure)
Loads all vertices groups.
|
java.util.Map<java.lang.String,java.util.List<Vector2f>> |
selectUVSubset(Face face,
java.lang.Integer... indexesSublist)
Selects the proper subsets of UV coordinates for the given sublist of indexes.
|
java.util.List<byte[]> |
selectVertexColorSubset(Face face,
java.lang.Integer... indexesSublist)
Selects the proper subsets of vertex colors for the given sublist of indexes.
|
TemporalMesh |
toTemporalMesh(Structure meshStructure,
BlenderContext blenderContext)
Converts the mesh structure into temporal mesh.
|
applyProperties, loadLibrary, loadPropertiespublic static final int UV_DATA_LAYER_TYPE_FMESH
public static final int UV_DATA_LAYER_TYPE_BMESH
public MeshHelper(java.lang.String blenderVersion,
BlenderContext blenderContext)
blenderVersion - the version read from the blend fileblenderContext - the blender contextpublic TemporalMesh toTemporalMesh(Structure meshStructure, BlenderContext blenderContext) throws BlenderFileException
meshStructure - the mesh structureblenderContext - the blender contextBlenderFileException - an exception is thrown when problems with reading blend file occurpublic boolean isBMeshCompatible(Structure meshStructure)
meshStructure - the mesh structurepublic void loadVerticesAndNormals(Structure meshStructure, java.util.List<Vector3f> vertices, java.util.List<Vector3f> normals) throws BlenderFileException
meshStructure - the structure containing the mesh dataBlenderFileException - this exception is thrown when the blend file structure is somehow invalid or corruptedpublic java.util.List<byte[]> loadVerticesColors(Structure meshStructure, BlenderContext blenderContext) throws BlenderFileException
meshStructure - the structure containing the mesh datablenderContext - the blender contextBlenderFileException - this exception is thrown when the blend file structure is somehow invalid or corruptedpublic java.util.LinkedHashMap<java.lang.String,java.util.List<Vector2f>> loadUVCoordinates(Structure meshStructure) throws BlenderFileException
meshStructure - the mesh structureBlenderFileException - an exception is thrown when problems with blend file occurpublic java.util.List<java.util.Map<java.lang.String,java.lang.Float>> loadVerticesGroups(Structure meshStructure) throws BlenderFileException
meshStructure - the mesh structureBlenderFileException - an exception is thrown when problems with blend file occurpublic java.util.Map<java.lang.String,java.util.List<Vector2f>> selectUVSubset(Face face, java.lang.Integer... indexesSublist)
face - the face with the original UV setsindexesSublist - the sub list of indexespublic java.util.List<byte[]> selectVertexColorSubset(Face face, java.lang.Integer... indexesSublist)
face - the face with the original vertex colorsindexesSublist - the sub list of indexespublic Material getBlackUnshadedMaterial(BlenderContext blenderContext)
blenderContext - the blender context