QUOTE(uiron @ 02/27/09, 03:41 PM) [snapback]301869[/snapback]
the problem with me vs mel is that when it comes to programming, i just cannot degrade back to procedure&shell-like code structure, not just because i don't want, but also because i just have to change my whole logic of organizing the code - a scar from those years of delfi, c, java, php and the like.
Yes, that is unfortunate yes. You allways get theese things no matter what code you do. Thats why you try to get on with a good design pattern that might attack the problem.
This said you might succeed in passing the maya shell a refenece to your object by declaring it global. Then just execute that. Its a ugly hack but should work.
so in essence
do you stuff...
global passMe
passMe=yourObject
om.MGlobal.executePythonCommand("global passMe;passMe.execute()",False,True)
Might work didnt test.
QUOTE
when i started coding for maya (since 8.5, this makes me quite a maya newbie), i had to choose between learning python and learning mel. i went for python as this was like, "hey, if that's officially supported by software developer, why not?". i still don't regret the decision - having API at hand, scripted custom nodes, etc really paid off.
Well yes i dont doubt that. But had you taken mel + python approach youd probably been even better off. It snot liek i ddnt say learn BOTH.
The problem with pure python approach is that you see a lot of people actually doing lot of code because they now can. Without much tough in what code they should do. Ive actually seen studios with a year worth of code on something ultimataly maya allready had, and it was better implemented in maya. Mel puts your thinking cap into how maya works, and not how coding is done. But for api its actually good, tough i only do stuff there to prototype my code it allways end s up being full c++ at the end of the day. Keeping things that are sepatrate separated keeps me better focused. As a result you sometimes see me doing things others would never even attempt, failure is always better than success. And extraordinary success comes at a price of not being afraid of failure.
Its allways easy to accept the piece of advice thet seems nicer. Than the longer better advice especially if it is sems good to begin with.