background preloader

MEL

Facebook Twitter

Animating 2D Eyes From a Texture in Maya. Maya and QT Tutorial. I wasn’t sure if I should put this in it’s own new section or not, so for now I’ll leave it as a post and move it later if I feel the need. :) After a rather harrowing weekend I decided that I’d follow through on my promise of a Maya/Mel/QT tutorial, so here it is!

Maya and QT Tutorial

So without further ado, here we go: So today we’re going to go through how to make a basic qt interface. What we’re going to be creating is an interface that will do 4 things: Get user input to name an objectList all the user objectsUse a combo box to create an objectRename an object from the list box. Introduction to MEL Scripting in MayaLT - Part 2: Creating a Per-Face Instancing Tool. Maya Mel - Berniewiki. From Berniewiki add edge loops from single selected rings edges string $singleEdges[] = {}; string $sel[] = `ls -sl -fl`; for($o in $sel){ select -r $o; SelectEdgeRingSp; polySplitRing -ch 0; string $sel2[] = `ls -sl -fl -hd 1`; $singleEdges[size($singleEdges)] = $sel2[0]; } select -r $singleEdges; Hide things that are not in control balls Add .455 gamma to fileTextures.

Maya Mel - Berniewiki

Creating procedural terrain - Part 3: UI development with Qt Creator. Maya mel. Loops forfor inwhiledo whileswitch for The for loop is mainly used to run commands on the values of an array.

maya mel

A for loop mainly consists of: for(initial execution; test condition; execute after each loop) {operation;} string $myArray [] = {"one","two","three","four"}; int $myArraySize = size($myArray); for ($i =0; $i<$myArraySize; $i++) { if ($myArray[$i] == "one") print ("\n"+$myArray[$i] + " dead roach! ") returns: one dead roach! In this example I included an imbedded funcion of mayas called size(). Mel - Quick Reference II. Week 03 MEL for modeling - SM3122_06.pdf. Maya mel. MEL Commands. Maya mel. Operators Assignment OperatorArithmetic OperatorsBoolean OperatorsRelational OperatorsComparisson OperatorsLogical OperatorsPrecedence Logical Operators Use logical operators when you want to compair two or more values. || or a || b && and a && b !

maya mel

Not 1a here is an example using the and plus the or operator if(( 2 < 3 && 3 > 1 ) || ( 2>0 && 0>-1 )) print "this is true"; else print "this is false"; In this example we use the not operator if(! Mel Script - User Interface Controls. Mel - Quick Reference I. Variables in mel. Mel - Querying UI Widgets. GUI layouts in mel. Form layout: This is the most powerful of the layouts in terms of specifying exact positions of controls.

GUI layouts in mel

Use of this layout consists of first defining the controls in the layout, and then using the -edit flag to set the positions of each control. See the command reference for many options of attaching controls relative to one another in addition to using the window edges in this example: Mel Script - User Interface Controls.

EXT_COMMAND_MEL

Mel - Quick Reference I. MEL - Interfaces. Introduction The entire interface of Maya is built from MEL scripts.

MEL - Interfaces

So it should be obvious that there are numerous possibilities within MEL to create interfaces. Creating an interface for your MEL script can be important, as it can increase the useability and application of your script considerably. Scripts are often (small) tools to aid in modeling, texturing, lighting, animating, etc. These tools have an user interface (UI) in most cases to increase their ease of use. Window We start by creating a new window to show our interface window -t "Window Title" MyWindow; This command creates a standard window with title 'Window Title' and (internal) object name MyWindow. If you execute the script to create a window again, you'll get an error, as the window already exists: // Error: line #: Object's name is not unique: MyWindow // You can't create two windows with the same name. Layouts All elements in your interface must be placed within a Layout. MEL - Writing scripts. Commands You can enter MEL commands in the Script Editor.

MEL - Writing scripts

If you want to execute your command (or commands), you need to press Ctrl + enter (or the enter of your numpad). When you just press enter without crtl, the cursor will go to a new line. A script really is just a list of commands which are executed one by one (from top to bottom) once you execute the script (Ctrl + enter). In a bit you'll see various ways to influence which commands in your script are executed (which should be skipped or repeated).

Command reference The list of commands may seem endless at first and the number of options for each command is even longer. Mel - Quick Reference II. Variables in mel. M a c a r o n i K a z o o. Python lets you abstract the existing maya UI script functions in ways that let you write UI that just isn’t possible to do using mel.

m a c a r o n i K a z o o

The following page goes over some powerful UI abstraction classes. These classes can be found here. If you open up the script you’ll see a bunch of classes that should sound familiar. For the most part they’re wrappers around existing script commands. For example: MelFormLayout is a wrapper around the formLayout script command. But its not just about more succinct and convenient syntax. NOTE: all examples below you should be able to copy paste into the script editor in maya and run them to see a working example. UI Parenting Normal maya UI is parented using a state based system. One of the biggest differences with baseMelUI is that the classes it defines require you to explicitly specify a parent when you instantiate a widget.

Layouts At the time of writing most of the mel layout controls have been wrapped. Encapsulating UIs Don’t Use Doc Tags! Subclassing. MEL How-To #95. You only have to use Maya for a few minutes to become acquainted with MEL, the embedded scripting language Maya uses.

MEL How-To #95

Every function Maya performs is echoed in a MEL command whether it be a simple selection, adjusting Soft Body weights or programming a complex shader network. You’ll soon realize that it is necessary to delve deep into this integral system to harness Maya’s power. Note: This article was originally written in November 1998. Maya has changed a lot since then, and I apologize for any information appearing below that is now out-of-date. I accept any comments or questions to: maya@ewertb.com. MEL UI Layouts. Introduction Layouts determine how all the elements in a window should be placed.

MEL UI Layouts

You can combine and nest several types to make complex layouts. Various Maya MEL Scripts....