Proper way to modify addons?

So in a couple of my apps, I’ve modified few addons to make them work the way I want them to. Obviously when modifying the addon itself, the changes go into .h and .cpp files in the src folder of the addon itself, and thus the changes make their way across all my projects. In some cases, like fixing memory leaks, this is great. In some cases it can be annoying, like when I invert the camera image for one project and then have to de-invert it for another. This also causes problems when using github, because those changes addon files aren’t saved along with the rest of the project.

I realize that these problems are mostly due to lazy programming on my part… but I’m trying to change! What’s everyone’s strategy for when / if / how to modify addons, and how to compartmentalize those changes so that they only affect the desired project, and so that those changes can be saved through version control systems like github easily?

In most cases you can just subclass the addon and modify only the subclass.

If you know you might change it, start by forking it from github, then work with your own fork and use it between your projects. If you’ve made significant fixes and changes you can then pull request the original addon to contribute.

1 Like

Thanks that was really helpful!