3

I would like to create an empty node in Maya (mel language), in which I can store my attributes (visible to the end-user).
The reason why I would need an empty node, is because I don't need any locator information or additional standard Maya information, just a couple of my custom attributes. to be visibl in the node.

createNode "<What_type_should_I_put_here?>" -n "MyCustomEmptyNode";
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89

3 Answers3

6

scriptNode is a good one for non physical objects. You can also use the scriptNode's open and close functions to do initialization.

I also like partition nodes - createNode('partition'). They show up in the outliner but without having a physical presence in the scene. They have the same attributes as asset containers so you can add a bit of metadata (like user name and time created) without extra work.

For transforms, createNode ('transform') makes and empty group. You can lock-and-hide all the attribs, but you'll still have them in the attribute editor. Sometimes I use a single locked-and-hidden transform with a display override set to reference as a hierarchy parent for untouchable objects like rigging innards. Asset nodes are transforms but with some extra facilities (like auto-hiding their contents) and make a good stash for other nodes.

You can also store the information into the file without a node by using fileInfo (link in python, but the idea is the same). This is great for static data that doesn't need to be connected to the scene graph. It's more useful in python where you can encode more complex data using standard tools.

theodox
  • 12,028
  • 3
  • 23
  • 36
4

Any non-dag node type will be fine. You can call the command allNodeTypes to see the full list. There are hundreds, and some are better than others.

At one point I was using unknown thinking it would be a good base, but changing format between .ma and .mb gave errors.

Since then I've started using scriptNode, since it can help remind me that my script made it. I leave the included attributes blank and add my own.

mhlester
  • 22,781
  • 10
  • 52
  • 75
3

You could also have a look at the "network" nodeType, as it has very little overhead in terms of default attributes... And there is very little chance one already exists in your scene if you don't use third party plug-ins/tools...

  • i like this better than a scriptNode, which is def not supposed to be used for this and is commonly used by maya and many plugins – ninhenzo64 Nov 29 '22 at 15:03