![]() Then it all depends on whether or not you want to go fast. MFnPlugin (obj )Ĭ++ is still the most user-friendly, I think (I’m not saying that because of this examples but in a more general way), which seems logical because that it's the historically used implementation, added to the fact that it remains a language fairly close to machine. That said, I think that this argument is a bit fruitless as even if you script using the Maya API Python binding, once the basics are understood you realize that the differences in syntax between a piece of C++ code and its equivalent in Python are minimal.Ī little example of variable declaration: C++ MFnPlugin fnPlugin (obj ) Python fnPlugin = OpenMayaMPx. I can only invite you to read my mentor’s post on the subject (displaying the C++ equivalent of a MEL code).Īnd finally: Python is a scripting language! Even if it can be “pre-compiled” by the interpreter, it’s still script. ![]() This means you can “batch” your operations (when you have 50 scenes to open to change the value of an attribute, you won’t be laughing so hard! ) ![]() Most Maya function calls are also scripted. Not all software packages offer this (did anyone say XSI?) and Maya is one of the few that boasts it. If I chose the example of the locator, it’s not just because it’s “cool” but also because it’s an example of a thing it is only possible to do with the API…Īs you doubtless already know, the Maya interface is entirely written in MEL, which allows a scripter to quickly create a GUI for his or her scripts. No! If you think that, then you haven’t understood anything. It’s not much but you’ll see it’s enough to be getting on with! Scripting is pointless, it’s for newbies! Color change as a function of the selection state of the locator.OpenGL (Well, how else are you going to draw your locator? ).It’s obviously not the simplest thing in the world to begin with (I did have some grounding thanks to other tutorials, the Python “plug-ins” already incorporated into Maya and the OpenGL tutorials I’d done) but once the code is up and running, it’s quite fun to modify it to make your own locator… So I had a look at Rob Bateman’s sources (which I found incomprehensible a year ago) and “translated” them (not without difficulty) into Python…So I’ve created a little script with a custom locator. As I mentioned before, I’m starting to use the Maya API Python binding.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |