37 Vector<std::unique_ptr<Geometry>> &all_geometries,
39 Map<std::string, std::unique_ptr<MTLMaterial>> &
materials,
50 all_geometries.begin(), all_geometries.end(), [](
const auto &
a,
const auto &
b) {
51 const char *na = a ? a->geometry_name_.c_str() :
"";
52 const char *nb = b ? b->geometry_name_.c_str() :
"";
53 return BLI_strcasecmp(na, nb) < 0;
58 objects.
reserve(all_geometries.size());
59 for (
const std::unique_ptr<Geometry> &geometry : all_geometries) {
63 obj = mesh_ob_from_geometry.create_mesh(bmain,
materials, created_materials, import_params);
67 obj = curve_ob_from_geometry.
create_curve(bmain, import_params);
80 for (
Object *obj : objects) {
106 size_t read_buffer_size)
116 OBJParser obj_parser{import_params, read_buffer_size};
117 obj_parser.parse(all_geometries, global_vertices);
119 for (
StringRefNull mtl_library : obj_parser.mtl_libraries()) {
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)
struct LayerCollection * BKE_layer_collection_get_active(struct ViewLayer *view_layer)
void BKE_main_collection_sync(const struct Main *bmain)
void BKE_layer_collection_resync_allow(void)
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_layer_collection_resync_forbid(void)
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.
void append(const T &value)
void reserve(const int64_t min_capacity)
Object * create_curve(Main *bmain, const OBJImportParams &import_params)
smooth(Type::VEC4, "color_mul") .smooth(Type gpFillTexture gpSceneDepthTexture materials[GPENCIL_MATERIAL_BUFFER_LEN]
static void geometry_to_blender_objects(Main *bmain, Scene *scene, ViewLayer *view_layer, const OBJImportParams &import_params, Vector< std::unique_ptr< Geometry >> &all_geometries, const GlobalVertices &global_vertices, Map< std::string, std::unique_ptr< MTLMaterial >> &materials, Map< std::string, Material * > &created_materials)
void importer_main(bContext *C, const OBJImportParams &import_params)
void parallel_sort(RandomAccessIterator begin, RandomAccessIterator end)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
struct Collection * collection