Autodesk / sitoa

Arnold plugin for Softimage
Apache License 2.0
33 stars 16 forks source link

xsibatch can't find shaders defined in ArnoldShaderDef.js #77

Closed JenusL closed 5 years ago

JenusL commented 5 years ago

As of right now, only physical_sky is defined in ArnoldShaderDef.js and that fails silently when rendering with xsibatch on Windows. Tested with testsuite, RoyalRender and just manual command. They all fail. Why would this happen? Is it a known limitation of some sort? @caron Do you have any idea?

JenusL commented 5 years ago

The only piece of code I could find to explain this is shown below but I see no reason that wouldn't work... https://github.com/Autodesk/sitoa/blob/52a0a4b35f51bccb6223a8206d04b40edc80071c/plugins/sitoa/sitoa.cpp#L103-L113

caron commented 5 years ago

Can you explain the behavior a bit more so I can reproduce?

JenusL commented 5 years ago

Can you explain the behavior a bit more so I can reproduce?

Just try and render a scene that have a physical_sky shader. The shader will not be exported to Arnold when rendering with xsibatch. physical_sky is a special case where it exits early in auto shaderdef code for it to be manually defined in ArnoldShaderDef.js. https://github.com/Autodesk/sitoa/blob/52a0a4b35f51bccb6223a8206d04b40edc80071c/plugins/sitoa/loader/ShaderDef.cpp#L554-L555 So far I've been unable to find why it's not working.

caron commented 5 years ago

OK, I will try it later tonight.

JenusL commented 5 years ago

So here's what I've found so far.

This is the only thing that differs the two. Good news is that I think I have a work around, but I'm still not sure why the reverse load order is causing the shaders defined in ArnoldShaderDef.js to fail in batch.

JenusL commented 5 years ago

I made a fix for this but shaders that are defined in ArnoldShaderDef.js needs to be explicitly skipped in ShaderDef.cpp. See the above commit for the fix.

JenusL commented 5 years ago

I should note that in the process I removed most of the manual define of physical_sky from ArnoldShaderDef.js. Only the extra buttons at the bottom and the logic is defined there now, and the rest is handled by the auto shaderdef. Now, only set_parameter is defined in js.