41 const size_t keyword_len = keyword.
size();
42 if (
str.size() < keyword_len) {
45 if (memcmp(
str.data(), keyword.
data(), keyword_len) != 0) {
48 str =
str.drop_front(keyword_len);
65 while (!
str.is_empty() &&
str[0] <=
' ') {
105 return "Invalid PLY header.";
145 property.name = std::string(word.
data(), word.
size());
146 r_header.
elements.last().properties.append(property);
155 return "No end_header.";
173 if (err !=
nullptr) {
181 if (
data ==
nullptr) {
182 CLOG_ERROR(&
LOG,
"PLY Importer: failed importing %s, unknown error", ob_name);
186 if (!
data->error.empty()) {
187 CLOG_ERROR(&
LOG,
"PLY Importer: failed importing %s: %s", ob_name,
data->error.c_str());
191 if (
data->vertices.is_empty()) {
192 CLOG_ERROR(&
LOG,
"PLY Importer: file %s contains no vertices", ob_name);
232 if (mesh ==
nullptr) {
241 obj->data = mesh_in_main;
254 float scale_vec[3] = {global_scale, global_scale, global_scale};
255 float obmat3x3[3][3];
257 float obmat4x4[4][4];
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
LayerCollection * BKE_layer_collection_get_active(ViewLayer *view_layer)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
void BKE_view_layer_base_deselect_all(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void BKE_view_layer_base_select_and_set_active(ViewLayer *view_layer, Base *selbase)
Mesh * BKE_mesh_add(Main *bmain, const char *name)
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, bool process_shape_keys=true)
General operations, lookup, etc. for blender objects.
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void unit_m3(float m[3][3])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
void rescale_m4(float mat[4][4], const float scale[3])
void unit_m4(float m[4][4])
bool mat3_from_axis_conversion(int src_forward, int src_up, int dst_forward, int dst_up, float r_mat[3][3])
bool bool BLI_path_extension_strip(char *path) ATTR_NONNULL(1)
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
char * STRNCPY(char(&dst)[N], const char *src)
#define CLOG_ERROR(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const void * element
constexpr const T * data() const
constexpr const T & first() const
constexpr int64_t size() const
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr const char * data() const
void after_header(bool is_binary)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
static PlyDataTypes type_from_string(Span< char > word)
static void skip_space(Span< char > &str)
void importer_main(bContext *C, const PLYImportParams &import_params)
std::unique_ptr< PlyData > import_ply_data(PlyReadBuffer &file, PlyHeader &header)
static Mesh * read_ply_to_mesh(const PLYImportParams &import_params, const char *ob_name)
static Span< char > parse_word(Span< char > &str)
static bool parse_keyword(Span< char > &str, StringRef keyword)
Mesh * convert_ply_to_mesh(PlyData &data, const PLYImportParams ¶ms)
const char * read_header(PlyReadBuffer &file, PlyHeader &r_header)
Mesh * import_mesh(const PLYImportParams &import_params)
struct Collection * collection