11 #include "COLLADABUPlatform.h"
13 #include "COLLADAFWMeshPrimitive.h"
14 #include "COLLADAFWMeshVertexData.h"
15 #include "COLLADAFWPolygons.h"
39 return node->getName().empty() ?
node->getOriginalId() :
node->getName();
45 case COLLADAFW::MeshPrimitive::LINES:
47 case COLLADAFW::MeshPrimitive::LINE_STRIPS:
49 case COLLADAFW::MeshPrimitive::POLYGONS:
51 case COLLADAFW::MeshPrimitive::POLYLIST:
53 case COLLADAFW::MeshPrimitive::TRIANGLES:
55 case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
56 return "TRIANGLE_FANS";
57 case COLLADAFW::MeshPrimitive::TRIANGLE_STRIPS:
58 return "TRIANGLE_STRIPS";
59 case COLLADAFW::MeshPrimitive::POINTS:
61 case COLLADAFW::MeshPrimitive::UNDEFINED_PRIMITIVE_TYPE:
62 return "UNDEFINED_PRIMITIVE_TYPE";
70 case COLLADAFW::Geometry::GEO_TYPE_MESH:
72 case COLLADAFW::Geometry::GEO_TYPE_SPLINE:
74 case COLLADAFW::Geometry::GEO_TYPE_CONVEX_MESH:
76 case COLLADAFW::Geometry::GEO_TYPE_UNKNOWN:
87 void WVDataWrapper::print()
89 fprintf(stderr,
"UVs:\n");
90 switch (mVData->getType()) {
91 case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
92 COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
93 if (values->getCount()) {
94 for (
int i = 0; i < values->getCount(); i += 2) {
95 fprintf(stderr,
"%.1f, %.1f\n", (*values)[i], (*values)[i + 1]);
99 case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
100 COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
101 if (values->getCount()) {
102 for (
int i = 0; i < values->getCount(); i += 2) {
103 fprintf(stderr,
"%.1f, %.1f\n", (
float)(*values)[i], (
float)(*values)[i + 1]);
108 fprintf(stderr,
"\n");
114 int stride = mVData->getStride(0);
119 switch (mVData->getType()) {
120 case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
121 COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
122 if (values->empty()) {
125 uv[0] = (*values)[uv_index *
stride];
126 uv[1] = (*values)[uv_index *
stride + 1];
129 case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
130 COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
131 if (values->empty()) {
138 case COLLADAFW::MeshVertexData::DATA_TYPE_UNKNOWN:
140 fprintf(stderr,
"MeshImporter.getUV(): unknown data type\n");
151 if (values->empty() || values->getCount() < (v_index + 1) *
stride) {
153 "VCOLDataWrapper.getvcol(): Out of Bounds error: index %d points outside value "
154 "list of length %zd (with stride=%d) \n",
171 int stride = mVData->getStride(0);
176 switch (mVData->getType()) {
177 case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
178 COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
179 colladaAddColor<COLLADAFW::ArrayPrimitiveType<float> *>(values, mloopcol, v_index,
stride);
182 case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
183 COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
184 colladaAddColor<COLLADAFW::ArrayPrimitiveType<double> *>(values, mloopcol, v_index,
stride);
188 fprintf(stderr,
"VCOLDataWrapper.getvcol(): unknown data type\n");
194 : unitconverter(unitconv),
197 view_layer(view_layer),
198 armature_importer(arm)
203 bool MeshImporter::set_poly_indices(
204 MPoly *mpoly,
MLoop *mloop,
int loop_index,
const unsigned int *
indices,
int loop_count)
208 bool broken_loop =
false;
209 for (
int index = 0; index < loop_count; index++) {
213 for (
int i = 0; i < index; i++) {
227 void MeshImporter::set_vcol(
MLoopCol *mloopcol,
230 COLLADAFW::IndexList &index_list,
234 for (index = 0; index <
count; index++, mloopcol++) {
235 int v_index = index_list.getIndex(index + loop_index);
240 void MeshImporter::set_face_uv(
MLoopUV *mloopuv,
243 COLLADAFW::IndexList &index_list,
247 COLLADAFW::UIntValuesArray &
indices = index_list.getIndices();
249 for (
int index = 0; index <
count; index++) {
250 int uv_index =
indices[index + start_index];
251 uvs.
getUV(uv_index, mloopuv[index].uv);
256 void MeshImporter::print_index_list(COLLADAFW::IndexList &index_list)
258 fprintf(stderr,
"Index list for \"%s\":\n", index_list.getName().c_str());
259 for (
int i = 0; i < index_list.getIndicesCount(); i += 2) {
260 fprintf(stderr,
"%u, %u\n", index_list.getIndex(i), index_list.getIndex(i + 1));
262 fprintf(stderr,
"\n");
268 COLLADAFW::MeshPrimitiveArray &prim_arr =
mesh->getMeshPrimitives();
272 for (
unsigned int i = 0; i < prim_arr.getCount(); i++) {
274 COLLADAFW::MeshPrimitive *mp = prim_arr[i];
280 if (
type == COLLADAFW::MeshPrimitive::POLYLIST ||
type == COLLADAFW::MeshPrimitive::POLYGONS) {
282 COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
283 COLLADAFW::Polygons::VertexCountArray &vca = mpvc->getGroupedVerticesVertexCountArray();
286 int nonface_count = 0;
288 for (
unsigned int j = 0; j < vca.getCount(); j++) {
299 if (hole_count > 0) {
301 "WARNING: Primitive %s in %s: %d holes not imported (unsupported)\n",
307 if (nonface_count > 0) {
309 "WARNING: Primitive %s in %s: %d faces with vertex count < 3 (rejected)\n",
316 else if (
type == COLLADAFW::MeshPrimitive::LINES) {
320 else if (
type != COLLADAFW::MeshPrimitive::TRIANGLES &&
321 type != COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
322 fprintf(stderr,
"ERROR: Primitive type %s is not supported.\n", type_str);
333 COLLADAFW::MeshVertexData &
pos =
mesh->getPositions();
349 for (i = 0, mvert = me->
mvert; i < me->totvert; i++, mvert++) {
354 bool MeshImporter::primitive_has_useable_normals(COLLADAFW::MeshPrimitive *mp)
357 bool has_useable_normals =
false;
359 int normals_count = mp->getNormalIndices().getCount();
360 if (normals_count > 0) {
361 int index_count = mp->getPositionIndices().getCount();
362 if (index_count == normals_count) {
363 has_useable_normals =
true;
367 "Warning: Number of normals %d is different from the number of vertices %d, "
368 "skipping normals\n",
374 return has_useable_normals;
377 bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp)
380 bool has_faces =
false;
381 int type = mp->getPrimitiveType();
383 case COLLADAFW::MeshPrimitive::TRIANGLES:
384 case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
385 case COLLADAFW::MeshPrimitive::POLYLIST:
386 case COLLADAFW::MeshPrimitive::POLYGONS: {
400 std::string colname = collada_id;
401 int spos = colname.find(
"-mesh-colors-");
402 if (spos != std::string::npos) {
403 colname = colname.substr(spos + 13);
410 COLLADAFW::MeshPrimitiveArray &prim_arr = collada_mesh->getMeshPrimitives();
411 int total_poly_count = 0;
412 int total_loop_count = 0;
415 for (
int i = 0; i < prim_arr.getCount(); i++) {
416 COLLADAFW::MeshPrimitive *mp = prim_arr[i];
417 int type = mp->getPrimitiveType();
419 case COLLADAFW::MeshPrimitive::TRIANGLES:
420 case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
421 case COLLADAFW::MeshPrimitive::POLYLIST:
422 case COLLADAFW::MeshPrimitive::POLYGONS: {
423 COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
424 size_t prim_poly_count = mpvc->getFaceCount();
426 size_t prim_loop_count = 0;
427 for (
int index = 0; index < prim_poly_count; index++) {
428 int vcount = get_vertex_count(mpvc, index);
430 prim_loop_count += vcount;
438 total_loop_count += prim_loop_count;
448 if (total_poly_count > 0) {
449 me->
totpoly = total_poly_count;
450 me->
totloop = total_loop_count;
456 unsigned int totuvset = collada_mesh->getUVCoords().getInputInfosArray().getCount();
457 for (
int i = 0; i < totuvset; i++) {
458 if (collada_mesh->getUVCoords().getLength(i) == 0) {
465 for (
int i = 0; i < totuvset; i++) {
466 COLLADAFW::MeshVertexData::InputInfos *info =
467 collada_mesh->getUVCoords().getInputInfosArray()[i];
468 COLLADAFW::String &uvname = info->mName;
477 int totcolset = collada_mesh->getColors().getInputInfosArray().getCount();
479 for (
int i = 0; i < totcolset; i++) {
480 COLLADAFW::MeshVertexData::InputInfos *info =
481 collada_mesh->getColors().getInputInfosArray()[i];
491 unsigned int MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp,
int index)
493 int type = mp->getPrimitiveType();
496 case COLLADAFW::MeshPrimitive::TRIANGLES:
497 case COLLADAFW::MeshPrimitive::TRIANGLE_FANS: {
501 case COLLADAFW::MeshPrimitive::POLYLIST:
502 case COLLADAFW::MeshPrimitive::POLYGONS: {
503 result = mp->getGroupedVerticesVertexCountArray()[index];
516 COLLADAFW::MeshPrimitiveArray &prim_arr =
mesh->getMeshPrimitives();
517 int loose_edge_count = 0;
520 for (
int i = 0; i < prim_arr.getCount(); i++) {
521 COLLADAFW::MeshPrimitive *mp = prim_arr[i];
522 int type = mp->getPrimitiveType();
524 case COLLADAFW::MeshPrimitive::LINES: {
525 size_t prim_totface = mp->getFaceCount();
526 loose_edge_count += prim_totface;
533 return loose_edge_count;
536 void MeshImporter::mesh_add_edges(
Mesh *
mesh,
int len)
562 for (
int i = 0; i <
len; i++, medge++) {
571 unsigned int loose_edge_count = get_loose_edge_count(
mesh);
572 if (loose_edge_count > 0) {
574 unsigned int face_edge_count = me->
totedge;
577 mesh_add_edges(me, loose_edge_count);
580 COLLADAFW::MeshPrimitiveArray &prim_arr =
mesh->getMeshPrimitives();
582 for (
int index = 0; index < prim_arr.getCount(); index++) {
583 COLLADAFW::MeshPrimitive *mp = prim_arr[index];
585 int type = mp->getPrimitiveType();
586 if (
type == COLLADAFW::MeshPrimitive::LINES) {
587 unsigned int edge_count = mp->getFaceCount();
588 unsigned int *
indices = mp->getPositionIndices().getData();
590 for (
int j = 0; j < edge_count; j++, med++) {
606 allocate_poly_data(collada_mesh, me);
615 MaterialIdPrimitiveArrayMap mat_prim_map;
617 COLLADAFW::MeshPrimitiveArray &prim_arr = collada_mesh->getMeshPrimitives();
618 COLLADAFW::MeshVertexData &
nor = collada_mesh->getNormals();
620 for (i = 0; i < prim_arr.getCount(); i++) {
622 COLLADAFW::MeshPrimitive *mp = prim_arr[i];
625 size_t prim_totpoly = mp->getFaceCount();
626 unsigned int *position_indices = mp->getPositionIndices().getData();
627 unsigned int *normal_indices = mp->getNormalIndices().getData();
629 bool mp_has_normals = primitive_has_useable_normals(mp);
630 bool mp_has_faces = primitive_has_faces(mp);
632 int collada_meshtype = mp->getPrimitiveType();
635 Primitive prim = {mpoly, 0};
641 if (collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
642 unsigned int grouped_vertex_count = mp->getGroupedVertexElementsCount();
643 for (
unsigned int group_index = 0; group_index < grouped_vertex_count; group_index++) {
644 unsigned int first_vertex = position_indices[0];
645 unsigned int first_normal = normal_indices[0];
646 unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
648 for (
unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
650 unsigned int triangle_vertex_indices[3] = {
651 first_vertex, position_indices[1], position_indices[2]};
652 set_poly_indices(mpoly, mloop, loop_index, triangle_vertex_indices, 3);
654 if (mp_has_normals) {
657 first_normal, normal_indices[1], normal_indices[2]};
658 if (!is_flat_face(vertex_normal_indices,
nor, 3)) {
671 if (mp_has_normals) {
675 position_indices += 2;
679 if (collada_meshtype == COLLADAFW::MeshPrimitive::POLYLIST ||
680 collada_meshtype == COLLADAFW::MeshPrimitive::POLYGONS ||
681 collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLES) {
682 COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
683 unsigned int start_index = 0;
685 COLLADAFW::IndexListArray &index_list_array_uvcoord = mp->getUVCoordIndicesArray();
686 COLLADAFW::IndexListArray &index_list_array_vcolor = mp->getColorIndicesArray();
688 int invalid_loop_holes = 0;
689 for (
unsigned int j = 0; j < prim_totpoly; j++) {
692 int vcount = get_vertex_count(mpvc, j);
697 bool broken_loop = set_poly_indices(mpoly, mloop, loop_index, position_indices, vcount);
699 invalid_loop_holes += 1;
702 for (
unsigned int uvset_index = 0; uvset_index < index_list_array_uvcoord.getCount();
705 COLLADAFW::IndexList &index_list = *index_list_array_uvcoord[uvset_index];
708 if (mloopuv ==
nullptr) {
710 "Collada import: Mesh [%s] : Unknown reference to TEXCOORD [#%s].\n",
712 index_list.getName().c_str());
715 set_face_uv(mloopuv + loop_index,
718 *index_list_array_uvcoord[uvset_index],
723 if (mp_has_normals) {
724 if (!is_flat_face(normal_indices,
nor, vcount)) {
729 if (mp->hasColorIndices()) {
730 int vcolor_count = index_list_array_vcolor.getCount();
732 for (
unsigned int vcolor_index = 0; vcolor_index < vcolor_count; vcolor_index++) {
734 COLLADAFW::IndexList &color_index_list = *mp->getColorIndices(vcolor_index);
738 if (mloopcol ==
nullptr) {
740 "Collada import: Mesh [%s] : Unknown reference to VCOLOR [#%s].\n",
742 color_index_list.getName().c_str());
745 set_vcol(mloopcol + loop_index, vcol, start_index, color_index_list, vcount);
752 loop_index += vcount;
753 start_index += vcount;
756 if (mp_has_normals) {
757 normal_indices += vcount;
760 position_indices += vcount;
763 if (invalid_loop_holes > 0) {
765 "Collada import: Mesh [%s] : contains %d unsupported loops (holes).\n",
771 else if (collada_meshtype == COLLADAFW::MeshPrimitive::LINES) {
776 mat_prim_map[mp->getMaterialId()].push_back(prim);
780 geom_uid_mat_mapping_map[collada_mesh->getUniqueId()] = mat_prim_map;
783 void MeshImporter::get_vector(
float v[3], COLLADAFW::MeshVertexData &arr,
int i,
int stride)
787 switch (arr.getType()) {
788 case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
789 COLLADAFW::ArrayPrimitiveType<float> *values = arr.getFloatValues();
790 if (values->empty()) {
794 v[0] = (*values)[i++];
795 v[1] = (*values)[i++];
804 case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
805 COLLADAFW::ArrayPrimitiveType<double> *values = arr.getDoubleValues();
806 if (values->empty()) {
810 v[0] = (
float)(*values)[i++];
811 v[1] = (
float)(*values)[i++];
813 v[2] = (
float)(*values)[i];
824 bool MeshImporter::is_flat_face(
unsigned int *nind, COLLADAFW::MeshVertexData &
nor,
int count)
828 get_vector(
a,
nor, *nind, 3);
833 for (
int i = 1; i <
count; i++, nind++) {
834 get_vector(
b,
nor, *nind, 3);
839 if (dp < 0.99999f || dp > 1.00001f) {
849 if (uid_object_map.find(geom_uid) != uid_object_map.end()) {
850 return uid_object_map[geom_uid];
857 if (uid_mesh_map.find(geom_uid) != uid_mesh_map.end()) {
858 return uid_mesh_map[geom_uid];
865 if (this->mesh_geom_map.find(mesh_name) != this->mesh_geom_map.end()) {
866 return &this->mesh_geom_map[mesh_name];
885 for (
int index = 0; index < ob1->
totcol; index++) {
889 if (ob1->
matbits[index] == 0) {
892 if (ob1->
mat[index] != ob2->
mat[index]) {
908 for (
int index = 0; index < ob->
totcol; index++) {
910 me->
mat[index] = ob->
mat[index];
921 for (
int index = 0; index < ob->
totcol; index++) {
923 ob->
mat[index] =
nullptr;
927 std::vector<Object *> MeshImporter::get_all_users_of(
Mesh *reference_mesh)
929 std::vector<Object *> mesh_users;
930 for (
Object *ob : imported_objects) {
934 if (me == reference_mesh) {
935 mesh_users.push_back(ob);
944 for (
Object *ob : imported_objects) {
952 bool can_move =
true;
953 std::vector<Object *> mesh_users = get_all_users_of(me);
954 if (mesh_users.size() > 1) {
955 Object *ref_ob = mesh_users[0];
956 for (
int index = 1; index < mesh_users.size(); index++) {
964 for (
Object *
object : mesh_users) {
975 COLLADAFW::MaterialBinding cmaterial,
976 std::map<COLLADAFW::UniqueId, Material *> &uid_material_map,
978 const COLLADAFW::UniqueId *geom_uid,
981 const COLLADAFW::UniqueId &ma_uid = cmaterial.getReferencedMaterial();
984 if (uid_material_map.find(ma_uid) == uid_material_map.end()) {
986 fprintf(stderr,
"Cannot find material by UID.\n");
991 materials_mapped_to_geom.insert(
992 std::pair<COLLADAFW::UniqueId, COLLADAFW::UniqueId>(*geom_uid, ma_uid));
994 Material *ma = uid_material_map[ma_uid];
1001 MaterialIdPrimitiveArrayMap &mat_prim_map = geom_uid_mat_mapping_map[*geom_uid];
1002 COLLADAFW::MaterialId mat_id = cmaterial.getMaterialId();
1005 if (mat_prim_map.find(mat_id) != mat_prim_map.end()) {
1007 std::vector<Primitive> &prims = mat_prim_map[mat_id];
1009 std::vector<Primitive>::iterator it;
1011 for (it = prims.begin(); it != prims.end(); it++) {
1012 Primitive &prim = *it;
1013 MPoly *mpoly = prim.mpoly;
1015 for (
int i = 0; i < prim.totpoly; i++, mpoly++) {
1016 mpoly->
mat_nr = mat_index;
1023 COLLADAFW::Node *
node,
1024 COLLADAFW::InstanceGeometry *geom,
1026 std::map<COLLADAFW::UniqueId, Material *> &uid_material_map)
1028 const COLLADAFW::UniqueId *geom_uid = &geom->getInstanciatedObjectId();
1036 fprintf(stderr,
"Couldn't find a mesh UID by controller's UID.\n");
1042 if (uid_mesh_map.find(*geom_uid) == uid_mesh_map.end()) {
1045 fprintf(stderr,
"Couldn't find a mesh by UID.\n");
1049 if (!uid_mesh_map[*geom_uid]) {
1054 const std::string &
id =
node->getName().empty() ?
node->getOriginalId() :
node->getName();
1055 const char *name = (
id.length()) ?
id.c_str() :
nullptr;
1062 uid_object_map[*geom_uid] = ob;
1063 imported_objects.push_back(ob);
1067 Mesh *new_mesh = uid_mesh_map[*geom_uid];
1076 COLLADAFW::MaterialBindingArray &mat_array = geom->getMaterialBindings();
1079 for (
unsigned int i = 0; i < mat_array.getCount(); i++) {
1081 if (mat_array[i].getReferencedMaterial().isValid()) {
1085 fprintf(stderr,
"invalid referenced material for %s\n", mat_array[i].
getName().c_str());
1098 if (geom->getType() != COLLADAFW::Geometry::GEO_TYPE_MESH) {
1100 fprintf(stderr,
"Mesh type %s is not supported\n",
bc_geomTypeToStr(geom->getType()));
1106 if (!is_nice_mesh(
mesh)) {
1111 const std::string &str_geom_id =
mesh->getName().empty() ?
mesh->getOriginalId() :
1118 this->uid_mesh_map[
mesh->getUniqueId()] = me;
1119 this->mesh_geom_map[std::string(me->
id.
name)] = str_geom_id;
1121 read_vertices(
mesh, me);
1122 read_polys(
mesh, me);
1126 read_lines(
mesh, me);
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
void CustomData_free(struct CustomData *data, int totelem)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
bool CustomData_has_layer(const struct CustomData *data, int type)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
const CustomData_MeshMasks CD_MASK_MESH
display list (or rather multi purpose list) stuff.
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
void BKE_id_free_us(struct Main *bmain, void *idv) ATTR_NONNULL()
General operations, lookup, etc. for materials.
void BKE_object_material_assign(struct Main *bmain, struct Object *ob, struct Material *ma, short act, int assign_type)
void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me)
struct Mesh * BKE_mesh_add(struct Main *bmain, const char *name)
bool BKE_mesh_validate(struct Mesh *me, bool do_verbose, bool cddata_check_mask)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, bool select_new_edges)
General operations, lookup, etc. for blender objects.
MINLINE float normalize_v3(float r[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void bc_remove_mark(Object *ob)
int bc_is_marked(Object *ob)
void bc_set_mark(Object *ob)
#define ID_REAL_USERS(id)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
Read Guarded memory(de)allocation.
static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
static void bc_copy_materials_to_data(Object *ob, Mesh *me)
static const char * bc_geomTypeToStr(COLLADAFW::Geometry::GeometryType type)
static std::string extract_vcolname(const COLLADAFW::String &collada_id)
static void bc_remove_materials_from_object(Object *ob, Mesh *me)
static void colladaAddColor(T values, MLoopCol *mloopcol, int v_index, int stride)
static std::string bc_get_dae_name(T *node)
static const char * bc_primTypeToStr(COLLADAFW::MeshPrimitive::PrimitiveType type)
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual const char * getName() const
COLLADAFW::UniqueId * get_geometry_uid(const COLLADAFW::UniqueId &controller_uid)
virtual Mesh * get_mesh_by_geom_uid(const COLLADAFW::UniqueId &geom_uid)
virtual Object * get_object_by_geom_uid(const COLLADAFW::UniqueId &geom_uid)
void optimize_material_assignements()
bool write_geometry(const COLLADAFW::Geometry *geom)
void assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial, std::map< COLLADAFW::UniqueId, Material * > &uid_material_map, Object *ob, const COLLADAFW::UniqueId *geom_uid, short mat_index)
Object * create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom, bool isController, std::map< COLLADAFW::UniqueId, Material * > &uid_material_map)
MeshImporter(UnitConverter *unitconv, ArmatureImporter *arm, Main *bmain, Scene *sce, ViewLayer *view_layer)
std::string * get_geometry_name(const std::string &mesh_name)
UVDataWrapper(COLLADAFW::MeshVertexData &vdata)
void getUV(int uv_index, float *uv)
void get_vcol(int v_index, MLoopCol *mloopcol)
VCOLDataWrapper(COLLADAFW::MeshVertexData &vdata)
Object * bc_add_object(Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name)
ccl_gpu_kernel_postfix int ccl_global int * indices
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
struct MLoopCol * mloopcol