ID 120618 - [RenderOutputUtils] getFlattenedMaterialAttr() can return nodes not connected to any of the given terminals

Follow

Problem summary
RenderOutputUtils::getFlattenedMaterialAttr() is supposed to return a "collapsed" material attribute derived from the material attribute at the given location and all of its parents. As well as a location (actually a geometry producer) it takes a list of terminals.
 
The user expectation is that the list of terminals "filters" the returned material attribute. i.e. specifying "arnoldSurface" as the sole terminal name should return a material that only includes entries for nodes and terminals that are connected to a terminal of type arnoldSurface.

This sometimes breaks because of a optimisations: when the location passed to getFlattenedMaterialAttr() has no parent with a material attribute, getFlattenedMaterialAttr() simply returns the given location's "material" attribute. This means the list of terminals the user gave is effectively ignored.

 

Customer reported version
katanaunsure/unknown

 

Reproduced by support

This bug has been reproduced in:

Katana1.6v3 
Katana2.0v1 
Katana2.0v2

 

Earliest version tested
- This issue appears to be in all versions of the product

 

Expected behaviour
RenderOutputUtils::getFlattenedMaterialAttr() is supposed to return a "collapsed" material attribute derived from the material attribute at the given location and all of its parents. As well as a location (actually a geometry producer) it takes a list of terminals.

 

Actual behaviour
When the location passed to getFlattenedMaterialAttr() has no parent with a material attribute, getFlattenedMaterialAttr() simply returns the given location's "material" attribute. This means the list of terminals the user gave is effectively ignored.

    We're sorry to hear that

    Please tell us why