3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gltf::gltfExporter Class Reference

Class for exporting of the mesh. More...

#include <gltfExporter.h>

Public Member Functions

 gltfExporter (VoxTreeBranch *root, cMesh *inMesh, cData *toData)
 Constructor. More...
 
void SetExportUVoption (const ExportUVOption &uv_op)
 Sets the export UV options More...
 
void SetPolyMesh (PolyMesh *pm)
 Sets poly mesh object. More...
 
void SetActiveCamera (CameraShortcut *inCamera)
 Sets the active camera object. More...
 
void SetTypeFormat (const int typeFormat)
 Sets type format (GLTF_DATA_EMBEDDED, GLTF_DATA_SEPARATE, GLTF_DATA_EMBEDDED(unsupported)) More...
 
bool Export ()
 Export data. More...
 

Static Public Member Functions

static void ExportUVMaps (PolyMesh *pm, cMesh *mesh, const ExportUVOption &exOpt)
 Export UV maps to mesh. More...
 
static void ExportUVMaps (ChannelsMixer *mixer, cMesh *mesh, int uvset, const ExportUVOption &expOpt)
 Export UV maps to mesh. More...
 

Protected Member Functions

void writeAsset (gModel *gm)
 Write the asset tags More...
 
void writeCameras (gModel *gm)
 Write cameras More...
 
void writeTreeNodes (gModel *gm, cList< int > &iMeshes)
 Write nodes of the tree branches More...
 
void writeMeshes (gModel *gm, cList< int > &iMeshes)
 Write mesh objects of data More...
 
void writeMaterials (gModel *gm)
 Write object materials More...
 
void writeTextures (gModel *gm, cList< cStr > &textImages)
 Write textures More...
 
int findTexName (cList< cStr > &texImages, const cStr &srcName)
 Find texture name in the hash

Parameters
gmmodel
textImageslist (image name)
Returns
index of texture or -1
More...
 
void writeAccessorsAndBuffers (gModel *gm)
 Write accessors and buffers tags More...
 
void addBuffView (gModel *model, int id, int byteOffset, int byteLength, int stride=0, int target=0)
 Write accessors and buffers tags More...
 

Detailed Description

Class for exporting of the mesh.

Constructor & Destructor Documentation

gltf::gltfExporter::gltfExporter ( VoxTreeBranch root,
cMesh inMesh,
cData *  toData 
)

Constructor.

Parameters
rootvoxel branch
inMeshmesh surface
toDatadata to save

Member Function Documentation

void gltf::gltfExporter::addBuffView ( gModel model,
int  id,
int  byteOffset,
int  byteLength,
int  stride = 0,
int  target = 0 
)
protected

Write accessors and buffers tags

Parameters
gmmodel
idid of buffer view
byteOffsetbyte offset
byteLengthbyte length
stridestride value
targettarget value

References gltf::gModel::GetBufferViews().

Referenced by writeAccessorsAndBuffers().

bool gltf::gltfExporter::Export ( )
void gltf::gltfExporter::ExportUVMaps ( PolyMesh *  pm,
cMesh mesh,
const ExportUVOption &  exOpt 
)
static

Export UV maps to mesh.

Parameters
pmpoly mesh
meshmesh
exOptexport UV options< / param>
void gltf::gltfExporter::ExportUVMaps ( ChannelsMixer *  mixer,
cMesh mesh,
int  uvset,
const ExportUVOption &  expOpt 
)
static

Export UV maps to mesh.

Parameters
mixerChannel mixer
meshmesh
uvsetuv-set index
exOptexport UV options< / param>
int gltf::gltfExporter::findTexName ( cList< cStr > &  texImages,
const cStr &  srcName 
)
protected

Find texture name in the hash

Parameters
gmmodel
textImageslist (image name)
Returns
index of texture or -1

Referenced by writeMaterials().

void gltf::gltfExporter::SetActiveCamera ( CameraShortcut *  inCamera)
inline

Sets the active camera object.

Parameters
inCameracamera pointer

Referenced by gltf::gltfCodec::Encode().

void gltf::gltfExporter::SetExportUVoption ( const ExportUVOption &  uv_op)
inline

Sets the export UV options

Parameters
uv_opuv options
void gltf::gltfExporter::SetPolyMesh ( PolyMesh *  pm)
inline

Sets poly mesh object.

Parameters
pmPointer to the poly mesh
void gltf::gltfExporter::SetTypeFormat ( const int  typeFormat)
inline

Sets type format (GLTF_DATA_EMBEDDED, GLTF_DATA_SEPARATE, GLTF_DATA_EMBEDDED(unsupported))

Parameters
typeFormattype format value

Referenced by gltf::gltfCodec::Encode().

void gltf::gltfExporter::writeAsset ( gModel gm)
protected

Write the asset tags

Parameters
gmmodel

Referenced by Export().

void gltf::gltfExporter::writeCameras ( gModel gm)
protected
void gltf::gltfExporter::writeMaterials ( gModel gm)
protected
void gltf::gltfExporter::writeMeshes ( gModel gm,
cList< int > &  iMeshes 
)
protected

Write mesh objects of data

Parameters
gmmodel
iMeshesList the presence of meshes for i-th object

References gltf::gPrimitive::Attributes(), gltf::gModel::GetMeshes(), comms::cMeshContainer::GetNormals(), gltf::gMesh::GetPrimitives(), gltf::gPrimitive::SetIndices(), gltf::gPrimitive::SetMaterial(), and gltf::gPrimitive::SetMode().

Referenced by Export().

void gltf::gltfExporter::writeTextures ( gModel gm,
cList< cStr > &  textImages 
)
protected

Write textures

Parameters
gmmodel
textImageshash (image name)

References gltf::gImage::CopyImageFromFile(), gltf::gModel::GetImages(), gltf::gModel::GetSamplers(), gltf::gModel::GetTextures(), and gltf::gImage::Url().

Referenced by writeMaterials().

void gltf::gltfExporter::writeTreeNodes ( gModel gm,
cList< int > &  iMeshes 
)
protected

Write nodes of the tree branches

Parameters
gmmodel
iMeshesList the presence of meshes for i-th object

References gltf::gModel::GetNodes(), and gltf::gModel::GetScenes().

Referenced by Export().


The documentation for this class was generated from the following files: