Skip to content

Commit

Permalink
Merge pull request #5642 from murraystevenson/renderPassEditor
Browse files Browse the repository at this point in the history
RenderPassEditor
  • Loading branch information
murraystevenson authored Jan 30, 2024
2 parents 73a69c4 + fd63c95 commit bd2491d
Show file tree
Hide file tree
Showing 32 changed files with 2,983 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Features
--------

- 3Delight : Added support for USD `SphereLight`, `RectLight`, `DiskLight`, `DistantLight`, `DomeLight` and `CylinderLight`.
- RenderPassEditor : Added a new editor UI for inspecting and editing render passes.

Improvements
------------
Expand All @@ -27,6 +28,7 @@ API
---

- ArnoldShaderUI : Added support for `colorSpace` widget type metadata, allowing an OpenColorIO colour space to be chosen.
- PathColumn : Added `CellData::foreground` member, to provide additional control over foreground colours in the PathListingWidget.

1.3.10.0 (relative to 1.3.9.0)
========
Expand Down
8 changes: 7 additions & 1 deletion include/GafferSceneUI/Private/Inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class GAFFERSCENEUI_API Inspector : public IECore::RefCounted, public Gaffer::Si
/// > that edits the processor itself.
virtual EditFunctionOrFailure editFunction( Gaffer::EditScope *editScope, const GafferScene::SceneAlgo::History *history ) const;

/// Can be implemented by derived classes to provide a fallback value for the inspection,
/// used when no value is returned from `value()`.
virtual IECore::ConstObjectPtr fallbackValue() const;

protected :

Gaffer::EditScope *targetEditScope() const;
Expand Down Expand Up @@ -308,7 +312,9 @@ class GAFFERSCENEUI_API Inspector::Result : public IECore::RefCounted
Downstream,
/// No EditScope was specified, or the EditScope was not found in
/// the value's history.
Other
Other,
/// The value was provided from a fallback value from the Inspector.
Fallback
};

/// The relationship between `source()` and `editScope()`.
Expand Down
1 change: 1 addition & 0 deletions include/GafferSceneUI/Private/OptionInspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class GAFFERSCENEUI_API OptionInspector : public Inspector
IECore::ConstObjectPtr value( const GafferScene::SceneAlgo::History *history ) const override;
Gaffer::ValuePlugPtr source( const GafferScene::SceneAlgo::History *history, std::string &editWarning ) const override;
EditFunctionOrFailure editFunction( Gaffer::EditScope *scope, const GafferScene::SceneAlgo::History *history ) const override;
IECore::ConstObjectPtr fallbackValue() const override;

private :

Expand Down
1 change: 1 addition & 0 deletions include/GafferSceneUI/TypeIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum TypeId
SetPathTypeId = 110665,
LightToolTypeId = 110666,
LightPositionToolTypeId = 110667,
RenderPassPathTypeId = 110668,

LastTypeId = 110700
};
Expand Down
13 changes: 10 additions & 3 deletions include/GafferUI/PathColumn.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ class GAFFERUI_API PathColumn : public IECore::RefCounted, public Gaffer::Signal
const IECore::ConstDataPtr &value = nullptr,
const IECore::ConstDataPtr &icon = nullptr,
const IECore::ConstDataPtr &background = nullptr,
const IECore::ConstDataPtr &toolTip = nullptr
) : value( value ), icon( icon ), background( background ), toolTip( toolTip ) {}
const IECore::ConstDataPtr &toolTip = nullptr,
const IECore::ConstDataPtr &foreground = nullptr
) : value( value ), icon( icon ), background( background ), toolTip( toolTip ),
foreground( foreground ) {}

CellData( const CellData &other ) = default;

/// The primary value to be displayed in a cell or header.
Expand Down Expand Up @@ -119,11 +122,15 @@ class GAFFERUI_API PathColumn : public IECore::RefCounted, public Gaffer::Signal
///
/// - StringData
IECore::ConstDataPtr toolTip;
/// The foreground colour for the cell value. Supported types :
///
/// - Color3fData
/// - Color4fData
IECore::ConstDataPtr foreground;

private :

IECore::ConstDataPtr m_reserved1;
IECore::ConstDataPtr m_reserved2;

};

Expand Down
17 changes: 17 additions & 0 deletions python/GafferSceneTest/EditScopeAlgoTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,5 +1636,22 @@ def testRenderPassOptionEditSerialisation( self ) :
self.assertEqual( edit["enabled"].getValue(), True )
self.assertEqual( edit["value"].getValue(), 20 )

def testOptionEditFromDefaultValueMetadata( self ) :

options = GafferScene.Options()
editScope = Gaffer.EditScope()
editScope.setup( options["out"] )
editScope["in"].setInput( options["out"] )
emptyKeys = editScope.keys()

with self.assertRaisesRegex( RuntimeError, 'Option "test:bogus" does not exist' ) :
GafferScene.EditScopeAlgo.acquireOptionEdit( editScope, "test:bogus" )
self.assertEqual( editScope.keys(), emptyKeys )

Gaffer.Metadata.registerValue( "option:test:bogus", "defaultValue", 123 )

self.assertIsNotNone( GafferScene.EditScopeAlgo.acquireOptionEdit( editScope, "test:bogus" ) )
self.assertNotEqual( editScope.keys(), emptyKeys )

if __name__ == "__main__":
unittest.main()
Loading

0 comments on commit bd2491d

Please sign in to comment.