34 fprintf(stderr,
"STL Importer: failed to read file");
36 fprintf(stderr,
", end of file reached.\n");
38 else if (ferror(
file)) {
58 fprintf(stderr,
"Failed to open STL file:'%s'.\n", import_params.
filepath);
89 if (
mesh ==
nullptr) {
90 fprintf(stderr,
"STL Importer: Failed to import mesh '%s'\n", import_params.
filepath);
95 bool verbose_validate =
false;
97 verbose_validate =
true;
114 float scale_vec[3] = {global_scale, global_scale, global_scale};
115 float obmat3x3[3][3];
117 float obmat4x4[4][4];
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
struct LayerCollection * BKE_layer_collection_get_active(struct ViewLayer *view_layer)
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, struct Base *selbase)
void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me)
bool BKE_mesh_validate(struct Mesh *me, bool do_verbose, bool cddata_check_mask)
General operations, lookup, etc. for blender objects.
void BKE_object_apply_mat4(struct Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_file_size(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
File and directory operations.
void unit_m3(float m[3][3])
void unit_m4(float m[4][4])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
void rescale_m4(float mat[4][4], const float scale[3])
bool mat3_from_axis_conversion(int src_forward, int src_up, int dst_forward, int dst_up, float r_mat[3][3])
#define BLI_SCOPED_DEFER(function_to_defer)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
void importer_main(bContext *C, const STLImportParams &import_params)
Mesh * read_stl_ascii(const char *filepath, Main *bmain, char *mesh_name, bool use_custom_normals)
Mesh * read_stl_binary(FILE *file, Main *bmain, char *mesh_name, bool use_custom_normals)
void stl_import_report_error(FILE *file)
const size_t BINARY_STRIDE
const size_t BINARY_HEADER_SIZE
struct Collection * collection