Added setting to generate sequences for layouts

This commit is contained in:
Simone Barbieri 2022-07-12 16:31:03 +01:00
parent 46e2f62929
commit 2e8e4a0ee9
3 changed files with 13 additions and 6 deletions

View file

@ -23,6 +23,7 @@ from openpype.pipeline import (
legacy_io,
)
from openpype.api import get_asset
from openpype.api import get_current_project_settings
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api import pipeline as unreal_pipeline
@ -620,8 +621,8 @@ class LayoutLoader(plugin.Loader):
Returns:
list(str): list of container content
"""
# TODO: get option from OpenPype settings
create_sequences = False
data = get_current_project_settings()
create_sequences = data["unreal"]["level_sequences_for_layouts"]
# Create directory for asset and avalon container
hierarchy = context.get('asset').get('data').get('parents')
@ -764,8 +765,8 @@ class LayoutLoader(plugin.Loader):
return asset_content
def update(self, container, representation):
# TODO: get option from OpenPype settings
create_sequences = False
data = get_current_project_settings()
create_sequences = data["unreal"]["level_sequences_for_layouts"]
ar = unreal.AssetRegistryHelpers.get_asset_registry()
@ -840,8 +841,8 @@ class LayoutLoader(plugin.Loader):
Delete the layout. First, check if the assets loaded with the layout
are used by other layouts. If not, delete the assets.
"""
# TODO: get option from OpenPype settings
create_sequences = False
data = get_current_project_settings()
create_sequences = data["unreal"]["level_sequences_for_layouts"]
root = "/Game/OpenPype"
path = Path(container.get("namespace"))

View file

@ -1,4 +1,5 @@
{
"level_sequences_for_layouts": false,
"project_setup": {
"dev_mode": true
}

View file

@ -5,6 +5,11 @@
"label": "Unreal Engine",
"is_file": true,
"children": [
{
"type": "boolean",
"key": "level_sequences_for_layouts",
"label": "Generate level sequences when loading layouts"
},
{
"type": "dict",
"collapsible": true,