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.
|
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
| |||||
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... | |||||
Class for exporting of the mesh.
gltf::gltfExporter::gltfExporter | ( | VoxTreeBranch * | root, |
cMesh * | inMesh, | ||
cData * | toData | ||
) |
Constructor.
root | voxel branch |
inMesh | mesh surface |
toData | data to save |
|
protected |
Write accessors and buffers tags
gm | model |
id | id of buffer view |
byteOffset | byte offset |
byteLength | byte length |
stride | stride value |
target | target value |
References gltf::gModel::GetBufferViews().
Referenced by writeAccessorsAndBuffers().
bool gltf::gltfExporter::Export | ( | ) |
Export data.
References gltf::gModel::SetTypeFormat(), gltf::gModel::toJson(), VolumeObject::ToRawMesh(), writeAccessorsAndBuffers(), writeAsset(), writeCameras(), writeMaterials(), writeMeshes(), and writeTreeNodes().
Referenced by gltf::gltfCodec::Encode().
|
static |
Export UV maps to mesh.
pm | poly mesh |
mesh | mesh |
exOpt | export UV options< / param> |
|
static |
Export UV maps to mesh.
mixer | Channel mixer |
mesh | mesh |
uvset | uv-set index |
exOpt | export UV options< / param> |
|
protected |
Find texture name in the hash
gm | model |
textImages | list (image name) |
Referenced by writeMaterials().
|
inline |
Sets the active camera object.
inCamera | camera pointer |
Referenced by gltf::gltfCodec::Encode().
|
inline |
Sets the export UV options
uv_op | uv options |
|
inline |
Sets poly mesh object.
pm | Pointer to the poly mesh |
|
inline |
Sets type format (GLTF_DATA_EMBEDDED, GLTF_DATA_SEPARATE, GLTF_DATA_EMBEDDED(unsupported))
typeFormat | type format value |
Referenced by gltf::gltfCodec::Encode().
|
protected |
Write accessors and buffers tags
gm |
model |
References addBuffView(), gltf::gPrimitive::Attributes(), gltf::gModel::GetAccessors(), gltf::gModel::GetBuffers(), gltf::gModel::GetBufferViews(), gltf::gModel::GetMeshes(), comms::cMeshContainer::GetNormals(), gltf::gAccessor::SetBufferView(), gltf::gAccessor::SetComponentCount(), gltf::gAccessor::SetComponentType(), and gltf::gAccessor::SetTypeId().
Referenced by Export().
|
protected |
|
protected |
Write cameras
gm | model |
References gltf::gModel::GetCameras(), gltf::gCamera::SetOrthographicCamera(), and gltf::gCamera::SetPerspectiveCamera().
Referenced by Export().
|
protected |
Write object materials
gm | model |
References findTexName(), gltf::gModel::GetMaterials(), gltf::SpecularGlossiness::solve_metallic(), gltf::SpecularGlossiness::solve_roughness(), and writeTextures().
Referenced by Export().
Write mesh objects of data
gm | model |
iMeshes | List 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().
Write textures
gm | model |
textImages | hash (image name) |
References gltf::gImage::CopyImageFromFile(), gltf::gModel::GetImages(), gltf::gModel::GetSamplers(), gltf::gModel::GetTextures(), and gltf::gImage::Url().
Referenced by writeMaterials().
Write nodes of the tree branches
gm | model |
iMeshes | List the presence of meshes for i-th object |
References gltf::gModel::GetNodes(), and gltf::gModel::GetScenes().
Referenced by Export().