我正在使用Apple提供的usdz python脚本v0.61。我曾经以为,更改createMaterial中的材质设置会更新生成的usdz文件-例如,粗糙度为1应该使其非常粗糙。但是,这似乎没有什么区别,并且生成的模型仍然有光泽吗?
def createMaterial(params, materialName):
matPath = params.materialsPath + '/' + materialName
if params.verbose:
print ' creating material at path:', matPath
if not Sdf.Path.IsValidIdentifier(materialName):
usdUtils.printError("failed to create material by specified path.")
raise usdUtils.ConvertError()
surfaceShader = UsdShade.Shader.Define(params.usdStage, matPath + '/Shader')
surfaceShader.CreateIdAttr('UsdPreviewSurface')
surfaceShader.CreateInput('metallic', Sdf.ValueTypeNames.Float).Set(0)
surfaceShader.CreateInput('roughness', Sdf.ValueTypeNames.Float).Set(1)
usdMaterial = UsdShade.Material.Define(params.usdStage, matPath)
usdMaterial.CreateOutput('surface', Sdf.ValueTypeNames.Token).ConnectToSource(surfaceShader, 'surface')
params.usdMaterials[matPath] = usdMaterial
params.usdMaterialsByName[materialName] = usdMaterial
return usdMaterial