appleseed Users Forum

OSL with Maya


#1

Hi,
since quite long time I have a look at the current state of Appleseed and it’s Maya implementation. My goal is to build a testproject where I can compare and test complex scenes with different renderers.

The idea is to build a Maya plugin shader which only loads the VP2 fragments and has all needed shading attributes. This shader should be translated by the renderer. So I have a python api plugin shader.

Then started with the implementation of my own surface shader in OSL. It only does diffuse at the moment. It works fine in Arnold. It does not work yet in 3delight because of a naming problem I think. In appleseed I set the APPLESEED_SEARCHPATH to my osl directory where the oso file is located.
If I now render I get the message:
appleseed:setting osl shader search paths to C:/daten/install/3d/Appleseed/appleseedMaya/shaders:C:/daten/3dprojects/rendertest/shader/source/osl
This seems to be correct, it points to my shader directory. But the output does not show any sign of my hSurface.oso. It is not registered and then translation of the shader fails: Warning: appleseed:Found unsupported shading node hSurface while exporting network
Before I dig into the git repository, I thought it could be a good idea to ask here.

And thanks for your great work.


#2

Hi,

To load the OSL shader in appleseed.maya you need to add some metadata to the shader. At a minimum, I think you need to add:

int as_maya_type_id = 0x00xxxxxx

and

string as_maya_classification = "drawdb/shader/surface:rendernode/appleseed/surface:shader/surface:swatch/AppleseedRenderSwatch"

IIRC, you also need to add this to the output closure param. I think it was a Maya limitation, shading nodes must have an outColor or outValue attribute.

[[
    string as_maya_attribute_name = "outColor",
    string as_maya_attribute_short_name = "oc"
]]

Check the builtin appleseed shaders.

Est.


#3

Ah, great. Thanks a lot Esteban. It now works as expected.


#4

Hi,

What I posted is the way to make appleseed.maya create new MPxNodes from OSL shaders. But you already have a MPxNode in your plugin, so I am not sure what was wrong before.

Est.