Blender V4.3
collada_internal.cpp File Reference
#include "COLLADABUPlatform.h"
#include "collada_utils.h"
#include "BLI_linklist.h"
#include "BLI_math_matrix.h"
#include "BKE_armature.hh"

Go to the source code of this file.

Typedefs

using map_string_list = std::map<std::string, std::vector<std::string>>
 

Functions

void clear_global_id_map ()
 
std::string translate_id (const char *idString)
 
std::string translate_id (const std::string &id)
 
std::string id_name (void *id)
 
std::string encode_xml (const std::string &xml)
 
std::string get_geometry_id (Object *ob)
 
std::string get_geometry_id (Object *ob, bool use_instantiation)
 
std::string get_light_id (Object *ob)
 
std::string get_joint_sid (Bone *bone)
 
static std::string get_joint_sid (EditBone *bone)
 
std::string get_camera_id (Object *ob)
 
std::string get_effect_id (Material *mat)
 
std::string get_material_id (Material *mat)
 
std::string get_morph_id (Object *ob)
 

Variables

const uchar translate_start_name_map [256]
 
const uchar translate_name_map [256]
 
map_string_list global_id_map
 

Typedef Documentation

◆ map_string_list

using map_string_list = std::map<std::string, std::vector<std::string>>

Definition at line 197 of file collada_internal.cpp.

Function Documentation

◆ clear_global_id_map()

void clear_global_id_map ( )

Definition at line 200 of file collada_internal.cpp.

References global_id_map.

Referenced by DocumentExporter::exportCurrentScene().

◆ encode_xml()

◆ get_camera_id()

std::string get_camera_id ( Object * ob)

Definition at line 310 of file collada_internal.cpp.

References id_name(), and translate_id().

Referenced by CamerasExporter::operator()().

◆ get_effect_id()

std::string get_effect_id ( Material * mat)

Definition at line 315 of file collada_internal.cpp.

References id_name(), and translate_id().

Referenced by EffectsExporter::operator()(), and MaterialsExporter::operator()().

◆ get_geometry_id() [1/2]

std::string get_geometry_id ( Object * ob)

◆ get_geometry_id() [2/2]

std::string get_geometry_id ( Object * ob,
bool use_instantiation )

Definition at line 289 of file collada_internal.cpp.

References Object::data, id_name(), and translate_id().

◆ get_joint_sid() [1/2]

std::string get_joint_sid ( Bone * bone)

Definition at line 301 of file collada_internal.cpp.

References Bone::name, and translate_id().

◆ get_joint_sid() [2/2]

static std::string get_joint_sid ( EditBone * bone)
static

Definition at line 305 of file collada_internal.cpp.

References EditBone::name, and translate_id().

◆ get_light_id()

std::string get_light_id ( Object * ob)

Definition at line 296 of file collada_internal.cpp.

References id_name(), and translate_id().

Referenced by LightsExporter::operator()().

◆ get_material_id()

◆ get_morph_id()

std::string get_morph_id ( Object * ob)

Definition at line 325 of file collada_internal.cpp.

References id_name(), and translate_id().

◆ id_name()

◆ translate_id() [1/2]

◆ translate_id() [2/2]

std::string translate_id ( const std::string & id)

Look at documentation of translate_map

Definition at line 211 of file collada_internal.cpp.

References global_id_map, translate_name_map, and translate_start_name_map.

Variable Documentation

◆ global_id_map

map_string_list global_id_map

Definition at line 198 of file collada_internal.cpp.

Referenced by clear_global_id_map(), and translate_id().

◆ translate_name_map

const uchar translate_name_map[256]
Initial value:
= {
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 45, 95, 95, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
}

Definition at line 178 of file collada_internal.cpp.

Referenced by translate_id().

◆ translate_start_name_map

const uchar translate_start_name_map[256]
Initial value:
= {
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
}

Translation map. Used to translate every COLLADA id to a valid id, no matter what "wrong" letters may be included. Look at the IDREF XSD declaration for more. Follows strictly the COLLADA XSD declaration which explicitly allows non-English chars, like special chars (e.g. micro sign), umlauts and so on. The COLLADA spec also allows additional chars for member access ('.'), these must obviously be removed too, otherwise they would be heavily misinterpreted.

Definition at line 159 of file collada_internal.cpp.

Referenced by translate_id().