PDA

View Full Version : PyMEL 0.9 Released


Chadrik
03-18-2009, 05:07 AM
PyMEL 0.9 is out. With over a year's worth of development since the last major release, PyMEL 0.9 represents a dramatic leap forward in the evolution of python in Maya.

download: http://www.highend3d.com/maya/downloads/tools/syntax_scripting/4844.html

documentation: http://pymel.googlecode.com/svn/docs/index.html

pymel + ipython demo: http://www.youtube.com/watch?v=EaIT8czZrlo

-chad

ewerybody
03-19-2009, 12:49 PM
Hey Chadrik!!

Hooray! I really appreciate your work on that! I't really appealing! And no question: I'm SO jealous of the comfort you put in there. Its really looking straightforward and is a blessing to read.

Unfortunately I still couldn't use it as our complete toolkit is already setup on Mel for years.
and.. I hope you can forgive me but I think you put old dirty Mel into a lousy light at the comparision. So here is a little overwork. I could crunch it to 8 lines less. :D

for ($x in `ls -type transform`) {
print (longNameOf($x) + "\n");

// make and break some connections
connectAttr( $x + ".sx") ($x + ".sy");
connectAttr( $x + ".sx") ($x + ".sz");
disconnectAttr( $x + ".sx") ($x + ".sy");
for ($inputPlug in `listConnections -s 0 -d 1 -p 1 ($x + ".sx")`)
disconnectAttr ($x + ".sx") $inputPlug;

// add and set a string array attribute with the history of this transform's shape
if (!objExists($x + ".newAt"))
addAttr -ln newAt -dataType stringArray $x;
string $history[] = listHistory (`listRelatives -s $x`);
string $elements = "";
for ($elem in $history)
$elements += "\"" + $elem + "\" ";
eval ("setAttr -type stringArray " + $x + ".newAt " + size($history) + $elements);

// get and set some attributes
setAttr ($x + ".r") 1 1 1;
vector $trans = getAttr ($x + ".t");
vector $scale = getAttr (".s");
$trans *= $scale; // vector math as well
setAttr ($x + ".scale") ($trans.x) ($trans.y) ($trans.z)
myMelScript( `nodeType $x`, $trans );
}

Please don't get me wrong! :bowdown:
I completely agree: Even this code is just badly readable compared to the pymel version. And you pointed out a very good example of mel-screwup with the stringarray-example!! Its just ridiculous.

I hope I find time to checkout this one privately soon.
Thanks so much for this great contribution to the maya opensource scripting community :]

Cheesestraws
03-19-2009, 01:00 PM
Any chance of twisting Autodesk's arms to include a version of this with the default Maya install? :p

I would not want to end up somewhere that used the default Maya python implementation.

Chadrik
03-19-2009, 07:07 PM
I'm slowly twisting :)

CGTalk Moderation
03-19-2009, 07:07 PM
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.