Selected Courses on Digital Art-UOWM

30 Απριλίου 2013

da-maya-mel

Filed under: MAYA — admin @ 10:13
maya software (g.   ?)

open maya- open maya window- primitives-code
(mention vrml)

*from wiki which is a great open source library …unfrtntly maya isnt

mel

The Maya Embedded Language (MEL) is a scripting language used to simplify tasks in Autodesk’s 3D Graphics Software Maya
Most tasks that can be achieved through Maya’s GUI can be achieved with MEL, as well as certain tasks that are not available from the GUI. MEL offers a method of speeding up complicated or repetitive tasks, as well as allowing users to redistribute a specific set of commands to others that may find it useful.
MEL is syntactically similar to Perl and Tcl. 
It provides some memory management and dynamic array-allocation, and offers direct access to functions specific to Maya. The majority of standard Maya commands are default MEL scripts, saved in the Maya Program Files directory.
MEL is fairly limited compared to mainstream scripting languages. Mel is primarily a language meant to journal the Maya session, thus lacks many advanced features such as associative arrays. Python was added to Maya as an alternative to MEL in Maya 8.5. Still MEL offers some advantages to Python:
  • Discoverability of MEL is better since the built-in command echo server was created with MEL in mind.
  • A lot of legacy code and inner working of Maya is in MEL form. This provides many insights into undocumented inner workings of Maya.
MEL is often criticized for its lack of programming features, and object orientation. In practice however MEL is used as a metaprogramming language where MEL just instructs Mayas node architecture to solve the problem. 
Since nodes form the actual computational core of Maya using a more robust readily apparent programming method would be many times the wrong approach. In many ways MEL complements the Maya API, with somewhat clear boundaries between allocated tasks. This makes MEL harder to learn and fully understand.

Applications of MEL

The tools designed using MEL Scripts generally come under the following categories.
  • Data I/O
  • Motion capture data import
  • Proprietary game data export
  • Scene meta-data for production tracking
  • Geometry creation/modification
  • Custom primitives
  • Third-party renderer specific data type (e.g., RenderMan sub-divisional surfaces)
  • Modeling tools not offered in the base package
  • Animation tools
  • Muscle simulators
  • Rigging/setup controls
  • Crowd AI behavior
  • Lighting /rendering tools
  • Automatic creation of common complex shader setups
  • Pre- and post-render effects
  • Making calls to third-party renderers
  • Dynamics
  • Custom particle behavior
  • Simulated object emergent flocking and swarming
  • Genetic algorithms
  • Cloth simulation
  • File and folder scene setup and maintenance
  • User interface customization
  • Custom character controls
  • Removal of invalid Maya commands
  • Custom UIs

[edit]Example

This is an example of a script which copies a selected object through its path:
// animated duplicates/instances script
proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance)
{
int $range_start = $rangeStart;
int $range_end = $rangeEnd;
int $num_of_duplicates = $numOfDuplicates;
int $step_size = ($range_end - $range_start) / $num_of_duplicates;
int $i = 0;
int $temp;

currentTime $range_start; // set to range start

string $selectedObjects[]; // to store selected objects
$selectedObjects = `ls -sl`; // store selected objects
select $selectedObjects;

while ($i <= $num_of_duplicates)
{
$temp = $range_start + ($step_size * $i);
currentTime ($temp);
// seleced the objects to duplicate or instance
select $selectedObjects;
if($duplicateOrInstance == 0)
{
duplicate;
}
else
{
instance;
}
$i++;
}
}
 // Usage example:
// duplicate the current selection 5 times --
// evenly distributed between frame 1 and 240
animatedDuplication(1, 240, 5, 0);

Maya Links
WarpCat26 July 2012 (created 1 July 2007)
Quality links you should know about, having to do with Maya, and mel:

‘Official’:

These sites appear to be down, or lost to the Autodesk takeover.


‘Unofficial’:

‘Books’
http://artixel.wordpress.com/category/mel/

Δεν υπάρχουν Σχόλια »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

error: Content is protected !!