diff --git a/README.md b/README.md index c756201..444da02 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Custom Templates - Add-On -##### v0.9.22 (12/08/2024) - ### Have you ever wanted to customize new projects? Custom Templates Add-On allows you to use your own .blend files as template options for new projects. @@ -13,6 +11,12 @@ Custom Templates Add-On allows you to use your own .blend files as template opti - Addon files: /addon/* - Release .zip files: /releases//* +### Releases + +##### v1.x + +- Version 1.0.0: [custom_templates-1.0.0.zip](./releases//1.x.x/custom_templates-1.0.0.zip) + ### Preferences In the add-on preferences, you can manage the list of your custom template files. @@ -23,6 +27,9 @@ Each template has it's Name, and Path to the .blend file. ![Custom Templates Preferences](./images/Addons_Preferences.png) +*Note that, as of now, using wrong file paths will NOT show any warning and you will get an error while opening the template.* +*Be sure to use only valid .blend files as path.* + ### How to use You can always open the add-on preferences using the button `File > Defaults > Manage templates`. @@ -32,6 +39,11 @@ Instead of using preferences, you can select a new template file using `File > D ![File > Defaults menu with the add-on custom buttons](./images/File__Defaults.png) +### Support + +As of today, the add-on has been only tested on Blender 4.2.0. +*It may or may not work on previous version.* + ### Copyright This add-on is developed under GPL-3.0 license by Francesco Bellini from 2024. diff --git a/addon/__init__.py b/addon/__init__.py index 8b89b46..b56aabe 100644 --- a/addon/__init__.py +++ b/addon/__init__.py @@ -59,8 +59,6 @@ class OT_SelectTemplatePopup(Operator): new_project = prefs.projects.add() new_project.name = self.project_name new_project.path = self.project_path - self.project_name.pop() - self.project_path.pop() self.report( {'INFO'}, f"Template '{self.project_name}' selected and added successfully!") @@ -176,7 +174,6 @@ class OT_OpenAddonPreferences(bpy.types.Operator): bpy.ops.screen.userpref_show('INVOKE_DEFAULT') context.preferences.active_section = 'ADDONS' context.window_manager.addon_search = "Custom Templates" - bpy.ops.preferences.addon_expand(module="bl_ext.user_default.custom_templates") return {'FINISHED'} # Add-On Preferences @@ -230,16 +227,20 @@ def draw_new_menu(self, context): "wm.read_homefile", text=project.name).filepath = project.path +# File > Defaults > Add-On Buttons def draw_add_template(self, context): layout = self.layout draw_addon_separator(layout) + # Manage Template layout.operator("custom_templates.open_preferences", text="Manage templates") + # Select new custom template layout.operator("wm.select_template_popup", text="Select new custom template") if bpy.data.filepath != "": + # Use current as new template (only with an active saved .blend file opened) layout.operator("wm.add_template_popup", text="Use current as new template") diff --git a/blender_manifest.toml b/blender_manifest.toml deleted file mode 100644 index 3fcbaac..0000000 --- a/blender_manifest.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.0.0" -id = "custom_templates" -version = "0.9.22" -name = "Custom Templates" -tagline = "Use your own .blend files as template options for new projects" -maintainer = "Francesco Bellini " -type = "add-on" - -# Optional link to documentation, support, source files, etc -# website = "https://extensions.blender.org/add-ons/my-example-package/" - -# Optional list defined by Blender and server, see: -# https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html -tags = ["System"] - -blender_version_min = "4.2.0" - -# License conforming to https://spdx.org/licenses/ (use "SPDX: prefix) -# https://docs.blender.org/manual/en/dev/advanced/extensions/licenses.html -license = [ - "SPDX:GPL-3.0-or-later", -] -# Optional: required by some licenses. -copyright = [ - "2024 Francesco Bellini", -] - diff --git a/make_zip.sh b/make_zip.sh deleted file mode 100644 index c19e61c..0000000 --- a/make_zip.sh +++ /dev/null @@ -1,2 +0,0 @@ - -zip -9 -r ./releases/0.9.x/custom_templates-0.9.22.zip ./addon/ \ No newline at end of file diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..ea565fe --- /dev/null +++ b/release.sh @@ -0,0 +1,2 @@ + +zip -9 -r ./releases/1.x.x/custom_templates-1.0.0.zip ./addon/ \ No newline at end of file diff --git a/releases/1.x.x/custom_templates-1.0.0.zip b/releases/1.x.x/custom_templates-1.0.0.zip new file mode 100644 index 0000000..4a13be0 Binary files /dev/null and b/releases/1.x.x/custom_templates-1.0.0.zip differ