ID 427018 - Material Interface parameters with StringAttributes with words do not show correct default values

Follow

Problem summary:

Material interfaces on parameters which are string attributes, and are set to string words (rather than numbers), e.g setValue("GGX",0), rather than setValue("1",0), do not show correct default values.

Steps to reproduce:

  1. Create an example network:
    • 
      rsn = NodegraphAPI.CreateNode('RedshiftShadingNode', parent=NodegraphAPI.GetNode('rootNode'))rsn.getParameter('nodeType').setValue('Material', 0)NodegraphAPI.SetNodePosition(rsn, (-150,0))rsn.checkDynamicParameters()disp = NodegraphAPI.CreateNode('RedshiftShadingNode', parent=NodegraphAPI.GetNode('rootNode'))disp.getParameter('nodeType').setValue('Displacement', 0)disp.checkDynamicParameters()NodegraphAPI.SetNodePosition(disp, (150,0))rsn.getParameter('parameters.refl_brdf').createChildString('hints', repr({'dstName':'Brdf'}))disp.getParameter('parameters.map_encoding').createChildString('hints', repr({'dstName':'MapEncoding'}))nm = NodegraphAPI.CreateNode('NetworkMaterial', parent=NodegraphAPI.GetNode('rootNode'))NodegraphAPI.SetNodePosition(nm, (0, -100))port = nm.addInputPort('RedshiftSurface')dispport = nm.addInputPort('RedshiftDisplacement')rsn.getOutputPort('outColor').connect(port)disp.getOutputPort('out').connect(dispport)mat = NodegraphAPI.CreateNode('Material', parent=NodegraphAPI.GetNode('rootNode'))NodegraphAPI.SetNodePosition(mat, (0, -200))mat.getInputPort('in').connect(nm.getOutputPort('out'))mat.getParameter('action').setValue('edit material', 0)mat.getParameter('edit.location').setValue('/root/materials/' + nm.getName(), 0)
  2. Check whether the initial value is incorrect:
    • 
      >>> param = rsn.getParameter('parameters.refl_brdf.value')>>> param.getValue(0)Beckmann_(Cook-Torrance)
  3. Check the public interface to see if only integer as a string will display properly.
    • This will work:
      • 
        rsn.getParameter('parameters.refl_brdf.enable').setValue(1.0, 0)param.setValue('1', 0)
    • This will not work:
      • 
        param.setValue('GGX', 0)

Expected behavior:

The initial value returned is 0.

Actual behavior:

The initial value returned is Beckmann_(Cook-Torrance).

Additional information:

Other shading node drop-downs are just broken, for example the Map Encoding for the Displacement.
Try changing its value as follows:

This code will show correctly on the shading node, but the public interface will be broken:


disp.getParameter('parameters.map_encoding.enable').setValue(1.0, 0)dispparam = disp.getParameter('parameters.map_encoding.value')dispparam.setValue('Vector', 0)

This code will show an error on the shading node, but the public interface will be broken:


dispparam.setValue('0', 0)

Workaround:

No known workaround.

Tested versions/platforms:

  • 3.2v3 - Affected

Customer version/platform:

Not supplied

    We're sorry to hear that

    Please tell us why