Skip to content

Commit

Permalink
ShaderUI : Mark type plug as read-only
Browse files Browse the repository at this point in the history
As with `name`, it is already considered read-only because `loadShader()` should be used to set it and load all the associated parameters at the same time. Marking it as read-only via metadata prevents the "Revert to Defaults" menu item from clobbering it, which previously was breaking the shader completely.

Also updated documentation to make use of Markdown code formatting.

Fixes #1862
  • Loading branch information
johnhaddon committed Aug 6, 2024
1 parent a293f3c commit a48851f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Fixes
- Arnold : Fixed bug preventing UI metadata for Imagers from being loaded for Arnold 7.3.
- WidgetAlgo : Fixed issue preventing `grab()` from capturing popup menus on Windows.
- ShowURL : Fixed opening of "file://" URLs on Windows (#5861).
- Shader : Fixed "Revert to Defaults" menu item in NodeEditor (#1862).

API
---
Expand Down
5 changes: 3 additions & 2 deletions python/GafferSceneUI/ShaderUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __parameterUserDefault( plug ) :
"description",
"""
The name of the shader being represented. This should
be considered read-only. Use the Shader.loadShader()
be considered read-only. Use the `Shader.loadShader()`
method to load a shader.
""",

Expand All @@ -107,10 +107,11 @@ def __parameterUserDefault( plug ) :
"description",
"""
The type of the shader being represented. This should
be considered read-only. Use the Shader.loadShader()
be considered read-only. Use the `Shader.loadShader()`
method to load a shader.
""",

"readOnly", True,
"layout:section", "",
"nodule:type", "",
"plugValueWidget:type", "",
Expand Down

0 comments on commit a48851f

Please sign in to comment.