Example #1
0
bool Assembly::on_render_begin(
    const Project&          project,
    const BaseGroup*        parent,
    OnRenderBeginRecorder&  recorder,
    IAbortSwitch*           abort_switch)
{
    if (!Entity::on_render_begin(project, parent, recorder, abort_switch))
        return false;

    if (!BaseGroup::on_render_begin(project, parent, recorder, abort_switch))
        return false;

    bool success = true;
    success = success && invoke_on_render_begin(bsdfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(bssrdfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(edfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(surface_shaders(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(materials(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(lights(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(objects(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(object_instances(), project, this, recorder, abort_switch);
    success = success && invoke_on_render_begin(volumes(), project, this, recorder, abort_switch);

    return success;
}
Example #2
0
bool Assembly::on_frame_begin(
    const Project&      project,
#ifdef WITH_OSL
    OSL::ShadingSystem& shading_system,
#endif
    AbortSwitch*        abort_switch)
{
    bool success = true;

    success = success && invoke_on_frame_begin(project, texture_instances(), abort_switch);
    success = success && invoke_on_frame_begin(project, *this, surface_shaders(), abort_switch);
    success = success && invoke_on_frame_begin(project, *this, bsdfs(), abort_switch);
    success = success && invoke_on_frame_begin(project, *this, edfs(), abort_switch);

#ifdef WITH_OSL
    success = success && invoke_on_frame_begin(project, *this, shading_system, shader_groups(), abort_switch);
#endif

    success = success && invoke_on_frame_begin(project, *this, materials(), abort_switch);
    success = success && invoke_on_frame_begin(project, *this, lights(), abort_switch);

    success = success && invoke_on_frame_begin(project, *this, object_instances(), abort_switch);

#ifdef WITH_OSL
    success = success && invoke_on_frame_begin(project, assemblies(), shading_system, abort_switch);
#else
    success = success && invoke_on_frame_begin(project, assemblies(), abort_switch);
#endif

    success = success && invoke_on_frame_begin(project, assembly_instances(), abort_switch);

    return success;
}
Example #3
0
void Assembly::on_frame_end(const Project& project)
{
    invoke_on_frame_end(project, assembly_instances());
    invoke_on_frame_end(project, assemblies());
    invoke_on_frame_end(project, *this, lights());
    invoke_on_frame_end(project, *this, materials());
    invoke_on_frame_end(project, *this, edfs());
    invoke_on_frame_end(project, *this, bsdfs());
    invoke_on_frame_end(project, *this, surface_shaders());
}
Example #4
0
bool Assembly::on_frame_begin(const Project& project)
{
    bool success = true;

    success = success && invoke_on_frame_begin(project, *this, surface_shaders());
    success = success && invoke_on_frame_begin(project, *this, bsdfs());
    success = success && invoke_on_frame_begin(project, *this, edfs());
    success = success && invoke_on_frame_begin(project, *this, materials());
    success = success && invoke_on_frame_begin(project, *this, lights());
    success = success && invoke_on_frame_begin(project, assemblies());
    success = success && invoke_on_frame_begin(project, assembly_instances());

    return success;
}
Example #5
0
void Assembly::update_asset_paths(const StringDictionary& mappings)
{
    BaseGroup::update_asset_paths(mappings);

    invoke_update_asset_paths(bsdfs(), mappings);
    invoke_update_asset_paths(bssrdfs(), mappings);
    invoke_update_asset_paths(edfs(), mappings);
    invoke_update_asset_paths(surface_shaders(), mappings);
    invoke_update_asset_paths(materials(), mappings);
    invoke_update_asset_paths(lights(), mappings);
    invoke_update_asset_paths(objects(), mappings);
    invoke_update_asset_paths(object_instances(), mappings);
    invoke_update_asset_paths(volumes(), mappings);
}
Example #6
0
void Assembly::collect_asset_paths(StringArray& paths) const
{
    BaseGroup::collect_asset_paths(paths);

    invoke_collect_asset_paths(bsdfs(), paths);
    invoke_collect_asset_paths(bssrdfs(), paths);
    invoke_collect_asset_paths(edfs(), paths);
    invoke_collect_asset_paths(surface_shaders(), paths);
    invoke_collect_asset_paths(materials(), paths);
    invoke_collect_asset_paths(lights(), paths);
    invoke_collect_asset_paths(objects(), paths);
    invoke_collect_asset_paths(object_instances(), paths);
    invoke_collect_asset_paths(volumes(), paths);
}
Example #7
0
void Assembly::on_frame_end(const Project& project)
{
    invoke_on_frame_end(project, assembly_instances());
    invoke_on_frame_end(project, assemblies());
    invoke_on_frame_end(project, object_instances());
    invoke_on_frame_end(project, *this, lights());
    invoke_on_frame_end(project, *this, materials());
#ifdef WITH_OSL
    invoke_on_frame_end(project, *this, shader_groups());
#endif
    invoke_on_frame_end(project, *this, edfs());
    invoke_on_frame_end(project, *this, bsdfs());
    invoke_on_frame_end(project, *this, surface_shaders());
    invoke_on_frame_end(project, texture_instances());
}
Example #8
0
bool Assembly::on_frame_begin(
    const Project&          project,
    const BaseGroup*        parent,
    OnFrameBeginRecorder&   recorder,
    IAbortSwitch*           abort_switch)
{
    if (!Entity::on_frame_begin(project, parent, recorder, abort_switch))
        return false;

    if (!BaseGroup::on_frame_begin(project, parent, recorder, abort_switch))
        return false;

    bool success = true;
    success = success && invoke_on_frame_begin(bsdfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(bssrdfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(edfs(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(surface_shaders(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(materials(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(lights(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(objects(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(object_instances(), project, this, recorder, abort_switch);
    success = success && invoke_on_frame_begin(volumes(), project, this, recorder, abort_switch);
    if (!success)
        return false;

    // Collect procedural object instances.
    assert(!m_has_render_data);
    for (size_t i = 0, e = object_instances().size(); i < e; ++i)
    {
        const ObjectInstance* object_instance = object_instances().get_by_index(i);
        const Object& object = object_instance->get_object();
        if (dynamic_cast<const ProceduralObject*>(&object) != nullptr)
            m_render_data.m_procedural_object_instances.push_back(make_pair(object_instance, i));
    }
    m_has_render_data = true;

    return true;
}