StringDictionary EntityBrowser<Assembly>::get_entities(const string& type) const { if (type == "bsdf") { return build_entity_dictionary(m_assembly.bsdfs()); } else if (type == "color") { return build_entity_dictionary(m_assembly.colors()); } else if (type == "edf") { return build_entity_dictionary(m_assembly.edfs()); } else if (type == "material") { return build_entity_dictionary(m_assembly.materials()); } else if (type == "surface_shader") { return build_entity_dictionary(m_assembly.surface_shaders()); } else if (type == "texture_instance") { return build_entity_dictionary(m_assembly.texture_instances()); } else { return StringDictionary(); } }
StringDictionary EntityBrowser<BaseGroup>::get_entities(const string& type) const { return type == "color" ? build_entity_dictionary(m_base_group.colors()) : type == "texture_instance" ? build_entity_dictionary(m_base_group.texture_instances()) : StringDictionary(); }
StringDictionary EntityBrowser<BaseGroup>::get_entities(const string& type) const { if (type == "color") { return build_entity_dictionary(m_base_group.colors()); } else if (type == "texture_instance") { return build_entity_dictionary(m_base_group.texture_instances()); } else { return StringDictionary(); } }
void ObjectItem::do_instantiate(const string& name) { auto_release_ptr<ObjectInstance> object_instance( ObjectInstanceFactory::create( name.c_str(), ParamArray(), m_entity->get_name(), Transformd::identity(), StringDictionary())); m_parent_item->add_item(object_instance.get()); m_parent.object_instances().insert(object_instance); m_parent.bump_version_id(); m_project_builder.notify_project_modification(); }
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(); } }
StringDictionary EntityBrowser<Scene>::get_entities(const string& type) const { if (type == "color") { return build_entity_dictionary(m_scene.colors()); } else if (type == "environment_edf") { return build_entity_dictionary(m_scene.environment_edfs()); } else if (type == "environment_shader") { return build_entity_dictionary(m_scene.environment_shaders()); } else if (type == "texture_instance") { return build_entity_dictionary(m_scene.texture_instances()); } else { return StringDictionary(); } }
StringDictionary EntityBrowser<Project>::get_entities(const string& type) const { return StringDictionary(); }