Blender Kitsu: New Assset Tagging System #286

Merged
Nick Alberelli merged 8 commits from TinyNick/blender-studio-pipeline:feature/asset-tagging into main 2024-04-30 21:43:07 +02:00
Showing only changes of commit 30e864f525 - Show all commits

View File

@ -290,13 +290,17 @@ class KITSU_OT_con_set_asset(bpy.types.Operator):
return True return True
return False return False
def is_asset_pipeline_folder(self, context) -> bool:
current_folder = Path(bpy.data.filepath).parent
return current_folder.joinpath("task_layers.json").exists()
def get_asset_pipeline_publish(self, context) -> Path: def get_asset_pipeline_publish(self, context) -> Path:
from asset_pipeline.merge.publish import find_latest_publish from asset_pipeline.merge.publish import find_latest_publish
return find_latest_publish(Path(bpy.data.filepath)) return find_latest_publish(Path(bpy.data.filepath))
def invoke(self, context, event): def invoke(self, context, event):
if self.is_asset_pipeline_enabled(context): if self.is_asset_pipeline_enabled(context) and self.is_asset_pipeline_folder(context):
self._published_file_path = self.get_asset_pipeline_publish(context) self._published_file_path = self.get_asset_pipeline_publish(context)
if self._published_file_path.exists(): if self._published_file_path.exists():
self.use_asset_pipeline_publish = True self.use_asset_pipeline_publish = True