Blender
V3.3
|
#include <GeometryExporter.h>
Public Member Functions | |
GeometryExporter (BlenderContext &blender_context, COLLADASW::StreamWriter *sw, BCExportSettings &export_settings) | |
void | exportGeom () |
void | operator() (Object *ob) |
void | createLooseEdgeList (Object *ob, Mesh *me, std::string &geom_id) |
void | create_mesh_primitive_list (short material_index, bool has_uvs, bool has_color, Object *ob, Mesh *me, std::string &geom_id, std::vector< BCPolygonNormalsIndices > &norind) |
void | createVertsSource (std::string geom_id, Mesh *me) |
void | createVertexColorSource (std::string geom_id, Mesh *me) |
std::string | makeTexcoordSourceId (std::string &geom_id, int layer_index, bool is_single_layer) |
void | createTexcoordsSource (std::string geom_id, Mesh *me) |
void | createNormalsSource (std::string geom_id, Mesh *me, std::vector< Normal > &nor) |
void | create_normals (std::vector< Normal > &nor, std::vector< BCPolygonNormalsIndices > &polygons_normals, Mesh *me) |
std::string | getIdBySemantics (std::string geom_id, COLLADASW::InputSemantic::Semantics type, std::string other_suffix="") |
std::string | makeVertexColorSourceId (std::string &geom_id, char *layer_name) |
COLLADASW::URI | getUrlBySemantics (std::string geom_id, COLLADASW::InputSemantic::Semantics type, std::string other_suffix="") |
COLLADASW::URI | makeUrl (std::string id) |
void | export_key_mesh (Object *ob, Mesh *me, KeyBlock *kb) |
Definition at line 39 of file GeometryExporter.h.
|
inline |
Definition at line 46 of file GeometryExporter.h.
void GeometryExporter::create_mesh_primitive_list | ( | short | material_index, |
bool | has_uvs, | ||
bool | has_color, | ||
Object * | ob, | ||
Mesh * | me, | ||
std::string & | geom_id, | ||
std::vector< BCPolygonNormalsIndices > & | norind | ||
) |
Powerful because it handles both cases when there is material and when there's not.
Definition at line 313 of file GeometryExporter.cpp.
References Freestyle::a, bc_CustomData_get_layer_name(), BKE_object_material_get(), CD_MLOOPUV, CD_PROP_BYTE_COLOR, collect_vertex_counts_per_poly(), create_primitive_list(), CustomData_get_active_layer_index(), CustomData_get_layer_index_n(), CustomData_number_of_layers(), finish_and_delete_primitive_List(), get_material_id(), getUrlBySemantics(), id_name(), l, Mesh::ldata, MPoly::loopstart, makeTexcoordSourceId(), makeUrl(), makeVertexColorSourceId(), MPoly::mat_nr, Mesh::mloop, Mesh::mpoly, NORMAL, prepareToAppendValues(), Object::totcol, MPoly::totloop, Mesh::totpoly, translate_id(), and v.
Referenced by export_key_mesh(), and operator()().
void GeometryExporter::create_normals | ( | std::vector< Normal > & | nor, |
std::vector< BCPolygonNormalsIndices > & | polygons_normals, | ||
Mesh * | me | ||
) |
Definition at line 613 of file GeometryExporter.cpp.
References BCPolygonNormalsIndices::add_index(), BKE_mesh_calc_normals_split(), BKE_mesh_calc_poly_normal(), BKE_mesh_vertex_normals_ensure(), CD_NORMAL, copy_v3_v3(), CustomData_get_layer(), CustomData_has_layer(), MPoly::flag, float(), Mesh::ldata, MPoly::loopstart, ME_SMOOTH, Mesh::mloop, Mesh::mpoly, Mesh::mvert, normalize_v3(), normalize_v3_v3(), normalized(), normals, MPoly::totloop, Mesh::totpoly, v, and verts.
Referenced by export_key_mesh(), and operator()().
Definition at line 197 of file GeometryExporter.cpp.
References getUrlBySemantics(), ME_LOOSEEDGE, Mesh::medge, and Mesh::totedge.
Referenced by operator()().
void GeometryExporter::createNormalsSource | ( | std::string | geom_id, |
Mesh * | me, | ||
std::vector< Normal > & | nor | ||
) |
Creates <source> for normals.
Definition at line 580 of file GeometryExporter.cpp.
References bc_add_global_transform(), getIdBySemantics(), nor, NORMAL, verts, Normal::x, Normal::y, and Normal::z.
Referenced by export_key_mesh(), and operator()().
Creates <source> for texcoords.
Definition at line 530 of file GeometryExporter.cpp.
References Freestyle::a, CD_MLOOPUV, CustomData_get_active_layer_index(), CustomData_get_layer_index_n(), CustomData_get_layer_n(), CustomData_number_of_layers(), Mesh::ldata, MPoly::loopstart, makeTexcoordSourceId(), Mesh::mpoly, Mesh::totloop, MPoly::totloop, and Mesh::totpoly.
Referenced by export_key_mesh(), and operator()().
Definition at line 468 of file GeometryExporter.cpp.
References Freestyle::a, MLoopCol::a, MLoopCol::b, bc_CustomData_get_layer_name(), CD_PROP_BYTE_COLOR, CustomData_get_layer_n(), CustomData_number_of_layers(), MLoopCol::g, Mesh::ldata, MPoly::loopstart, makeVertexColorSourceId(), Mesh::mpoly, MLoopCol::r, Mesh::totloop, and MPoly::totloop.
Referenced by export_key_mesh(), and operator()().
Creates <source> for positions.
Definition at line 429 of file GeometryExporter.cpp.
References bc_add_global_transform(), copy_v3_v3(), getIdBySemantics(), Mesh::mvert, Mesh::totvert, and verts.
Referenced by export_key_mesh(), and operator()().
Definition at line 132 of file GeometryExporter.cpp.
References Freestyle::a, bool, CD_MCOL, CD_MLOOPUV, create_mesh_primitive_list(), create_normals(), createNormalsSource(), createTexcoordsSource(), createVertexColorSource(), createVertsSource(), CustomData_has_layer(), Mesh::fdata, get_geometry_id(), getIdBySemantics(), getUrlBySemantics(), input, Mesh::ldata, KeyBlock::name, nor, Object::totcol, translate_id(), and verts.
Referenced by operator()().
void GeometryExporter::exportGeom | ( | ) |
Definition at line 29 of file GeometryExporter.cpp.
Referenced by DocumentExporter::exportCurrentScene().
std::string GeometryExporter::getIdBySemantics | ( | std::string | geom_id, |
COLLADASW::InputSemantic::Semantics | type, | ||
std::string | other_suffix = "" |
||
) |
Definition at line 681 of file GeometryExporter.cpp.
References type.
Referenced by createNormalsSource(), createVertsSource(), export_key_mesh(), getUrlBySemantics(), makeTexcoordSourceId(), makeVertexColorSourceId(), and operator()().
COLLADASW::URI GeometryExporter::getUrlBySemantics | ( | std::string | geom_id, |
COLLADASW::InputSemantic::Semantics | type, | ||
std::string | other_suffix = "" |
||
) |
Definition at line 688 of file GeometryExporter.cpp.
References EMPTY_STRING, getIdBySemantics(), id, and type.
Referenced by create_mesh_primitive_list(), createLooseEdgeList(), export_key_mesh(), and operator()().
std::string GeometryExporter::makeTexcoordSourceId | ( | std::string & | geom_id, |
int | layer_index, | ||
bool | is_single_layer | ||
) |
Definition at line 516 of file GeometryExporter.cpp.
References getIdBySemantics().
Referenced by create_mesh_primitive_list(), and createTexcoordsSource().
COLLADASW::URI GeometryExporter::makeUrl | ( | std::string | id | ) |
Definition at line 697 of file GeometryExporter.cpp.
References EMPTY_STRING.
Referenced by create_mesh_primitive_list().
std::string GeometryExporter::makeVertexColorSourceId | ( | std::string & | geom_id, |
char * | layer_name | ||
) |
Definition at line 306 of file GeometryExporter.cpp.
References getIdBySemantics(), and result.
Referenced by create_mesh_primitive_list(), and createVertexColorSource().
Definition at line 41 of file GeometryExporter.cpp.
References Freestyle::a, bc_get_mesh_copy(), BKE_id_free(), BKE_key_from_object(), BKE_keyblock_convert_to_mesh(), Key::block, bool, CD_MCOL, CD_MLOOPUV, create_mesh_primitive_list(), create_normals(), createLooseEdgeList(), createNormalsSource(), createTexcoordsSource(), createVertexColorSource(), createVertsSource(), CustomData_has_layer(), Object::data, encode_xml(), export_key_mesh(), Mesh::fdata, ListBase::first, get_geometry_id(), getIdBySemantics(), getUrlBySemantics(), id_name(), input, Mesh::ldata, Mesh::mvert, KeyBlock::next, nor, Object::totcol, Mesh::totface, Mesh::totvert, and verts.