Code inserts are pieces of code saved to a .py file which can be inserted anywhere the cursor is in the Text Editor. Unlike a full template, this content will be pasted wherever the cursor is positioned rather than opened up as a separate file. The main advantage of code inserts is the ability to give various coding tasks meaningful, (or meaningful to you) names that are easy to remember and even easier to create and access.
Hacker knows if the current open file in the text editor is part of an addon and can automatically substitute the name of the related addon with the code insert. For example if we paste the above example into a a new text file (one not associated with any addon) we get this:
But if we were to select the same code insert with a file open that belonged to an addon called "My Cool Addon", it would look like this after selecting the insert:
The operator would still require some adjustments to the name, description etc. but the idea is you'll be typing and replacing much less text overall. To add name substitutes in your own code, use ADDONUPPER where you want all caps text of your addon name to be substituted such as at the beginning of menu and operator classes. Place addon_lower where you want lower case and underscored versions of the name to appear such as in the bl_idname. Place AddonPropper where you want title cased and spaced versions of your addon name to appear such as descriptions. There's no example of AddonPropper substitutions above, but if there were it would look like this "My Cool Addon" after inserted. If you prefer for the code inserts not to use addon name substitutions where Hacker detects a file is part of an addon, you can disable this in Hacker's options under "Templates".
Sometimes it's useful to have notes and the necessary imports included in your code inserts, other times they can get in the way (especially when inserting a lot of smaller pieces of code). You can store comments on all your code inserts (to make sure you understand how they work months later after you've forgotten adding them), but have Hacker strip initial comments and their required imports upon pasting by activating "Strip Code Inserts" in the "Templates" menu in Hacker's options menu.
To create a new code insert (or overwrite an existing one) just open a new text file, paste the code and name the file whatever you want. For instance the name of the code insert above is "Operator Modal Basic.py" The menus in the code insert menu are generated and organized dynamically based on their filename. Then right click, Edit Templates, and select "Save Code Insert".
??? ??? ?????: https://blendersensei.com/store
?????? ??? ??????????? ???��
...
https://www.youtube.com/watch?v=CZMZ_LQgn3s