Maya Custom node and Shader assignment (C++)

Hey guys !

I’m working on a custom hair procedural, that works already as a USD payload, but I would like to have it work as a native Maya node. I have it implemented as a MPxLocatorNode with a MPxDrawOverride for viewport display. I currently draw the curves in the viewport with UI drawables (lines). I have a couple of blockers I was not able to figure out :

  • My custom node can’t be assigned a material, the shading group rejects it. Should i derive from something else than MPxLocatorNode to have the node accepted by shading groups ?
  • (Optional) Is there anything exposed in the API to draw the curves as hair like xgen ? Or do i need to re-invent the wheel ?
  • (Optional) Should I need to redo the hair drawing myself, I assume i’ll need to plug some custom geometry/fragment shaders, where is the access point for this ?

I do not care about VP1.0 compatibility, and it’s okay if it’s only OpenGL compatible.
I have checked the docs but could not find clear answers to these.

The main thing is having the node be able to be assigned a material (even if it doesn’t display it in the viewport). The main goal is to drive a MtoA procedural/extension (which i already have working).

Thanks !