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

[BUG] No src attribute on material.interface child #31

Open
skarone opened this issue Jan 13, 2023 · 0 comments
Open

[BUG] No src attribute on material.interface child #31

skarone opened this issue Jan 13, 2023 · 0 comments

Comments

@skarone
Copy link

skarone commented Jan 13, 2023

When trying to write with the UsdMaterialBake node, I get this error:

[INFO python.LookFileBakeAPI.LookFileBaker]: Writing pass 'default'
Traceback (most recent call last):
  File "LookFileBaker.py", line 649, in bake
  File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/plugin/Plugins/usdExport.py", line 508, in writeSinglePass
    writePassData(stage, rootPrimName)
  File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/plugin/Plugins/usdExport.py", line 412, in writePassData
    materialDict)
  File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/plugin/Plugins/usdExport.py", line 275, in writeMaterialAttribute
    WriteMaterial(stage, sdfLocationPath, materialAttribute)
  File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/lib/python/UsdExport/material.py", line 177, in WriteMaterial
    AddMaterialInterfaces(stage, parameters, interfaces, material)
  File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/lib/python/UsdExport/material.py", line 676, in AddMaterialInterfaces
    sourceAttr.getValue()).split(".")
AttributeError: 'NoneType' object has no attribute 'getValue'
[ERROR python.root]: A LookFileBakeException occurred in "LookFileBaker.py": Error writing UsdExport look file: 'NoneType' object has no attribute 'getValue'
    Traceback (most recent call last):
      File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/plugin/SuperTools/UsdMaterialBake/Editor.py", line 100, in <lambda>
        lambda checked : self.__groupNode.bake(parentWidget=self))
      File "/net/pipeline/katana/plugins/KatanaUSD/build/4.5v2/plugin/SuperTools/UsdMaterialBake/Node.py", line 280, in bake
        referenceOp, passNamesAndOps, rootLocations, assetId)
      File "LookFileBaker.py", line 347, in bakeAndPublish
      File "LookFileBaker.py", line 656, in bake
    LookFileBakeException: Error writing UsdExport look file: 'NoneType' object has no attribute 'getValue'

After running this snippet, I found which child attributes have no src attribute:

attr = UI4.FormMaster.AttributeShare.material_interface
no_scr_attrs = []
for interfaceIndex in xrange(attr.getNumberOfChildren()):
    interfaceName = attr.getChildName(interfaceIndex)
    interfaceAttr = attr.getChildByIndex(interfaceIndex)
    hintsAttr = interfaceAttr.getChildByName("hints")
    groupName = None
    if hintsAttr:
        pageAttr = hintsAttr.getChildByName("page")
        if pageAttr:
            groupName = pageAttr.getValue()
    try:
        sourceAttr = interfaceAttr.getChildByName("src")
        sourceShaderName, sourceParamName = str(
        sourceAttr.getValue()).split(".")
    except:
        no_scr_attrs.append(interfaceName)
print no_scr_attrs
['PSSpecularOutputMax', 'PSRefractionIndex', 'PSExtinctionCoefficient', 'PSExtinctionCoefficientOutputMax', 'PSExtinctionCoefficientAtlasStyle', 'PSExtinctionCoefficientColor', 'PSRoughnessExposure', 'CCFaceColor', 'CCFaceColorAtlasStyle', 'CCFaceColorColor', 'CCFresnelExponent', 'SGIrradianceRoughnessColor', 'DLDisplacementType', 'GBPresenceColor', 'AOV3Color', 'AOV3ColorAtlasStyle', 'AOV3ColorColor', 'AOV4Color', 'AOV4ColorAtlasStyle', 'AOV4ColorColor', 'AOV5Color', 'AOV5ColorAtlasStyle', 'AOV5ColorColor', 'AOV6Color', 'AOV6ColorAtlasStyle', 'AOV6ColorColor', 'AOV7Color', 'AOV7ColorAtlasStyle', 'AOV7ColorColor']

Not sure if there are nodes that are not supported, and that's causing the problem.

Any feedback would be much appreciated.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant