Skip to content

Commit

Permalink
fixup! StandardOptions : Add render:includedPurposes option
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Sep 22, 2023
1 parent e018cd8 commit bf593aa
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions python/GafferSceneUI/StandardOptionsUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ def __cameraSummary( plug ) :
def __purposeSummary( plug ) :

if plug["includedPurposes"]["enabled"].getValue() :
return ", ".join( [ p.capitalize() for p in plug["includedPurposes"]["value"].getValue() ] )
purposes = plug["includedPurposes"]["value"].getValue()
if purposes :
return ", ".join( [ p.capitalize() for p in purposes ] )
else :
return "None"

return ""

Expand Down Expand Up @@ -339,7 +343,8 @@ def __statisticsSummary( plug ) :
"description",
"""
Limits the objects included in the render according to the values of their `usd:purpose`
attribute.
attribute. The "Default" purpose includes all objects which have no `usd:purpose` attribute;
other than for debugging, there is probably no good reason to omit it.
> Tip : Use the USDAttributes node to assign the `usd:purpose` attribute.
""",
Expand Down Expand Up @@ -460,7 +465,12 @@ def __init__( self, plugs, **kw ) :
def _updateFromValues( self, values, exception ) :

self.__currentValue = sole( values )
self.__menuButton.setText( ", ".join( [ p.capitalize() for p in self.__currentValue ] ) if self.__currentValue is not None else "---" )
if self.__currentValue :
self.__menuButton.setText( ", ".join( [ p.capitalize() for p in self.__currentValue ] ) )
else :
# A value of `None` means we have multiple different values (from different plugs),
# and a value of `[]` means the user has disabled all purposes.
self.__menuButton.setText( "---" if self.__currentValue is None else "None" )
self.__menuButton.setErrored( exception is not None )

def _updateFromEditable( self ) :
Expand Down

0 comments on commit bf593aa

Please sign in to comment.