Skip to content

Commit

Permalink
CameraTweaksUI : Make new tweaks with Create mode by default
Browse files Browse the repository at this point in the history
This is more appropriate now that `Replace` mode errors if the parameter doesn't exist.
  • Loading branch information
johnhaddon committed May 7, 2024
1 parent 2dd7c50 commit 16ea3df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/GafferSceneUI/CameraTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __registerCameraParameters() :

def creator( name, value ) :

tweak = Gaffer.TweakPlug( name, value )
tweak = Gaffer.TweakPlug( name, value, Gaffer.TweakPlug.Mode.Create )
tweak.setName( name )
return tweak

Expand Down Expand Up @@ -230,7 +230,7 @@ def __menuDefinition( self ) :
else :

def creator( plugType ) :
tweak = Gaffer.TweakPlug( "", plugType() )
tweak = Gaffer.TweakPlug( "", plugType(), Gaffer.TweakPlug.Mode.Create )
tweak.setName( "tweak1" )
return tweak

Expand Down
5 changes: 3 additions & 2 deletions startup/GafferArnoldUI/cameraTweaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

def __tweakCreator( plugName, parameterName, parameterValue ) :

tweak = Gaffer.TweakPlug( parameterName, parameterValue )
tweak = Gaffer.TweakPlug( parameterName, parameterValue, Gaffer.TweakPlug.Mode.Create )
tweak.setName( plugName )
return tweak

Expand All @@ -56,7 +56,8 @@ def __shutterCurveTweakCreator() :
[ ( 0, 0 ), ( 0.25, 1 ), (0.75, 1 ), ( 1, 0 ) ],
Gaffer.SplineDefinitionInterpolation.Linear
)
)
),
Gaffer.TweakPlug.Mode.Create
)
tweak.setName( "shutterCurve" )
return tweak
Expand Down

0 comments on commit 16ea3df

Please sign in to comment.