prman-pixar / RenderManForBlender

RenderMan for Blender render addon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when connecting RGB shader node output to Bxdf input

erjiang opened this issue · comments

OS: Linux
Blender 3.6.2
Renderman for Blender 25.2.0

To reproduce:

  1. Create a new material with Renderman node tree
  2. Add a PxrTexture node
  3. Connect the resultRGB output of the PxrTexture node directly to the Bxdf input of the RenderMan material node

Expected:

Error message OR black/null shader OR texture RGB used as the shader result

Actual:

Blender crashes with the following output in the logs:

WARN (bpy.rna): source/blender/python/intern/bpy_rna.c:8420 bpy_class_call: unable to get Python class for RNA struct 'RendermanShadingNode'
Segmentation fault (core dumped)

@erjiang

Can you see if the patched file works for you? This should go into your local directory in:

RenderManForBlender/rman_bl_nodes

rman_bl_nodes_shaders.zip

The modified file works and handles the error. Thanks for the fix!

I take that back. It seems I can no longer connect the resultF of a PxrFacingRatio node to the topA input of a PxrBlend.

Can you revert the change that I gave you in #690 690? ? I think the fix for that conflicts with the fix needed for this one.

Can you revert the change that I gave you in #690 690? ? I think the fix for that conflicts with the fix needed for this one.

You are right, that was my mistake. This patched file does not cause the problem I just described.

OK, thanks.

re: #690

Unfortunately, this seems to be a limitation of Blender.

We're using a custom class for our node sockets. There doesn't seem to be any way to change the socket's type property when using a custom class. Custom node sockets all get set as 'VALUE' for its type. The group node seems to use this property to figure out what kind of socket it should add for its input/output. If you try to explicitly set the type property, the socket reverts back to the base NodeSocketFloat class, and we lose our custom properties.

We cannot use the base Blender node socket classes, because we want to be able to add our own properties, and override the draw methods for the class. The only thing I can think of that might fix this is to create our own custom group node, but that would be a significant change, and I'm not sure if that will fully solve this.

In any case, can you try this patch and see if fixes this issue for you? Please revert whatever you had before, before applying this.

patch.zip

In any case, can you try this patch and see if fixes this issue for you? Please revert whatever you had before, before applying this.

patch.zip

Yes, that patch seems to fix the issue by popping up an error when trying to connect color output to shader output.

Thanks for confirming.