Blender V4.3
MeshImporter.cpp File Reference
#include <algorithm>
#include <iostream>
#include "COLLADABUPlatform.h"
#include "COLLADAFWMeshPrimitive.h"
#include "COLLADAFWMeshVertexData.h"
#include "COLLADAFWPolygons.h"
#include "MEM_guardedalloc.h"
#include "BKE_attribute.hh"
#include "BKE_customdata.hh"
#include "BKE_displist.h"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_object.hh"
#include "DNA_meshdata_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "ArmatureImporter.h"
#include "MeshImporter.h"
#include "collada_utils.h"

Go to the source code of this file.

Functions

template<class T >
static std::string bc_get_dae_name (T *node)
 
static const char * bc_primTypeToStr (COLLADAFW::MeshPrimitive::PrimitiveType type)
 
static const char * bc_geomTypeToStr (COLLADAFW::Geometry::GeometryType type)
 
template<typename T >
static void colladaAddColor (T values, MLoopCol *mloopcol, int v_index, int stride)
 
static std::string extract_vcolname (const COLLADAFW::String &collada_id)
 
static bool bc_has_out_of_bound_indices (Mesh *mesh)
 
static bool bc_has_same_material_configuration (Object *ob1, Object *ob2)
 
static void bc_copy_materials_to_data (Object *ob, Mesh *mesh)
 
static void bc_remove_materials_from_object (Object *ob, Mesh *mesh)
 

Function Documentation

◆ bc_copy_materials_to_data()

static void bc_copy_materials_to_data ( Object * ob,
Mesh * mesh )
static

Caution here: This code assumes that all materials are assigned to Object and no material is assigned to Data. That is true right after the objects have been imported.

Definition at line 945 of file MeshImporter.cpp.

References Object::mat, Object::matbits, and Object::totcol.

Referenced by MeshImporter::optimize_material_assignements().

◆ bc_geomTypeToStr()

static const char * bc_geomTypeToStr ( COLLADAFW::Geometry::GeometryType type)
static

Definition at line 74 of file MeshImporter.cpp.

Referenced by MeshImporter::write_geometry().

◆ bc_get_dae_name()

template<class T >
static std::string bc_get_dae_name ( T * node)
static

Definition at line 44 of file MeshImporter.cpp.

Referenced by MeshImporter::write_geometry().

◆ bc_has_out_of_bound_indices()

static bool bc_has_out_of_bound_indices ( Mesh * mesh)
static

Definition at line 902 of file MeshImporter.cpp.

Referenced by MeshImporter::write_geometry().

◆ bc_has_same_material_configuration()

static bool bc_has_same_material_configuration ( Object * ob1,
Object * ob2 )
static

this function checks if both objects have the same materials assigned to Object (in the same order) returns true if condition matches, otherwise false;

Definition at line 917 of file MeshImporter.cpp.

References Object::mat, Object::matbits, and Object::totcol.

Referenced by MeshImporter::optimize_material_assignements().

◆ bc_primTypeToStr()

static const char * bc_primTypeToStr ( COLLADAFW::MeshPrimitive::PrimitiveType type)
static

Definition at line 49 of file MeshImporter.cpp.

◆ bc_remove_materials_from_object()

static void bc_remove_materials_from_object ( Object * ob,
Mesh * mesh )
static

Remove all references to materials from the object.

Definition at line 956 of file MeshImporter.cpp.

References Object::mat, Object::matbits, and Object::totcol.

Referenced by MeshImporter::optimize_material_assignements().

◆ colladaAddColor()

template<typename T >
static void colladaAddColor ( T values,
MLoopCol * mloopcol,
int v_index,
int stride )
static

◆ extract_vcolname()

static std::string extract_vcolname ( const COLLADAFW::String & collada_id)
static

Definition at line 408 of file MeshImporter.cpp.