mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' of https://github.com/ynput/ayon-core into enhancement/maya_settings_add_json_menu_option
This commit is contained in:
commit
e80c400e5d
34 changed files with 165 additions and 130 deletions
|
|
@ -11,6 +11,10 @@ from .manager import ApplicationManager
|
|||
class ApplicationsAddon(AYONAddon, IPluginPaths):
|
||||
name = "applications"
|
||||
|
||||
def initialize(self, settings):
|
||||
# TODO remove when addon is removed from ayon-core
|
||||
self.enabled = self.name in settings
|
||||
|
||||
def get_app_environments_for_context(
|
||||
self,
|
||||
project_name,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ main_cli.set_alias("addon", "module")
|
|||
@main_cli.command()
|
||||
@click.argument("output_json_path")
|
||||
@click.option("--project", help="Project name", default=None)
|
||||
@click.option("--asset", help="Asset name", default=None)
|
||||
@click.option("--asset", help="Folder path", default=None)
|
||||
@click.option("--task", help="Task name", default=None)
|
||||
@click.option("--app", help="Application name", default=None)
|
||||
@click.option(
|
||||
|
|
@ -131,7 +131,7 @@ def publish_report_viewer():
|
|||
@main_cli.command()
|
||||
@click.argument("output_path")
|
||||
@click.option("--project", help="Define project context")
|
||||
@click.option("--asset", help="Define asset in project (project must be set)")
|
||||
@click.option("--folder", help="Define folder in project (project must be set)")
|
||||
@click.option(
|
||||
"--strict",
|
||||
is_flag=True,
|
||||
|
|
@ -140,18 +140,18 @@ def publish_report_viewer():
|
|||
def contextselection(
|
||||
output_path,
|
||||
project,
|
||||
asset,
|
||||
folder,
|
||||
strict
|
||||
):
|
||||
"""Show Qt dialog to select context.
|
||||
|
||||
Context is project name, asset name and task name. The result is stored
|
||||
Context is project name, folder path and task name. The result is stored
|
||||
into json file which path is passed in first argument.
|
||||
"""
|
||||
Commands.contextselection(
|
||||
output_path,
|
||||
project,
|
||||
asset,
|
||||
folder,
|
||||
strict
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ class Commands:
|
|||
),
|
||||
DeprecationWarning
|
||||
)
|
||||
|
||||
addons_manager = AddonsManager()
|
||||
applications_addon = addons_manager.get_enabled_addon("applications")
|
||||
if applications_addon is None:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from ayon_core.lib import Logger
|
|||
|
||||
from ayon_core.pipeline import registered_host
|
||||
from ayon_core.pipeline.create import CreateContext
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
|
||||
self = sys.modules[__name__]
|
||||
self._project = None
|
||||
|
|
@ -57,7 +57,7 @@ def update_frame_range(start, end, comp=None, set_render_range=True,
|
|||
def set_current_context_framerange(folder_entity=None):
|
||||
"""Set Comp's frame range based on current folder."""
|
||||
if folder_entity is None:
|
||||
folder_entity = get_current_project_folder(
|
||||
folder_entity = get_current_folder_entity(
|
||||
fields={"attrib.frameStart",
|
||||
"attrib.frameEnd",
|
||||
"attrib.handleStart",
|
||||
|
|
@ -76,7 +76,7 @@ def set_current_context_framerange(folder_entity=None):
|
|||
def set_current_context_fps(folder_entity=None):
|
||||
"""Set Comp's frame rate (FPS) to based on current asset"""
|
||||
if folder_entity is None:
|
||||
folder_entity = get_current_project_folder(fields={"attrib.fps"})
|
||||
folder_entity = get_current_folder_entity(fields={"attrib.fps"})
|
||||
|
||||
fps = float(folder_entity["attrib"].get("fps", 24.0))
|
||||
comp = get_current_comp()
|
||||
|
|
@ -88,7 +88,7 @@ def set_current_context_fps(folder_entity=None):
|
|||
def set_current_context_resolution(folder_entity=None):
|
||||
"""Set Comp's resolution width x height default based on current folder"""
|
||||
if folder_entity is None:
|
||||
folder_entity = get_current_project_folder(
|
||||
folder_entity = get_current_folder_entity(
|
||||
fields={"attrib.resolutionWidth", "attrib.resolutionHeight"})
|
||||
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
|
|
@ -124,7 +124,7 @@ def validate_comp_prefs(comp=None, force_repair=False):
|
|||
"attrib.resolutionHeight",
|
||||
"attrib.pixelAspect",
|
||||
}
|
||||
folder_entity = get_current_project_folder(fields=fields)
|
||||
folder_entity = get_current_folder_entity(fields=fields)
|
||||
folder_path = folder_entity["path"]
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ def prompt_reset_context():
|
|||
return None
|
||||
|
||||
options = dialog.get_values()
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
if options["frame_range"]:
|
||||
set_current_context_framerange(folder_entity)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from ayon_core.pipeline import (
|
|||
AVALON_CONTAINER_ID,
|
||||
)
|
||||
from ayon_core.pipeline.load import get_outdated_containers
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
|
||||
from ayon_core.hosts.harmony import HARMONY_ADDON_ROOT
|
||||
import ayon_core.hosts.harmony.api as harmony
|
||||
|
|
@ -50,7 +50,7 @@ def get_current_context_settings():
|
|||
|
||||
"""
|
||||
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
|
||||
fps = folder_attributes.get("fps")
|
||||
|
|
|
|||
|
|
@ -248,8 +248,12 @@ def get_track_items(
|
|||
# collect all available active sequence track items
|
||||
if not return_list:
|
||||
sequence = get_current_sequence(name=sequence_name)
|
||||
# get all available tracks from sequence
|
||||
tracks = list(sequence.audioTracks()) + list(sequence.videoTracks())
|
||||
tracks = []
|
||||
if sequence is not None:
|
||||
# get all available tracks from sequence
|
||||
tracks.extend(sequence.audioTracks())
|
||||
tracks.extend(sequence.videoTracks())
|
||||
|
||||
# loop all tracks
|
||||
for track in tracks:
|
||||
if check_locked and track.isLocked():
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if "entity_type" in parent:
|
||||
parent["folder_type"] = parent.pop("entity_type")
|
||||
|
||||
asset, asset_name = self._get_folder_data(tag_data)
|
||||
folder_path, folder_name = self._get_folder_data(tag_data)
|
||||
|
||||
product_name = tag_data.get("productName")
|
||||
if product_name is None:
|
||||
|
|
@ -98,12 +98,6 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
families = [str(f) for f in tag_data["families"]]
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
if asset_name != clip_name:
|
||||
label += " ({})".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_name = tag_data.get("productName")
|
||||
if product_name is None:
|
||||
|
|
@ -113,7 +107,7 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
# backward compatibility: product_name should not be missing
|
||||
if not product_name:
|
||||
self.log.error(
|
||||
"Product name is not defined for: {}".format(asset))
|
||||
"Product name is not defined for: {}".format(folder_path))
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_type = tag_data.get("productType")
|
||||
|
|
@ -124,15 +118,21 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
# backward compatibility: product_type should not be missing
|
||||
if not product_type:
|
||||
self.log.error(
|
||||
"Product type is not defined for: {}".format(asset))
|
||||
"Product type is not defined for: {}".format(folder_path))
|
||||
|
||||
# form label
|
||||
label = "{} -".format(folder_path)
|
||||
if folder_name != clip_name:
|
||||
label += " ({})".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, product_name),
|
||||
"label": label,
|
||||
"folderPath": asset,
|
||||
"asset_name": asset_name,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
"folderPath": folder_path,
|
||||
"asset_name": folder_name,
|
||||
"item": track_item,
|
||||
"families": families,
|
||||
"publish": tag_data["publish"],
|
||||
|
|
@ -222,19 +222,19 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if not hierarchy_data:
|
||||
return
|
||||
|
||||
asset = data["folderPath"]
|
||||
asset_name = data["asset_name"]
|
||||
folder_path = data["folderPath"]
|
||||
folder_name = data["asset_name"]
|
||||
|
||||
product_type = "shot"
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
if asset_name != clip_name:
|
||||
label = "{} -".format(folder_path)
|
||||
if folder_name != clip_name:
|
||||
label += " ({}) ".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, product_name),
|
||||
"label": label,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
|
|
@ -281,19 +281,19 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if not self.test_any_audio(item):
|
||||
return
|
||||
|
||||
asset = data["folderPath"]
|
||||
folder_path = data["folderPath"]
|
||||
asset_name = data["asset_name"]
|
||||
|
||||
product_type = "audio"
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
label = "{} -".format(folder_path)
|
||||
if asset_name != clip_name:
|
||||
label += " ({}) ".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, subset),
|
||||
"label": label,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
order = pyblish.api.CollectorOrder - 0.491
|
||||
|
||||
def process(self, context):
|
||||
asset = context.data["folderPath"]
|
||||
asset_name = asset.split("/")[-1]
|
||||
folder_path = context.data["folderPath"]
|
||||
folder_name = folder_path.split("/")[-1]
|
||||
|
||||
active_timeline = hiero.ui.activeSequence()
|
||||
project = active_timeline.project()
|
||||
|
|
@ -62,12 +62,12 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
product_type = "workfile"
|
||||
instance_data = {
|
||||
"label": "{} - {}Main".format(
|
||||
asset, product_type),
|
||||
"name": "{}_{}".format(asset_name, product_type),
|
||||
"folderPath": context.data["folderPath"],
|
||||
folder_path, product_type),
|
||||
"name": "{}_{}".format(folder_name, product_type),
|
||||
"folderPath": folder_path,
|
||||
# TODO use 'get_product_name'
|
||||
"productName": "{}{}Main".format(
|
||||
asset_name, product_type.capitalize()
|
||||
folder_name, product_type.capitalize()
|
||||
),
|
||||
"item": project,
|
||||
"productType": product_type,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from ayon_core.pipeline import (
|
|||
)
|
||||
from ayon_core.pipeline.create import CreateContext
|
||||
from ayon_core.pipeline.template_data import get_template_data
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
from ayon_core.tools.utils import PopupUpdateKeys, SimplePopup
|
||||
from ayon_core.tools.utils.host_tools import get_tool_by_name
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ def get_folder_fps(folder_entity=None):
|
|||
"""Return current folder fps."""
|
||||
|
||||
if folder_entity is None:
|
||||
folder_entity = get_current_project_folder(fields=["attrib.fps"])
|
||||
folder_entity = get_current_folder_entity(fields=["attrib.fps"])
|
||||
return folder_entity["attrib"]["fps"]
|
||||
|
||||
|
||||
|
|
@ -741,7 +741,7 @@ def set_camera_resolution(camera, folder_entity=None):
|
|||
"""Apply resolution to camera from folder entity of the publish"""
|
||||
|
||||
if not folder_entity:
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
|
||||
resolution = get_resolution_from_folder(folder_entity)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from ayon_core.hosts.houdini.api.lib import (
|
|||
get_camera_from_container,
|
||||
set_camera_resolution
|
||||
)
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
|
||||
|
||||
class SetCameraResolution(InventoryAction):
|
||||
|
|
@ -19,7 +19,7 @@ class SetCameraResolution(InventoryAction):
|
|||
)
|
||||
|
||||
def process(self, containers):
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
for container in containers:
|
||||
node = container["node"]
|
||||
camera = get_camera_from_container(node)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import ayon_api
|
|||
from ayon_core.pipeline import get_current_project_name, colorspace
|
||||
from ayon_core.settings import get_project_settings
|
||||
from ayon_core.pipeline.context_tools import (
|
||||
get_current_project_folder,
|
||||
get_current_folder_entity,
|
||||
)
|
||||
from ayon_core.style import load_stylesheet
|
||||
from pymxs import runtime as rt
|
||||
|
|
@ -222,7 +222,7 @@ def reset_scene_resolution():
|
|||
contains any information regarding scene resolution.
|
||||
"""
|
||||
|
||||
folder_entity = get_current_project_folder(
|
||||
folder_entity = get_current_folder_entity(
|
||||
fields={"attrib.resolutionWidth", "attrib.resolutionHeight"}
|
||||
)
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
|
|
@ -243,7 +243,7 @@ def get_frame_range(folder_entiy=None) -> Union[Dict[str, Any], None]:
|
|||
"""
|
||||
# Set frame start/end
|
||||
if folder_entiy is None:
|
||||
folder_entiy = get_current_project_folder()
|
||||
folder_entiy = get_current_folder_entity()
|
||||
|
||||
folder_attributes = folder_entiy["attrib"]
|
||||
frame_start = folder_attributes.get("frameStart")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from pymxs import runtime as rt
|
|||
from ayon_core.lib import Logger
|
||||
from ayon_core.settings import get_project_settings
|
||||
from ayon_core.pipeline import get_current_project_name
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
set_render_frame_range,
|
||||
|
|
@ -57,7 +57,7 @@ class RenderSettings(object):
|
|||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
# hard-coded, should be customized in the setting
|
||||
folder_attributes = get_current_project_folder()["attrib"]
|
||||
folder_attributes = get_current_folder_entity()["attrib"]
|
||||
|
||||
# get project resolution
|
||||
width = folder_attributes.get("resolutionWidth")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ from ayon_core.pipeline import (
|
|||
AYON_CONTAINER_ID,
|
||||
)
|
||||
from ayon_core.lib import NumberDef
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
from ayon_core.pipeline.create import CreateContext
|
||||
from ayon_core.lib.profiles_filtering import filter_profiles
|
||||
|
||||
|
|
@ -2636,7 +2636,7 @@ def reset_scene_resolution():
|
|||
None
|
||||
"""
|
||||
|
||||
folder_attributes = get_current_project_folder()["attrib"]
|
||||
folder_attributes = get_current_folder_entity()["attrib"]
|
||||
|
||||
# Set resolution
|
||||
width = folder_attributes.get("resolutionWidth", 1920)
|
||||
|
|
@ -3245,7 +3245,7 @@ def update_content_on_context_change():
|
|||
This will update scene content to match new folder on context change
|
||||
"""
|
||||
scene_sets = cmds.listSets(allSets=True)
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
new_folder_path = folder_entity["path"]
|
||||
for s in scene_sets:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from ayon_core.lib import Logger
|
|||
from ayon_core.settings import get_project_settings
|
||||
|
||||
from ayon_core.pipeline import CreatorError, get_current_project_name
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
from ayon_core.hosts.maya.api.lib import reset_frame_range
|
||||
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ class RenderSettings(object):
|
|||
renderer = cmds.getAttr(
|
||||
'defaultRenderGlobals.currentRenderer').lower()
|
||||
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
folder_attributes = folder_entity["attrib"]
|
||||
# project_settings/maya/create/CreateRender/aov_separator
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import maya.cmds as cmds
|
|||
import pyblish.api
|
||||
|
||||
import ayon_core.hosts.maya.api.lib as mayalib
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.publish import (
|
||||
RepairContextAction,
|
||||
ValidateSceneOrder,
|
||||
|
|
@ -131,6 +130,5 @@ class ValidateMayaUnits(pyblish.api.ContextPlugin,
|
|||
cls.log.debug(current_linear)
|
||||
|
||||
cls.log.info("Setting time unit to match project")
|
||||
# TODO replace query with using 'context.data["folderEntity"]'
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = context.data["folderEntity"]
|
||||
mayalib.set_scene_fps(folder_entity["attrib"]["fps"])
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from unreal import EditorAssetLibrary
|
|||
from unreal import MovieSceneSkeletalAnimationTrack
|
||||
from unreal import MovieSceneSkeletalAnimationSection
|
||||
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
from ayon_core.pipeline import (
|
||||
get_representation_path,
|
||||
AYON_CONTAINER_ID
|
||||
|
|
@ -53,7 +53,7 @@ class AnimationFBXLoader(plugin.Loader):
|
|||
if not actor:
|
||||
return None
|
||||
|
||||
folder_entity = get_current_project_folder(fields=["attrib.fps"])
|
||||
folder_entity = get_current_folder_entity(fields=["attrib.fps"])
|
||||
|
||||
task.set_editor_property('filename', path)
|
||||
task.set_editor_property('destination_path', asset_dir)
|
||||
|
|
@ -256,7 +256,7 @@ class AnimationFBXLoader(plugin.Loader):
|
|||
repre_entity = context["representation"]
|
||||
folder_name = container["asset_name"]
|
||||
source_path = get_representation_path(repre_entity)
|
||||
folder_entity = get_current_project_folder(fields=["attrib.fps"])
|
||||
folder_entity = get_current_folder_entity(fields=["attrib.fps"])
|
||||
destination_path = container["namespace"]
|
||||
|
||||
task = unreal.AssetImportTask()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from ayon_core.pipeline import (
|
|||
AYON_CONTAINER_ID,
|
||||
get_current_project_name,
|
||||
)
|
||||
from ayon_core.pipeline.context_tools import get_current_project_folder
|
||||
from ayon_core.pipeline.context_tools import get_current_folder_entity
|
||||
from ayon_core.settings import get_current_project_settings
|
||||
from ayon_core.hosts.unreal.api import plugin
|
||||
from ayon_core.hosts.unreal.api.pipeline import (
|
||||
|
|
@ -169,7 +169,7 @@ class LayoutLoader(plugin.Loader):
|
|||
|
||||
anim_path = f"{asset_dir}/animations/{anim_file_name}"
|
||||
|
||||
folder_entity = get_current_project_folder()
|
||||
folder_entity = get_current_folder_entity()
|
||||
# Import animation
|
||||
task = unreal.AssetImportTask()
|
||||
task.options = unreal.FbxImportUI()
|
||||
|
|
|
|||
|
|
@ -384,42 +384,67 @@ def get_current_project_entity(fields=None):
|
|||
return ayon_api.get_project(project_name, fields=fields)
|
||||
|
||||
|
||||
def get_current_project_folder(folder_path=None, folder_id=None, fields=None):
|
||||
def get_current_folder_entity(fields=None):
|
||||
"""Helper function to get folder entity based on current context.
|
||||
|
||||
This function should be called only in process where host is installed.
|
||||
|
||||
Folder is found out based on passed folder path or id (not both). Folder
|
||||
path is not used for filtering if folder id is passed. When both
|
||||
folder path and id are missing then current folder path is used.
|
||||
Folder is based on current context project name and folder path.
|
||||
|
||||
Args:
|
||||
folder_path (Union[str, None]): Folder path used for filter.
|
||||
folder_id (Union[str, None]): Folder id. If entered then
|
||||
is used as only filter.
|
||||
fields (Optional[Iterable[str]]): Limit returned data of folder entity
|
||||
to specific keys.
|
||||
|
||||
Returns:
|
||||
Union[dict[str, Any], None]: Fodler entity or None.
|
||||
Union[dict[str, Any], None]: Folder entity or None.
|
||||
|
||||
"""
|
||||
context = get_current_context()
|
||||
project_name = context["project_name"]
|
||||
folder_path = context["folder_path"]
|
||||
|
||||
project_name = get_current_project_name()
|
||||
if folder_id:
|
||||
return ayon_api.get_folder_by_id(
|
||||
project_name, folder_id, fields=fields
|
||||
)
|
||||
|
||||
if not folder_path:
|
||||
folder_path = get_current_folder_path()
|
||||
# Skip if is not set even on context
|
||||
if not folder_path:
|
||||
return None
|
||||
# Skip if is not set even on context
|
||||
if not project_name or not folder_path:
|
||||
return None
|
||||
return ayon_api.get_folder_by_path(
|
||||
project_name, folder_path, fields=fields
|
||||
)
|
||||
|
||||
|
||||
def get_current_task_entity(fields=None):
|
||||
"""Helper function to get task entity based on current context.
|
||||
|
||||
This function should be called only in process where host is installed.
|
||||
|
||||
Task is based on current context project name, folder path
|
||||
and task name.
|
||||
|
||||
Args:
|
||||
fields (Optional[Iterable[str]]): Limit returned data of task entity
|
||||
to specific keys.
|
||||
|
||||
Returns:
|
||||
Union[dict[str, Any], None]: Task entity or None.
|
||||
|
||||
"""
|
||||
context = get_current_context()
|
||||
project_name = context["project_name"]
|
||||
folder_path = context["folder_path"]
|
||||
task_name = context["task_name"]
|
||||
|
||||
# Skip if is not set even on context
|
||||
if not project_name or not folder_path or not task_name:
|
||||
return None
|
||||
folder_entity = ayon_api.get_folder_by_path(
|
||||
project_name, folder_path, fields={"id"}
|
||||
)
|
||||
if not folder_entity:
|
||||
return None
|
||||
return ayon_api.get_task_by_name(
|
||||
project_name, folder_entity["id"], task_name, fields=fields
|
||||
)
|
||||
|
||||
|
||||
def is_representation_from_latest(representation):
|
||||
"""Return whether the representation is from latest version
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from pyblish import api
|
||||
from ayon_core.settings import get_current_project_settings
|
||||
from ayon_core.settings import get_project_settings
|
||||
|
||||
|
||||
class CollectSettings(api.ContextPlugin):
|
||||
|
|
@ -9,4 +9,9 @@ class CollectSettings(api.ContextPlugin):
|
|||
label = "Collect Settings"
|
||||
|
||||
def process(self, context):
|
||||
context.data["project_settings"] = get_current_project_settings()
|
||||
project_name = context.data["projectName"]
|
||||
self.log.debug(
|
||||
"Collecting settings for project: {}".format(project_name)
|
||||
)
|
||||
project_settings = get_project_settings(project_name)
|
||||
context.data["project_settings"] = project_settings
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
Extractor to create video with pre-defined burnins from
|
||||
existing extracted video representation.
|
||||
|
||||
It will work only on represenations having `burnin = True` or
|
||||
It will work only on representations having `burnin = True` or
|
||||
`tags` including `burnin`
|
||||
"""
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
|
||||
burnin_defs = copy.deepcopy(src_burnin_defs)
|
||||
|
||||
# Filter output definition by `burnin` represetation key
|
||||
# Filter output definition by `burnin` representation key
|
||||
repre_linked_burnins = [
|
||||
burnin_def
|
||||
for burnin_def in burnin_defs
|
||||
|
|
@ -378,6 +378,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
# Prepare subprocess arguments
|
||||
args = list(executable_args)
|
||||
args.append(temporary_json_filepath)
|
||||
args.append("--headless")
|
||||
self.log.debug("Executing: {}".format(" ".join(args)))
|
||||
|
||||
# Run burnin script
|
||||
|
|
@ -547,7 +548,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
return burnin_data, temp_data
|
||||
|
||||
def repres_is_valid(self, repre):
|
||||
"""Validation if representaion should be processed.
|
||||
"""Validation if representation should be processed.
|
||||
|
||||
Args:
|
||||
repre (dict): Representation which should be checked.
|
||||
|
|
@ -579,7 +580,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
tags (list): Tags of processed representation.
|
||||
|
||||
Returns:
|
||||
list: Containg all burnin definitions matching entered tags.
|
||||
list: Contain all burnin definitions matching entered tags.
|
||||
|
||||
"""
|
||||
filtered_burnins = []
|
||||
|
|
@ -604,7 +605,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
|
||||
Store data to `temp_data` for keys "full_input_path" which is full path
|
||||
to source files optionally with sequence formatting,
|
||||
"full_output_path" full path to otput with optionally with sequence
|
||||
"full_output_path" full path to output with optionally with sequence
|
||||
formatting, "full_input_paths" list of all source files which will be
|
||||
deleted when burnin script ends, "repre_files" list of output
|
||||
filenames.
|
||||
|
|
@ -754,7 +755,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
profile (dict): Profile from presets matching current context.
|
||||
|
||||
Returns:
|
||||
list: Containg all valid output definitions.
|
||||
list: Contain all valid output definitions.
|
||||
"""
|
||||
filtered_burnin_defs = []
|
||||
|
||||
|
|
@ -775,7 +776,7 @@ class ExtractBurnin(publish.Extractor):
|
|||
):
|
||||
self.log.debug((
|
||||
"Skipped burnin definition \"{}\". Family"
|
||||
" fiters ({}) does not match current instance families: {}"
|
||||
" filters ({}) does not match current instance families: {}"
|
||||
).format(
|
||||
filename_suffix, str(families_filters), str(families)
|
||||
))
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ def get_current_project_settings():
|
|||
Project name should be stored in environment variable `AYON_PROJECT_NAME`.
|
||||
This function should be used only in host context where environment
|
||||
variable must be set and should not happen that any part of process will
|
||||
change the value of the enviornment variable.
|
||||
change the value of the environment variable.
|
||||
"""
|
||||
project_name = os.environ.get("AYON_PROJECT_NAME")
|
||||
if not project_name:
|
||||
|
|
@ -209,6 +209,3 @@ def get_current_project_settings():
|
|||
"Missing context project in environemt variable `AYON_PROJECT_NAME`."
|
||||
)
|
||||
return get_project_settings(project_name)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from ayon_server.settings import (
|
|||
|
||||
from .imageio import BlenderImageIOModel
|
||||
from .publish_plugins import (
|
||||
PublishPuginsModel,
|
||||
PublishPluginsModel,
|
||||
DEFAULT_BLENDER_PUBLISH_SETTINGS
|
||||
)
|
||||
from .render_settings import (
|
||||
|
|
@ -47,8 +47,8 @@ class BlenderSettings(BaseSettingsModel):
|
|||
default_factory=TemplateWorkfileBaseOptions,
|
||||
title="Workfile Builder"
|
||||
)
|
||||
publish: PublishPuginsModel = SettingsField(
|
||||
default_factory=PublishPuginsModel,
|
||||
publish: PublishPluginsModel = SettingsField(
|
||||
default_factory=PublishPluginsModel,
|
||||
title="Publish Plugins"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ExtractPlayblastModel(BaseSettingsModel):
|
|||
return validate_json_dict(value)
|
||||
|
||||
|
||||
class PublishPuginsModel(BaseSettingsModel):
|
||||
class PublishPluginsModel(BaseSettingsModel):
|
||||
ValidateCameraZeroKeyframe: ValidatePluginModel = SettingsField(
|
||||
default_factory=ValidatePluginModel,
|
||||
title="Validate Camera Zero Keyframe",
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class WorkfileModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class PublishPuginsModel(BaseSettingsModel):
|
||||
class PublishPluginsModel(BaseSettingsModel):
|
||||
CollectRenderPath: CollectRenderPathModel = SettingsField(
|
||||
default_factory=CollectRenderPathModel,
|
||||
title="Collect Render Path"
|
||||
|
|
@ -57,8 +57,8 @@ class CelActionSettings(BaseSettingsModel):
|
|||
workfile: WorkfileModel = SettingsField(
|
||||
title="Workfile"
|
||||
)
|
||||
publish: PublishPuginsModel = SettingsField(
|
||||
default_factory=PublishPuginsModel,
|
||||
publish: PublishPluginsModel = SettingsField(
|
||||
default_factory=PublishPluginsModel,
|
||||
title="Publish plugins",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class CreateShotClipModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class CreatePuginsModel(BaseSettingsModel):
|
||||
class CreatePluginsModel(BaseSettingsModel):
|
||||
CreateShotClip: CreateShotClipModel = SettingsField(
|
||||
default_factory=CreateShotClipModel,
|
||||
title="Create Shot Clip"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from ayon_server.settings import BaseSettingsModel, SettingsField
|
||||
|
||||
from .imageio import FlameImageIOModel, DEFAULT_IMAGEIO_SETTINGS
|
||||
from .create_plugins import CreatePuginsModel, DEFAULT_CREATE_SETTINGS
|
||||
from .publish_plugins import PublishPuginsModel, DEFAULT_PUBLISH_SETTINGS
|
||||
from .create_plugins import CreatePluginsModel, DEFAULT_CREATE_SETTINGS
|
||||
from .publish_plugins import PublishPluginsModel, DEFAULT_PUBLISH_SETTINGS
|
||||
from .loader_plugins import LoaderPluginsModel, DEFAULT_LOADER_SETTINGS
|
||||
|
||||
|
||||
|
|
@ -11,12 +11,12 @@ class FlameSettings(BaseSettingsModel):
|
|||
default_factory=FlameImageIOModel,
|
||||
title="Color Management (ImageIO)"
|
||||
)
|
||||
create: CreatePuginsModel = SettingsField(
|
||||
default_factory=CreatePuginsModel,
|
||||
create: CreatePluginsModel = SettingsField(
|
||||
default_factory=CreatePluginsModel,
|
||||
title="Create plugins"
|
||||
)
|
||||
publish: PublishPuginsModel = SettingsField(
|
||||
default_factory=PublishPuginsModel,
|
||||
publish: PublishPluginsModel = SettingsField(
|
||||
default_factory=PublishPluginsModel,
|
||||
title="Publish plugins"
|
||||
)
|
||||
load: LoaderPluginsModel = SettingsField(
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class IntegrateBatchGroupModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class PublishPuginsModel(BaseSettingsModel):
|
||||
class PublishPluginsModel(BaseSettingsModel):
|
||||
CollectTimelineInstances: CollectTimelineInstancesModel = SettingsField(
|
||||
default_factory=CollectTimelineInstancesModel,
|
||||
title="Collect Timeline Instances"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class LoadClipModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class LoaderPuginsModel(BaseSettingsModel):
|
||||
class LoaderPluginsModel(BaseSettingsModel):
|
||||
LoadClip: LoadClipModel = SettingsField(
|
||||
default_factory=LoadClipModel,
|
||||
title="Load Clip"
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ from .create_plugins import (
|
|||
DEFAULT_CREATE_SETTINGS
|
||||
)
|
||||
from .loader_plugins import (
|
||||
LoaderPuginsModel,
|
||||
LoaderPluginsModel,
|
||||
DEFAULT_LOADER_PLUGINS_SETTINGS
|
||||
)
|
||||
from .publish_plugins import (
|
||||
PublishPuginsModel,
|
||||
PublishPluginsModel,
|
||||
DEFAULT_PUBLISH_PLUGIN_SETTINGS
|
||||
)
|
||||
from .scriptsmenu import (
|
||||
|
|
@ -35,12 +35,12 @@ class HieroSettings(BaseSettingsModel):
|
|||
default_factory=CreatorPluginsSettings,
|
||||
title="Creator Plugins",
|
||||
)
|
||||
load: LoaderPuginsModel = SettingsField(
|
||||
default_factory=LoaderPuginsModel,
|
||||
load: LoaderPluginsModel = SettingsField(
|
||||
default_factory=LoaderPluginsModel,
|
||||
title="Loader plugins"
|
||||
)
|
||||
publish: PublishPuginsModel = SettingsField(
|
||||
default_factory=PublishPuginsModel,
|
||||
publish: PublishPluginsModel = SettingsField(
|
||||
default_factory=PublishPluginsModel,
|
||||
title="Publish plugins"
|
||||
)
|
||||
scriptsmenu: ScriptsmenuSettings = SettingsField(
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ExtractReviewCutUpVideoModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class PublishPuginsModel(BaseSettingsModel):
|
||||
class PublishPluginsModel(BaseSettingsModel):
|
||||
CollectInstanceVersion: CollectInstanceVersionModel = SettingsField(
|
||||
default_factory=CollectInstanceVersionModel,
|
||||
title="Collect Instance Version"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class LoadClipModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class LoaderPuginsModel(BaseSettingsModel):
|
||||
class LoaderPluginsModel(BaseSettingsModel):
|
||||
LoadImage: LoadImageModel = SettingsField(
|
||||
default_factory=LoadImageModel,
|
||||
title="Load Image"
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ from .create_plugins import (
|
|||
DEFAULT_CREATE_SETTINGS
|
||||
)
|
||||
from .publish_plugins import (
|
||||
PublishPuginsModel,
|
||||
PublishPluginsModel,
|
||||
DEFAULT_PUBLISH_PLUGIN_SETTINGS
|
||||
)
|
||||
from .loader_plugins import (
|
||||
LoaderPuginsModel,
|
||||
LoaderPluginsModel,
|
||||
DEFAULT_LOADER_PLUGINS_SETTINGS
|
||||
)
|
||||
from .workfile_builder import (
|
||||
|
|
@ -75,13 +75,13 @@ class NukeSettings(BaseSettingsModel):
|
|||
title="Creator Plugins",
|
||||
)
|
||||
|
||||
publish: PublishPuginsModel = SettingsField(
|
||||
default_factory=PublishPuginsModel,
|
||||
publish: PublishPluginsModel = SettingsField(
|
||||
default_factory=PublishPluginsModel,
|
||||
title="Publish Plugins",
|
||||
)
|
||||
|
||||
load: LoaderPuginsModel = SettingsField(
|
||||
default_factory=LoaderPuginsModel,
|
||||
load: LoaderPluginsModel = SettingsField(
|
||||
default_factory=LoaderPluginsModel,
|
||||
title="Loader Plugins",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class IncrementScriptVersionModel(BaseSettingsModel):
|
|||
active: bool = SettingsField(title="Active")
|
||||
|
||||
|
||||
class PublishPuginsModel(BaseSettingsModel):
|
||||
class PublishPluginsModel(BaseSettingsModel):
|
||||
CollectInstanceData: CollectInstanceDataModel = SettingsField(
|
||||
title="Collect Instance Version",
|
||||
default_factory=CollectInstanceDataModel,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class CreateShotClipModels(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class CreatorPuginsModel(BaseSettingsModel):
|
||||
class CreatorPluginsModel(BaseSettingsModel):
|
||||
CreateShotClip: CreateShotClipModels = SettingsField(
|
||||
default_factory=CreateShotClipModels,
|
||||
title="Create Shot Clip"
|
||||
|
|
@ -84,8 +84,8 @@ class ResolveSettings(BaseSettingsModel):
|
|||
default_factory=ResolveImageIOModel,
|
||||
title="Color Management (ImageIO)"
|
||||
)
|
||||
create: CreatorPuginsModel = SettingsField(
|
||||
default_factory=CreatorPuginsModel,
|
||||
create: CreatorPluginsModel = SettingsField(
|
||||
default_factory=CreatorPluginsModel,
|
||||
title="Creator plugins",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue