mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
use 'apply_settings' method to get value of 'delete_unmatched_assets'
This commit is contained in:
parent
4b0b6e6e02
commit
3400304cef
1 changed files with 12 additions and 4 deletions
|
|
@ -15,7 +15,6 @@ from openpype.pipeline import (
|
|||
AVALON_CONTAINER_ID,
|
||||
legacy_io,
|
||||
)
|
||||
from openpype.api import get_current_project_settings
|
||||
from openpype.hosts.unreal.api import plugin
|
||||
from openpype.hosts.unreal.api import pipeline as upipeline
|
||||
|
||||
|
|
@ -33,6 +32,17 @@ class ExistingLayoutLoader(plugin.Loader):
|
|||
color = "orange"
|
||||
ASSET_ROOT = "/Game/OpenPype"
|
||||
|
||||
delete_unmatched_assets = True
|
||||
|
||||
@classmethod
|
||||
def apply_settings(cls, project_settings, *args, **kwargs):
|
||||
super(ExistingLayoutLoader, cls).apply_settings(
|
||||
project_settings, *args, **kwargs
|
||||
)
|
||||
cls.delete_unmatched_assets = (
|
||||
project_settings["unreal"]["delete_unmatched_assets"]
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _create_container(
|
||||
asset_name, asset_dir, asset, representation, parent, family
|
||||
|
|
@ -222,8 +232,6 @@ class ExistingLayoutLoader(plugin.Loader):
|
|||
return assets
|
||||
|
||||
def _process(self, lib_path):
|
||||
data = get_current_project_settings()
|
||||
delete_unmatched = data["unreal"]["delete_unmatched_assets"]
|
||||
|
||||
ar = unreal.AssetRegistryHelpers.get_asset_registry()
|
||||
|
||||
|
|
@ -360,7 +368,7 @@ class ExistingLayoutLoader(plugin.Loader):
|
|||
continue
|
||||
if actor not in actors_matched:
|
||||
self.log.warning(f"Actor {actor.get_name()} not matched.")
|
||||
if delete_unmatched:
|
||||
if self.delete_unmatched_assets:
|
||||
EditorLevelLibrary.destroy_actor(actor)
|
||||
|
||||
return containers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue