Skip to content

Commit

Permalink
Handle roughness to take specular_roughness as a default
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelredaa committed Feb 14, 2024
1 parent e9e103a commit e4e1fc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/Scripts/creatematerial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
UDIM_TOKEN = '.<UDIM>.'
UDIM_REGEX = r'\.\d+\.'
TEXTURE_EXTENSIONS = [ "exr", "png", "jpg", "jpeg", "tif", "hdr" ]

TEXTURE_MAPPING = {
"roughness": "specular_roughness"
}
class UdimFilePath(mx.FilePath):

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

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

shaderInputs = shadingModel.getActiveInputs()
ratios = []
for shaderInput in shaderInputs:
Expand Down

0 comments on commit e4e1fc7

Please sign in to comment.