prman-pixar / RenderManForBlender

RenderMan for Blender render addon
MIT License
803 stars 134 forks source link

RfB allows and exports incorrect LamaLayer usage that crashes prman #697

Closed erjiang closed 9 months ago

erjiang commented 11 months ago

RfB allows connecting LamaLayer and LamaSurface in an incorrect way that exports a shader that crashes prman. The docs are not super clear on whether or not there's a distinction between Lama materials and whatever the output of a LamaSurface node is. But connecting a LamaSurface and LamaLayer node in the wrong order is evidently not supported, although connecting e.g. a LamaDiffuse directly to the Bxdf input without a LamaSurface seems to work as expected.

To reproduce:

  1. Create a new material with a Blender Principled BSDF
  2. Convert the Blender Principled BSDF to a RenderMan shader, which creates a tree of Lama mixes.
  3. Check that this material renders OK.
  4. Connect the output of the LamaSurface to the Material Base of a LamaLayer shader, and connect a new LamaDiffuse node to the Material Top.
  5. Connect the output of the LamaLayer node to the Bxdf input of the RenderMan Material node.
  6. Try rendering.

Expected:

Error message saying that LamaSurface should not be input for LamaLayer.

Actual:

segfault in LamaSurface.so

lama-crash.blend.zip lama-crash.rib.zip

prman-pixar commented 10 months ago

Thanks for the report. I will try to add something that will disallow these connections for RenderMan 26.

prman-pixar commented 9 months ago

This should be fixed now when RenderMan 26 becomes available.