Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 14 additions and 4 deletions
Showing only changes of commit 1888a70e64 - Show all commits

View File

@ -1,12 +1,14 @@
import bpy import bpy
from pathlib import Path from pathlib import Path
from .prefs import get_addon_prefs
def save_images(): def save_images():
# TODO Make customizable prefs = get_addon_prefs()
save_path = Path(bpy.data.filepath).parent.joinpath("images") user_path = Path(prefs.save_images_path)
default_path = Path(bpy.data.filepath).parent.joinpath("images")
save_path = default_path if prefs.save_images_path == "" else user_path
for img in bpy.data.images: for img in bpy.data.images:
if img.is_dirty: if img.is_dirty:
filepath = save_path.joinpath(img.name).__str__() filepath = save_path.joinpath(img.name).__str__() + ".png"
img.filepath = filepath
img.save(filepath=filepath) img.save(filepath=filepath)

View File

@ -16,8 +16,16 @@ class ASSET_PIPELINE_addon_preferences(bpy.types.AddonPreferences):
subtype="DIR_PATH", subtype="DIR_PATH",
) )
save_images_path: bpy.props.StringProperty( # type: ignore
name="Save Images Path",
description="Path to save un-saved images to, if left blank images will save in a called 'images' folder relative to the asset",
default="",
subtype="DIR_PATH",
)
def draw(self, context): def draw(self, context):
self.layout.prop(self, "custom_task_layers_dir") self.layout.prop(self, "custom_task_layers_dir")
self.layout.prop(self, "save_images_path")
classes = (ASSET_PIPELINE_addon_preferences,) classes = (ASSET_PIPELINE_addon_preferences,)