mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Check if the Unreal app name follows the right format
This commit is contained in:
parent
4a81b5a87a
commit
c2b753326f
1 changed files with 14 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
from openpype.modules import IHostAddon, OpenPypeModule
|
||||
from openpype.widgets.message_window import Window
|
||||
|
||||
UNREAL_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
|
@ -19,6 +21,18 @@ class UnrealAddon(OpenPypeModule, IHostAddon):
|
|||
|
||||
from .lib import get_compatible_integration
|
||||
|
||||
pattern = re.compile(r'^\d+-\d+$')
|
||||
|
||||
if not pattern.match(app.name):
|
||||
Window(
|
||||
parent=None,
|
||||
title="Unreal application name format",
|
||||
message="Unreal application name must be in format '5-0' or '5-1'",
|
||||
level="critical")
|
||||
raise ValueError(
|
||||
"Unreal application name must be in format '5-0' or '5-1'"
|
||||
)
|
||||
|
||||
ue_version = app.name.replace("-", ".")
|
||||
unreal_plugin_path = os.path.join(
|
||||
UNREAL_ROOT_DIR, "integration", "UE_{}".format(ue_version), "Ayon"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue