Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cycles UI Improvements for 1.4 #5847

Merged
merged 3 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Improvements
-----------

- Arnold : If it exists, an `ai:volume` attribute is preferred over an `ai:surface` attribute when resolving shaders for volumes.
- Cycles :
- Updated the UI of Cycles shaders and lights for ease of use and to match Blender conventions.
- Hide certain parameters based on UI selections.
- Renamed and reordered parameters and created sections to match Blender.
- Changed all the Cycles items in the Gaffer tab menu to title case.

Fixes
-----
Expand Down
6 changes: 5 additions & 1 deletion python/GafferCyclesUI/ShaderMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ def appendShaders( menuDefinition, prefix="/Cycles" ) :
# Build a list of menu items we want to create.

menuItems = []
original = [ "Hsv", "Rgb", "Xyz", "Bw", " To ", "Aov", "Uvmap", "Ies", "Bsdf", "Non Uniform" ]
replacement = [ "HSV", "RGB", "XYZ", "BW", " to ", "AOV", "UV Map", "IES", "BSDF", "Nonuniform" ]

for shader in GafferCycles.shaders :
shaderName = str( shader )
displayName = " ".join( [ IECore.CamelCase.toSpaced( x ) for x in shaderName.split( "_" ) ] )
for x, y in zip( original, replacement ) :
displayName = displayName.replace( x, y )
category = GafferCycles.shaders[shader]["category"]
menuPath = "Shader"

Expand All @@ -72,7 +76,7 @@ def appendShaders( menuDefinition, prefix="/Cycles" ) :
nodeCreator = functools.partial( __lightCreator, lightName, GafferCycles.CyclesLight )
menuItems.append( MenuItem( "%s/%s" % ( menuPath, displayName ), nodeCreator ) )

menuItems.append( MenuItem( "%s/%s" % ( "Light", "MeshLight" ), GafferCycles.CyclesMeshLight ) )
menuItems.append( MenuItem( "%s/%s" % ( "Light", "Mesh Light" ), GafferCycles.CyclesMeshLight ) )

# Create the actual menu items.

Expand Down
4 changes: 0 additions & 4 deletions startup/GafferCycles/principledBSDFCompatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,3 @@ def getItem( self, key ) :
return getItem

GafferCycles.CyclesShader.__getitem__ = __cyclesShaderGetItem( GafferCycles.CyclesShader.__getitem__ )

# The parameter defaults advertised by Cycles do not always match the actual defaults used by Blender.
# Register user defaults with Blender's values where it makes sense.
Gaffer.Metadata.registerValue( "cycles:surface:principled_bsdf:specular_ior_level", "userDefault", 0.5 )
7 changes: 0 additions & 7 deletions startup/GafferCycles/userDefaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,3 @@
##########################################################################

import Gaffer

# Correction for Blender's Z-up default mapping.

Gaffer.Metadata.registerValue( "cycles:surface:environment_texture:tex_mapping__scale.x", "userDefault", -1.0 )
Gaffer.Metadata.registerValue( "cycles:surface:environment_texture:tex_mapping__y_mapping", "userDefault", "z" )
Gaffer.Metadata.registerValue( "cycles:surface:environment_texture:tex_mapping__z_mapping", "userDefault", "y" )

Loading
Loading