Arnold and Renderman shaders created in C++ MPxCommand do not show in Hypershade

Arnold and Renderman shaders created in C++ MPxCommand do not show in Hypershade

Anonymous
Not applicable
629 Views
1 Reply
Message 1 of 2

Arnold and Renderman shaders created in C++ MPxCommand do not show in Hypershade

Anonymous
Not applicable

Standard Maya shaders created by their specific function set inside a MPxCommand plugin show up in Hypershade.

Shaders for Renderman and Arnold, which have to be  created by name with


MDGModifier dgMod;
MObject Shader = dgMod.createNode("aiStandardSurface",&stat);

 

do not show up in Hypershade, though the Arnold ones work fine. But they can't be edited in Hypershade.

 

I found - 

"The command creates the ‘blinn’ node, connects its ".message" attribute to the ".shaders" attribute on the defaultShaderList1 node -
 this registers the node as a shader."

 

It said the mel shader command (and the Maya specific shader function sets) both create the node and add it to a shader list so the UI will recognize it as a shader.

 

In Maya 2017 defaultShaderList1 does not seem to exist. I can not find this node by name.

 

So how does one tell Maya that a shader node for an add on renderer is in fact a shader node so it will appear in Hypershade and the user can edit it?

Thanks

0 Likes
Accepted solutions (1)
630 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

SOLVED

I was able to use the MEL shaderNode command with the -asShader flag to create the new nodes with a given name.

Then back in C++ I search for the node by name and then proceed with setting it up.

And now they are all visible in Hypershade.

0 Likes