naturebad.blogg.se

Best addons blender
Best addons blender







best addons blender

Having more files over one long file is no win, both are problems to deal with. I do not split the file just because the length. When I know a function will be shared/reused I put it inside (for example) mesh_utils.py file, then such addons become multi-file in a folder and I link the function with: from. When your addon is a larger project (50kb+) and when you are editing with external tools.

  • there is beauty in nicely formatted single-file Blender addon.
  • it works better inside Blender environment.
  • other people better understand it as it is less complicated.
  • If you can - keep it single file and only when you have reasons - go multi-file.

    best addons blender

    In summary: I only see benefits in using multi-file addons and using the template I developed most of the difficulties are gone.

    best addons blender

  • Easier to manage in modern code editors, because most of them use a folder as project (I personally use Atom atm and like it very much!).
  • Makes it possible to write reusable modules.
  • Better separation between parts of you addon like operators and ui.
  • Easier to extend without cluttering existing code.
  • The dependencies in your code are much clearer, because you have to import functions you want to use in a file.
  • Much better support by version control systems like GIT.
  • The Code Autocomplete addon can do the first 3 steps for you. inside of one of these files they will be registered as well (by the _module(_ name _) statement in the main file).Īh and don't forget to create a _ init _.py file in each subdirectory. py files in the folder now and all of them will be loaded and reloaded automatically. Inside of this folder I create a _ init _.py file with this content.Ĭreate a developer_utils.py file with this content. It's not super important but I suggest to use a name that can be a python identifier and all lower case. this one).Ĭreate a new folder in Blenders addons directory. Even as large addons as Animation Nodes and Code Autocomplete use it (and some others as well, e.g.

    best addons blender

    Without having to care about reloading etc. I agree that it can be complicated in at first and I have to admit that it took me quite some time until I was able to create multi-file addons in a nice way.īUT, a few months ago I developed an addon template for my Code Autocomplete addon that allows you to create multi-file addons very easily. In my opinion you should always use multiple files for non-trivial addons (e.g.









    Best addons blender