mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge branch 'develop' into enhancement/remove_deprecated_convert_for_ffmpeg
This commit is contained in:
commit
ad540d1690
7 changed files with 27 additions and 39 deletions
|
|
@ -1,17 +0,0 @@
|
||||||
# Deprecated file
|
|
||||||
# - the file container 'WeakMethod' implementation for Python 2 which is not
|
|
||||||
# needed anymore.
|
|
||||||
import warnings
|
|
||||||
import weakref
|
|
||||||
|
|
||||||
|
|
||||||
WeakMethod = weakref.WeakMethod
|
|
||||||
|
|
||||||
warnings.warn(
|
|
||||||
(
|
|
||||||
"'ayon_core.lib.python_2_comp' is deprecated."
|
|
||||||
"Please use 'weakref.WeakMethod'."
|
|
||||||
),
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2
|
|
||||||
)
|
|
||||||
|
|
@ -808,14 +808,14 @@ def _create_instances_for_aov(
|
||||||
frames_to_render is not None
|
frames_to_render is not None
|
||||||
and isinstance(collected_files, (list, tuple)) # not single file
|
and isinstance(collected_files, (list, tuple)) # not single file
|
||||||
):
|
):
|
||||||
frames_to_render = convert_frames_str_to_list(frames_to_render)
|
aov_frames_to_render = convert_frames_str_to_list(frames_to_render)
|
||||||
collections, _ = clique.assemble(collected_files)
|
collections, _ = clique.assemble(collected_files)
|
||||||
collected_files = _get_real_files_to_render(
|
collected_files = _get_real_files_to_render(
|
||||||
collections[0], frames_to_render)
|
collections[0], aov_frames_to_render)
|
||||||
else:
|
else:
|
||||||
frame_start = int(skeleton.get("frameStartHandle"))
|
frame_start = int(skeleton.get("frameStartHandle"))
|
||||||
frame_end = int(skeleton.get("frameEndHandle"))
|
frame_end = int(skeleton.get("frameEndHandle"))
|
||||||
frames_to_render = list(range(frame_start, frame_end + 1))
|
aov_frames_to_render = list(range(frame_start, frame_end + 1))
|
||||||
|
|
||||||
dynamic_data = {
|
dynamic_data = {
|
||||||
"aov": aov,
|
"aov": aov,
|
||||||
|
|
@ -937,8 +937,8 @@ def _create_instances_for_aov(
|
||||||
"name": ext,
|
"name": ext,
|
||||||
"ext": ext,
|
"ext": ext,
|
||||||
"files": collected_files,
|
"files": collected_files,
|
||||||
"frameStart": frames_to_render[0],
|
"frameStart": aov_frames_to_render[0],
|
||||||
"frameEnd": frames_to_render[-1],
|
"frameEnd": aov_frames_to_render[-1],
|
||||||
# If expectedFile are absolute, we need only filenames
|
# If expectedFile are absolute, we need only filenames
|
||||||
"stagingDir": staging_dir,
|
"stagingDir": staging_dir,
|
||||||
"fps": new_instance.get("fps"),
|
"fps": new_instance.get("fps"),
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,7 @@ from .utils import get_representation_path_from_context
|
||||||
|
|
||||||
|
|
||||||
class LoaderPlugin(list):
|
class LoaderPlugin(list):
|
||||||
"""Load representation into host application
|
"""Load representation into host application"""
|
||||||
|
|
||||||
Arguments:
|
|
||||||
context (dict): avalon-core:context-1.0
|
|
||||||
|
|
||||||
.. versionadded:: 4.0
|
|
||||||
This class was introduced
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
product_types = set()
|
product_types = set()
|
||||||
representations = set()
|
representations = set()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
from __future__ import annotations
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
from typing import Any, Union
|
||||||
|
|
||||||
from ayon_core.settings import get_project_settings
|
from ayon_core.settings import get_project_settings
|
||||||
from ayon_core.lib import Logger
|
from ayon_core.lib import Logger
|
||||||
|
|
@ -9,7 +11,7 @@ from .anatomy import Anatomy
|
||||||
from .template_data import get_project_template_data
|
from .template_data import get_project_template_data
|
||||||
|
|
||||||
|
|
||||||
def concatenate_splitted_paths(split_paths, anatomy):
|
def concatenate_splitted_paths(split_paths, anatomy: Anatomy):
|
||||||
log = Logger.get_logger("concatenate_splitted_paths")
|
log = Logger.get_logger("concatenate_splitted_paths")
|
||||||
pattern_array = re.compile(r"\[.*\]")
|
pattern_array = re.compile(r"\[.*\]")
|
||||||
output = []
|
output = []
|
||||||
|
|
@ -47,7 +49,7 @@ def concatenate_splitted_paths(split_paths, anatomy):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def fill_paths(path_list, anatomy):
|
def fill_paths(path_list: list[str], anatomy: Anatomy):
|
||||||
format_data = get_project_template_data(project_name=anatomy.project_name)
|
format_data = get_project_template_data(project_name=anatomy.project_name)
|
||||||
format_data["root"] = anatomy.roots
|
format_data["root"] = anatomy.roots
|
||||||
filled_paths = []
|
filled_paths = []
|
||||||
|
|
@ -59,7 +61,7 @@ def fill_paths(path_list, anatomy):
|
||||||
return filled_paths
|
return filled_paths
|
||||||
|
|
||||||
|
|
||||||
def create_project_folders(project_name, basic_paths=None):
|
def create_project_folders(project_name: str, basic_paths=None):
|
||||||
log = Logger.get_logger("create_project_folders")
|
log = Logger.get_logger("create_project_folders")
|
||||||
anatomy = Anatomy(project_name)
|
anatomy = Anatomy(project_name)
|
||||||
if basic_paths is None:
|
if basic_paths is None:
|
||||||
|
|
@ -80,8 +82,19 @@ def create_project_folders(project_name, basic_paths=None):
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
|
|
||||||
|
|
||||||
def _list_path_items(folder_structure):
|
def _list_path_items(
|
||||||
|
folder_structure: Union[dict[str, Any], list[str]]):
|
||||||
output = []
|
output = []
|
||||||
|
|
||||||
|
# Allow leaf folders of the `project_folder_structure` to use a list of
|
||||||
|
# strings instead of a dictionary of keys with empty values.
|
||||||
|
if isinstance(folder_structure, list):
|
||||||
|
if not all(isinstance(item, str) for item in folder_structure):
|
||||||
|
raise ValueError(
|
||||||
|
f"List items must all be strings. Got: {folder_structure}")
|
||||||
|
return [[path] for path in folder_structure]
|
||||||
|
|
||||||
|
# Process key, value as key for folder names and value its subfolders
|
||||||
for key, value in folder_structure.items():
|
for key, value in folder_structure.items():
|
||||||
if not value:
|
if not value:
|
||||||
output.append(key)
|
output.append(key)
|
||||||
|
|
@ -99,7 +112,7 @@ def _list_path_items(folder_structure):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def get_project_basic_paths(project_name):
|
def get_project_basic_paths(project_name: str):
|
||||||
project_settings = get_project_settings(project_name)
|
project_settings = get_project_settings(project_name)
|
||||||
folder_structure = (
|
folder_structure = (
|
||||||
project_settings["core"]["project_folder_structure"]
|
project_settings["core"]["project_folder_structure"]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Package declaring AYON addon 'core' version."""
|
"""Package declaring AYON addon 'core' version."""
|
||||||
__version__ = "1.1.4+dev"
|
__version__ = "1.1.5+dev"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name = "core"
|
name = "core"
|
||||||
title = "Core"
|
title = "Core"
|
||||||
version = "1.1.4+dev"
|
version = "1.1.5+dev"
|
||||||
|
|
||||||
client_dir = "ayon_core"
|
client_dir = "ayon_core"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "ayon-core"
|
name = "ayon-core"
|
||||||
version = "1.1.4+dev"
|
version = "1.1.5+dev"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Ynput Team <team@ynput.io>"]
|
authors = ["Ynput Team <team@ynput.io>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue