Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Adding a button to the attribute editor

Adding a button to the attribute editor

2003-11-20       - By Bryan Ewert

 Back
Reply:     1     2     3  

?from Thu, 20 Nov 2003 11:44:07 -0800

> I was curious if there's an easy way to add a button to the attribute
> editor and call some functionality. Any pointers would be appreciated.

Yep.

The Attribute Editor, like any UI, is built via MEL scripts. The scripts
which build the Attribute Editor are found in:

 /AW/Maya5.0/scripts/AETemplates/

Each nodetype has its own script:

 AE[nodetype]Template.mel

You may either edit these scripts in-place, or override them with a script
in your own scripts folder. Much of the AE is modular. For example, all
shape nodes call AEshapeTemplate() which adds the Display Info and Node
Behavior sections (and a couple others).

Some tips when modifying AE template scripts:

1. Maya initializes the controls for the Attribute Editor _only once_,
   the first time it sees a node of a given type. If you modify
   AEmeshTemplate.mel, for example, the Attribute Editor won't reflect
   the changes immediately. You'll need to do two things:

     source AEmeshTemplate;
     resetAE;

   This works most reliably if the AE is torn off in its own window.

2. For simple attributes, you can simply use:

      editorTemplate -addControl myAttribute;

   and you're done. However, if the UI for the control requires more, err,
   control, then you'll need to use the -callCustom flag.

3. For custom layouts, look into the attr* MEL commands; e.g. attrFieldGrp.
   These have the attribute connection/feedback built into them already, so
   there's less work for you to do.

 4. If the attr* control groups don't satisfy your needs, consider using
    connectControl. If this doesn't work for you either, then you're down
    to handling all of the UI callbacks yourself to synchronize the UI
    with the attribute.

 5. At the end of your "New" procedure for custom control layouts, call
    your "Replace" procedure. The "Replace" procedure is responsible for
    editing the control groups to attach them to the attribute for the
    currently selected node (e.g. via the -attribute flag, or the
    connectControl command). Note that you don't need to perform a
    "ls -sl" at any time; the argument passed into these procedures
    provides the current node for you.

 6. If you use a custom layout for your attribute, add an extra line to
    the template:

       editorTemplate -suppress myAttribute;

    This prevents the attribute from being added in the Extra Attributes
    section.

 7. Your additions need not be restricted to attribute controls. You can
    add buttons or textual information (e.g. a textScrollList) as well,
    if it suits your purpose. How about a custom camera viewport? I'd bet
    money that the boys at Secret Level have an Internet Explorer browser
    docked into their AE somewhere...

It's a bit of work, but it makes for intuitive integration of your tools. I
use custom AETemplates extensively.

--
Bryan Ewert  ?maya@(protected) ?http://www.ewertb.com ?

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
List-help: <mailto:listar@(protected)?Subject=help>
List-unsubscribe: <http://www.highend3d.com/maya/listserver/>
List-subscribe: <http://www.highend3d.com/maya/listserver/>
List-archive: <http://www.highend3d.com/maya/archive/>