So it turns out the fancy formatting in the Maya attribute editor (shader ramps, colour choosers, file browsers, etc) are actually defined in MEL templates, found in the Maya/Scripts/AETemplates folder. The following is a quick example of how these are written.
Today's problem:
My attributes are showing up, but I'd like them to appear a little more intuitive.
Today's solution:
Granted the node isn't particularly dense so far: even lights seem to have hundreds of attributes. My assumption going into node scripting was that the layout of attributes would be coded along with the rest of the node: in the Python/C++ plugin. I had not read anything to suggest otherwise, and it was only after asking around a forum that I was directed to the Attribute Editor Templates.
If you're familiar with MEL the following will be pretty easy for you. Hell, if you're writing a custom node for Maya, this should be trivial. Here's my template until I develop the node further:
The following is saved as AEADANodeTemplate.mel, the format being AE<node_name>Template.mel. Still looking for a good html syntax highlighter.
- {
- editorTemplate -beginScrollLayout;
- //File Attributes
- editorTemplate -beginLayout "File Attributes" -collapse 0;
- editorTemplate -addControl "input";
- editorTemplate -endLayout;
- //Amplitude
- editorTemplate -beginLayout "Amplitude" -collapse 0;
- editorTemplate -addControl "amplitudeL";
- editorTemplate -addControl "amplitudeR";
- editorTemplate -endLayout;
- AEdependNodeTemplate $nodeName;
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
- }
Starting to look a bit more like a real Maya node!
No comments:
Post a Comment