void ObjectCollectionItem::insert_objects(const string& path) const { const string base_object_name = bf::path(path).replace_extension().filename().string(); ParamArray params; params.insert("filename", path); SearchPaths search_paths; MeshObjectArray mesh_objects; if (!MeshObjectReader().read( search_paths, base_object_name.c_str(), params, mesh_objects)) return; for (size_t i = 0; i < mesh_objects.size(); ++i) { MeshObject* object = mesh_objects[i]; m_parent_item->add_item(object); m_parent.objects().insert(auto_release_ptr<Object>(object)); const string object_instance_name = string(object->get_name()) + "_inst"; auto_release_ptr<ObjectInstance> object_instance( ObjectInstanceFactory::create( object_instance_name.c_str(), ParamArray(), object->get_name(), Transformd::identity(), StringDictionary())); m_parent_item->add_item(object_instance.get()); m_parent.object_instances().insert(object_instance); } if (!mesh_objects.empty()) { m_parent.bump_version_id(); m_editor_context.m_project_builder.slot_notify_project_modification(); } }