Yes, but that just represents a module on top, nothing says i couldn't write my own parser for mel! Or a wrapper for every function i dont like (and i have several command wrappeers for faster array acces etc)
I can and its as easy as in python, just nobody doing that.
Anyway pymel is much closer to the way I would have made maya python connections but still it is limitted partly by the so straightforward original port.
How the code looks like is actually no concern for me. Code always is ugly no matter what. Only no code is elegant.
Theres However ONE native feature thats is much better in python than in mel and thet is array passing to commands. Aplies to SetAttr specially.
QUOTE(Chadrik @ 01/04/08, 06:42 PM) [snapback]279178[/snapback]
now, joojaa, i know you are a purist who would definitely balk at the mention of mixing these two worlds, but i was wondering what technical reasons you can think of for not doing so? i know that actions performed with api in this way would not be undoable, so that is one thing to consider.
You can potentially break the threading modell, actualy i should have been more specific not like the api cant CALL mel or python script but thats kindof a situation that comes into play only in subset of api development.
Api is designed to do internals of nodes, display drawing and the occasional high performance converter. Now the AIM of it is to make nodes and calling mel isnide a node is INSANELY stupid. However node designers do some kind fo services on top of nodes to make them easier to handle, in commands its sane to use mel or python. But why then put it inside the api why not just call a procedure that resides on disk as script. Read following:
The other way around it represents quite a different problem, undo is one. See the idea of the API is t make a object that builds up in the stack that can then go both ways. Because it lives in the stack as a command. Then why not encapsulate thet stuff intoa command the way i was designed? Thisway you could undo, but as a bonus youd be able to call it in BOTH mel and python. Ok so it can be useful for calculation. But the talkback mechanism of mel is slow anyways, so the real question is. Why not make a node in firtsplace?
So the real question is Why would you want to glob two things that dont overlap? Especially in python because all you need is one extra file and your set. Especially if you use the communication channels designed. Is not much more code but its MUCH more flexible.
The primary concern on all this is: Do we really need one more scripting language, i mean really? Why not just do api stuff with it and be done. The fact that you make something EASY to write doesn't remove the enormous overhead thats associated with it. Easy to code is not equal to good coding in fact its often the opposite.
Let me stress out i dont have anything against python, i just have something against the code degeneration some people use it for. Bad code is bad no matter what you call it. I also have no claim in wich is better, because the fact is it depends on what you aim for.
PS: on a side note you can circumvent some of your problems by making significantly more of pymel commands that you then wrap up to your own style. Id do this but im too busy.
PPS: python modules are one thing that will make python scripts much harder for beginners. And for you to anticipate the python environ in the other end. This will lead you to the most annoying aspect of open source community dependency hunting.