Skip to content

Commit

Permalink
Clarify input alias logic
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Stone <stonej212@gmail.com>
  • Loading branch information
jstone-lucasfilm authored Apr 30, 2024
1 parent c573ee9 commit c8fb1ec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions python/Scripts/creatematerial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
UDIM_TOKEN = '.<UDIM>.'
UDIM_REGEX = r'\.\d+\.'
TEXTURE_EXTENSIONS = [ "exr", "png", "jpg", "jpeg", "tif", "hdr" ]
TEXTURE_MAPPING = {
"roughness": "specular_roughness"
}
INPUT_ALIASES = { "roughness": "specular_roughness" }

class UdimFilePath(mx.FilePath):

def __init__(self, pathString):
Expand Down Expand Up @@ -112,9 +111,8 @@ def findBestMatch(textureName, shadingModel):
baseTexName = parts[-1]
if baseTexName.lower() == 'color':
baseTexName = ''.join(parts[-2:])

if TEXTURE_MAPPING.get(baseTexName):
baseTexName = TEXTURE_MAPPING.get(baseTexName.lower())
if baseTexName in INPUT_ALIASES:
baseTexName = INPUT_ALIASES.get(baseTexName.lower())

shaderInputs = shadingModel.getActiveInputs()
ratios = []
Expand Down

0 comments on commit c8fb1ec

Please sign in to comment.