コード例 #1
0
ファイル: entitybrowser.cpp プロジェクト: willzhou/appleseed
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();
    }
}
コード例 #2
0
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();
}
コード例 #3
0
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();
    }
}
コード例 #4
0
ファイル: objectitem.cpp プロジェクト: yesoce/appleseed
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();
}
コード例 #5
0
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();
    }
}
コード例 #6
0
ファイル: entitybrowser.cpp プロジェクト: willzhou/appleseed
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();
    }
}
コード例 #7
0
StringDictionary EntityBrowser<Project>::get_entities(const string& type) const
{
    return StringDictionary();
}