[Maya/Python] - Python custom node

This is going to be a very vague ‘is this even possible’ type of question…

Is there anyway (with or without a plugin) that allows for a person to create a custom node in the hypershade which retains Python and has custom out attributes?

So think expression editor, but with Python script encapsulated inside of a node with custom outputs. For instance, put a scriptJob to listen for a specific change, do some ‘math’ and set it up to output that end output variable into a little node nipple out that can then be piped into something else?

Trying really hard to avoid using expressions, here :smiley: - Anything like that?

Also I would like to trademark the phrase “node nipple”.

Best,
9k

You can definitely create plugin nodes, the main drawback is that – like other plug nodes – users will have problems if they try to load your files without your plugin.

Basically you need to investigate the MPxNode class and create a plugin which defines your MPxNode. Here’s an example. Rob’s bookcovers this process

[QUOTE=Theodox;30550]You can definitely create plugin nodes, the main drawback is that – like other plug nodes – users will have problems if they try to load your files without your plugin.

Basically you need to investigate the MPxNode class and create a plugin which defines your MPxNode. Here’s an example. Rob’s bookcovers this process[/QUOTE]

I’m going to check into that! I wasn’t thinking about creating a ‘plug-in’ by definition that would run globally, but a node that retains and executes Python (and that hypothetical node would carry over into any vanilla Maya of the same version). Very interesting. Thank you for pointing me in the right direction.

have you looked into this:

http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/scriptNode.html

The only way to create a true custom node is using a plugin – the exact same code, executed from the listener, won’t work properly.

If you’re a real masochist you could write an expression which tries to execute python and returns the results, but I don’t think will perfrom well if it executes at all.

ScriptNodes will let you run any code you want at scene open and close, but they don’ work like nodes otherwise.