Skip to content

Commit

Permalink
Renderer : Add todo
Browse files Browse the repository at this point in the history
If we made this modification to the Renderer API, the Cycles backend would have more options in dealing with the options-before-session but session-before-attributes chicken-and-egg problem. If `Renderer::attributes()` was called before the session was acquired, it could have just returned a special `PendingAttributes` object that stored the source CompoundObject. Then later in `Renderer::editAttributes()` after the session has been made, it could have transformed PendingAttributes into the final CyclesAttributes form.

This would potentially also have benefits in the 3Delight backend, meaning that DelightObject didn't need to store a DelightContext.
  • Loading branch information
johnhaddon committed Mar 4, 2024
1 parent 6f8970b commit e9d1f52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/GafferScene/Private/IECoreScenePreview/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ class GAFFERSCENE_API Renderer : public IECore::RefCounted
///
/// Currently all ObjectInterfaces _must_ be destroyed prior to destruction
/// of the renderer itself.
///
/// \todo Having methods on ObjectInterface has turned out to make the API harder
/// to implement for many renderers, because each ObjectInterface needs to have
/// access to some central state that more naturally belongs in the renderer.
/// Consider making ObjectInterface into just an opaque handle, and then moving
/// the edit methods to Renderer like so :
///
/// `bool Renderer::editAttributes( ObjectInterface *object, const AttributesInterface *attributes )`
class GAFFERSCENE_API ObjectInterface : public IECore::RefCounted
{

Expand Down

0 comments on commit e9d1f52

Please sign in to comment.