7 #include "COLLADABUURI.h"
8 #include "COLLADASWImage.h"
31 BCExportSettings &export_settings,
33 : COLLADASW::LibraryImages(
sw), export_settings(export_settings), key_image_map(key_image_map)
38 void ImagesExporter::export_UV_Image(
Image *
image,
bool use_copies)
45 fprintf(stderr,
"Collada export: image does not exist:\n%s\n",
image->filepath);
54 short image_source =
image->source;
64 BLI_split_dir_part(this->export_settings.get_filepath(), export_dir,
sizeof(export_dir));
66 if (is_generated || is_dirty || use_copies || is_packed) {
70 BLI_strncpy(export_file, name.c_str(),
sizeof(export_file));
79 if (is_generated || is_dirty || is_packed) {
86 fprintf(stderr,
"Collada export: Cannot export image to:\n%s\n", export_path);
89 BLI_strncpy(export_path, export_file,
sizeof(export_path));
107 if (
BLI_copy(source_path, export_path) != 0) {
109 "Collada export: Cannot copy image:\n source:%s\ndest :%s\n",
116 BLI_strncpy(export_path, export_file,
sizeof(export_path));
123 BLI_strncpy(export_path, source_path,
sizeof(export_path));
129 COLLADASW::Image img(COLLADABU::URI(COLLADABU::URI::nativePathToUri(export_path)),
133 fprintf(stdout,
"Collada export: Added image: %s\n", export_file);
140 bool use_texture_copies = this->export_settings.get_use_texture_copies();
143 KeyImageMap::iterator iter;
144 for (iter = key_image_map.begin(); iter != key_image_map.end(); iter++) {
150 export_UV_Image(
image, use_texture_copies);
CustomData interface, see also DNA_customdata_types.h.
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
int BKE_imbuf_write_as(struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf, bool save_copy)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
bool BKE_image_has_packedfile(const struct Image *image)
bool BKE_image_is_dirty(struct Image *image)
File and directory operations.
int BLI_copy(const char *file, const char *to) ATTR_NONNULL()
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen)
bool BLI_make_existing_file(const char *name)
void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2)
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
Contains defines and structs used throughout the imbuf module.
ImagesExporter(COLLADASW::StreamWriter *sw, BCExportSettings &export_settings, KeyImageMap &key_image_map)
void exportImages(Scene *sce)
std::string translate_id(const char *idString)
std::string id_name(void *id)
std::map< std::string, Image * > KeyImageMap
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
ccl_gpu_kernel_postfix ccl_global float int int int sw