What's the difference between a script and a plug-in?

Hi!

So I’ve been scripting quite a lot lately using cmds and pySide2 in maya 2024 which has been quite successful so far. I’ve stumbled upon some smaller limitations from time to time but generally I have not felt restricted by scripting.

But lately I’ve been looking into other peoples stuff mainly Chris Zurbriggs Plug-ins and so I’m wondering what differentiates a script and a plug-in? Does creating plug-ins come with less limitations than maya python scripting? Should I start creating plug-ins or keep at what I’m doing currently? Where would I find information/ resources for creating plug-ins?

Thanks in advance!

1 Like

First and foremost a “plugin” differs from “script” in the level on integration and how it is installed and initialized by Maya.

For example you can create a plugin with Python that will show up in Maya’s “plugins” window, and you can Load and Auto Load it. On the code side of things you need to define functions that will run when plugin loads and unloads. You can choose what happens, but generally it’s a good idea to unload your plugins’ modules from memory on unload, remove menus, etc. And when it loads you create your plugin’s menus, load modules, do all the initializations you’d like.

And in general when using plugins it’s used with a python “project”, not a single file. But it can be just a single plugin.py file as well.

Other than that “a plugin” is no different from a script. There are no additional benefits. The way you could get ‘deeper’ into Maya is not by using plugin vs script, but by using OpenMaya API instead of cmds. It’s a C++ API directly exposed to Python.


Now, there’s also another side to this coin - C++ plugins. Again, I don’t think there’s anything you can do with a C++ plugin that you could never do with Python, but C++ would give a significant performance boost to computation intensive opeartions. For example if you’re writing a mesh deformer, or if you want to write your own physics engine - you can do that in Python, but it would work a lot faster if it’s written in C++.

Often it’s a combination of the two. You may write computation intensive parts in C++ and the rest in Python.

The downside is that if you plan to distribute your plugin - you have to compile separate versions of a C++ plugin.mll for every Maya version, for every OS. So even if you follow Autodesk’s Maya version support scheme (3 or 4 latest versions), it’s 4 * 3 (Win, Mac, Linux) - 12 versions of the plugin you’ll need to compile. The sane way of doing it is to use a CI\CD system, like GitHub Actions with a few build machines, virtual or physical. Doing it manually for every release would be a lot of work. And plugins also often tend to extend support for older versions, because you can still find studios using Maya 2016, for example.


As for where to learn it, oof. I hope someone else can point you towards a good resourse about it, I learned it over the years from a resource called “The Internet” haha :smiley:

But you can definitely get all the information you need from Maya’s Developer documentation, for example here: Help

While it may not be presented in the most digestible way for a newbie, it contains everything you might need to know about writing plugins for Maya.

For example here’s the part about initialization and uninitialization functions: Help

And here is, quite literally, the answer to your question: Help

5 Likes

You’ve already found Chris Zurbrigg. He’s by far the most in-depth instructor on this subject I have found in 15 years of using Maya.

2 Likes

Thank you for the in-depth answer! Good to know that there is no limitation difference between scripting and plug-ins :smiley:

I’ll definitely look into openMaya whenever I feel comfortable enough at what I’m already doing. I have some experience in C++ so I hope it won’t be too difficult adjusting. I’ve never read the maya help/ dev documentation outside of the cmds one, I’ll check this one out for sure and see what I can do with it :sunglasses:

Hi! :slight_smile: Regarding the question about where to find information about building plug-ins the best resource I have found so far is the Cult of Rig YouTube channel.

He has a playlist called Compiling C++ Plugins for Maya.

Hope it helps! :slight_smile:

1 Like