CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 11-18-2012, 01:35 AM   #16
ldunham1
Character TD
portfolio
Lee Dunham
Character Rigger
Surrey, United Kingdom
 
Join Date: Feb 2008
Posts: 179
Ah I wouldn't take it personally, I dont think anyone's doubting abilities, I think its more to do with understanding your choices. I understand your reasoning, as - I'm sure - the others do. I think the objections to using mel, was that you intend it to eventually be used by others as something to extend their own work upon.
Quote:
I'm hoping that the final, final product of all this will be a way for amateurs, students, and small studios to set up pipeline tools capable of being customized down to variable names. The user only has to set up the initial conditions, and the metaPipe will take care of the rest.
My thinking is that the final product, as fantastically useful as it might be, will - in comparison - be limited and hindered.
Either way, good luck, and I'll be interested in following this project's development
__________________
ldunham.blogspot.com
 
Old 11-18-2012, 12:14 PM   #17
haggi
Expert
3d freelancer
 
Join Date: Apr 2004
Posts: 931
Quote:
Originally Posted by katisss
Mel is only good for shelves and AETemplates now.
+1 for python


Even for AETemplates I only use python with pymel, its much more efficient.
__________________
www.renderwiki.com - www.openmaya.net
 
Old 11-18-2012, 04:05 PM   #18
EdtheHobbit
File read in 0 seconds
portfolio
Ed Whetstone
Lighting Artist
Richardson, USA
 
Join Date: Oct 2007
Posts: 664
Send a message via AIM to EdtheHobbit
As an aside, can anyone recommend a good resource for using Python with the API? I'd like to get into some real plugin programming at some point, but I'm still reeling from my last attempt at C++. Baby steps and all that.
 
Old 11-19-2012, 12:23 PM   #19
giordi
Lord of the posts
 
giordi's Avatar
portfolio
Marco Giordano
Creature TD
Double Negative
London, United Kingdom
 
Join Date: Aug 2008
Posts: 618
Quote:
Originally Posted by EdtheHobbit
As an aside, can anyone recommend a good resource for using Python with the API? I'd like to get into some real plugin programming at some point, but I'm still reeling from my last attempt at C++. Baby steps and all that.

http://www.amazon.com/Maya-Python-G...e/dp/0123785782
__________________
My website/blog , with a lot of tips&tricks about maya API,python,and pyqt , and tutorials
www.marcogiordanotd.com
llinkedin
 
Old 11-19-2012, 04:42 PM   #20
EdtheHobbit
File read in 0 seconds
portfolio
Ed Whetstone
Lighting Artist
Richardson, USA
 
Join Date: Oct 2007
Posts: 664
Send a message via AIM to EdtheHobbit
Starting off, I need a way to source in scripts that will be located in sub-directories. This script returns an array of all files with a given extension type in my "metaMel" folder:

Code:
global proc string[] mmel.getFiles(string $fileType){ // * get the local script directory (linux) string $scriptLoc = `internalVar -usd`; string $userLoc = ($scriptLoc + "metaMel/"); // * initial variables string $dirList[]; string $fileList[]; // <- This will be the return string $files[] = (`getFileList -fld $userLoc`); // * test conditions for ending directory search int $end = 0; int $whileCheck = 0; // * loop to find all sub-directories while(!$end){ for($file in $files){ // * check for directory status if(`filetest -d ($userLoc + $file + "/")`){ $end = 0; $dirList[size($dirList)] = ($userLoc + $file + "/"); } } $userLoc = ($dirList[$whileCheck]); $files = (`getFileList -fld $userLoc`); if($whileCheck == (size($dirList) - 1)) $end = 1; $whileCheck++; } // * loop to get all .ext files for($dir in $dirList){ string $dirFiles[] = `getFileList -fld $dir -fs ("*." + $fileType)`; for($file in $dirFiles){ $fileList[size($fileList)] = ($dir + $file); } } return $fileList; }


And this will run a source command for each .mel file that is returned in this way:

Code:
//================= // Source all .mel files in the metaMel directory //================= global proc mmel.metaSource(){ string $melFiles[] = `mmel.getFiles "mel"`; for($file in $melFiles){ string $sourceCommand = ("source \"" + $file + "\""); evalEcho $sourceCommand; } }
 
Old 11-30-2012, 11:08 PM   #21
EdtheHobbit
File read in 0 seconds
portfolio
Ed Whetstone
Lighting Artist
Richardson, USA
 
Join Date: Oct 2007
Posts: 664
Send a message via AIM to EdtheHobbit
read a text file to a string array and single string

Code:
//================= // Read File To Single String, given filePath //================= global proc string mmel.lib.readFileToString(string $filePath){ string $stringArray[] = `mmel.lib.readFileToStringArray $filePath`; string $stringReturn = `stringArrayToString $stringArray "\n"`; return $stringReturn; }


calls mmel.lib.readFileToStringArray:

Code:
//================= // Read File To String Array, given filePath //================= global proc string[] mmel.lib.readFileToStringArray(string $filePath){ int $fileId = `fopen $filePath "r"`; string $lineArray[]; string $nextLine = `fgetline $fileId`; while (size($nextLine) > 0) { string $cleanLine = strip($nextLine); $lineArray[size($lineArray)] = $cleanLine; $nextLine = `fgetline $fileId`; } fclose $fileId; return $lineArray ; }


Next step, find and replace keywords
 
Old 01-19-2013, 11:10 PM   #22
EdtheHobbit
File read in 0 seconds
portfolio
Ed Whetstone
Lighting Artist
Richardson, USA
 
Join Date: Oct 2007
Posts: 664
Send a message via AIM to EdtheHobbit
I've been working on building a new website, and I've been using a CSS compiling language called "LESS" -- it simplifies and extends CSS in some pretty cool ways, but when it reaches your site, it's plain old CSS code.

It's very similar to what I want to do with metaMel - incorporating elements like mixins and variable-variables.

I haven't had any chance to work on metaMel lately, but I'm learning more python (for Houdini, now...) I'm looking forward to leveraging python for a lot of the string parsing stuff
 
Old 04-18-2013, 06:51 PM   #23
EdtheHobbit
File read in 0 seconds
portfolio
Ed Whetstone
Lighting Artist
Richardson, USA
 
Join Date: Oct 2007
Posts: 664
Send a message via AIM to EdtheHobbit
Thought I'd drop by for an update - I actually got pretty darn far with metaMel.

I was able to write a really simple json file, parse it with Python, throw it to the mel-based interpreter, and build nicely-commented procedures for tasks in Maya.

Most of the new development was for the feature film "Free Birds" at RFX, so unfortunately I won't be able to share it.

Almost all of my work right now is Python for NUKE - and I'll be moving to Houdini in a few months, so my time with MEL is pretty much at an end. If I start working on personal projects again, I'll have to break out the dollar-signs and brackets again, but not for a while!
 
Old 04-18-2013, 07:39 PM   #24
giordi
Lord of the posts
 
giordi's Avatar
portfolio
Marco Giordano
Creature TD
Double Negative
London, United Kingdom
 
Join Date: Aug 2008
Posts: 618
Quote:
Originally Posted by EdtheHobbit
Thought I'd drop by for an update - I actually got pretty darn far with metaMel.

I was able to write a really simple json file, parse it with Python, throw it to the mel-based interpreter, and build nicely-commented procedures for tasks in Maya.

Most of the new development was for the feature film "Free Birds" at RFX, so unfortunately I won't be able to share it.

Almost all of my work right now is Python for NUKE - and I'll be moving to Houdini in a few months, so my time with MEL is pretty much at an end. If I start working on personal projects again, I'll have to break out the dollar-signs and brackets again, but not for a while!


hei man just a question , if you use python for other software is still worth for you to go back to mel? I mean i jumped on houdiny latelty and i could resue all my pyqt ui and custom widget without need to blink
__________________
My website/blog , with a lot of tips&tricks about maya API,python,and pyqt , and tutorials
www.marcogiordanotd.com
llinkedin
 
Old 04-18-2013, 07:47 PM   #25
ldunham1
Character TD
portfolio
Lee Dunham
Character Rigger
Surrey, United Kingdom
 
Join Date: Feb 2008
Posts: 179
cheers for keeping us in the loop!
__________________
ldunham.blogspot.com
 
Old 04-18-2013, 07:47 PM   #26
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:17 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.