52 else if (ferror(file)) {
64 "STL Import: Cannot open file '%s'",
77 if (fread(&num_tri,
sizeof(
uint32_t), 1, file) != 1) {
81 "STL Import: Failed to read file '%s'",
91 if (
mesh ==
nullptr) {
95 "STL Import: Failed to import mesh from file '%s'",
101 bool verbose_validate =
false;
103 verbose_validate =
true;
141 "Could not find an editable collection in current scene, imported data will not be "
145 obj->data = id_cast<ID *>(mesh_in_main);
157 float scale_vec[3] = {global_scale, global_scale, global_scale};
158 float obmat3x3[3][3];
160 float obmat4x4[4][4];
General operations, lookup, etc. for blender objects.
File and directory operations.
#define BLI_SCOPED_DEFER(function_to_defer)
#define CLOG_ERROR(clg_ref,...)
#define ID_IS_EDITABLE(_id)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
bool mesh_validate(Mesh &mesh, bool verbose=false, bool allow_missing_edges=false)
Mesh * read_stl_binary(FILE *file, const bool use_custom_normals)
constexpr size_t BINARY_STRIDE
void importer_main(const bContext *C, const STLImportParams &import_params)
constexpr size_t BINARY_HEADER_SIZE
void stl_import_report_error(FILE *file)
Mesh * read_stl_ascii(const char *filepath, const bool use_custom_normals)
Mesh * read_stl_file(const STLImportParams &import_params)
bool bool BLI_path_extension_strip(char *path) ATTR_NONNULL(1)
char * STRNCPY(char(&dst)[N], const char *src)
LayerCollection * BKE_layer_collection_get_active_editable(ViewLayer *view_layer)
void BKE_view_layer_base_select_and_set_active(ViewLayer *view_layer, Base *selbase)
void copy_m4_m3(float m1[4][4], const float m2[3][3])
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, bool process_shape_keys=true)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
bool mat3_from_axis_conversion(int src_forward, int src_up, int dst_forward, int dst_up, float r_mat[3][3])
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
void unit_m4(float m[4][4])
void BKE_view_layer_base_deselect_all(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
size_t BLI_file_size(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Main * CTX_data_main(const bContext *C)
void unit_m3(float m[3][3])
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void rescale_m4(float mat[4][4], const float scale[3])
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Mesh * BKE_mesh_add(Main *bmain, const char *name)
struct Collection * collection