0

I'm trying to write a custom Maya node in Python. Some of the inputs to my node algorithm are images (like height maps). Is there a way to create an image node attribute (whether input or output)?

Right now I'm just using the filenames of the images as string attributes, something like:

MyCustomNode.inImageFilename = tAttr.create("imageName", "i", OpenMaya.MFnData.kString, stringDataObj)

However, I think it'd be much nicer if I could actually display the input image as an input in the node editor. Is there a way to do this?

  • Ordinarily you'd just include an RGB or RGBA or float plug and connect the output of a conventional `file` node -- is there some reason you can't do that? It'll be a lot less work – theodox Apr 03 '19 at 22:19

1 Answers1

0

if you can use the usual image file types, it is much simpler to use the default maya tools. Simply create a color attribute and connect a Maya file nodes outColor to the color input of your node.

haggi krey
  • 1,885
  • 1
  • 7
  • 9