mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
[Automated] Merged develop into main
This commit is contained in:
commit
f103f9519e
9 changed files with 93 additions and 21 deletions
16
.github/workflows/prerelease.yml
vendored
16
.github/workflows/prerelease.yml
vendored
|
|
@ -62,22 +62,6 @@ jobs:
|
|||
- name: "🖨️ Print changelog to console"
|
||||
if: steps.version_type.outputs.type != 'skip'
|
||||
run: cat CHANGELOG.md
|
||||
|
||||
- name: 💾 Commit and Tag
|
||||
id: git_commit
|
||||
if: steps.version_type.outputs.type != 'skip'
|
||||
run: |
|
||||
git config user.email ${{ secrets.CI_EMAIL }}
|
||||
git config user.name ${{ secrets.CI_USER }}
|
||||
cd repos/avalon-core
|
||||
git checkout main
|
||||
git pull
|
||||
cd ../..
|
||||
git add .
|
||||
git commit -m "[Automated] Bump version"
|
||||
tag_name="CI/${{ steps.version.outputs.next_tag }}"
|
||||
echo $tag_name
|
||||
git tag -a $tag_name -m "nightly build"
|
||||
|
||||
- name: Push to protected main branch
|
||||
uses: CasperWA/push-protected@v2.10.0
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from .pipeline import (
|
|||
|
||||
class TrayPublishCreator(Creator):
|
||||
create_allow_context_change = True
|
||||
host_name = "traypublisher"
|
||||
|
||||
def collect_instances(self):
|
||||
for instance_data in list_instances():
|
||||
|
|
|
|||
|
|
@ -702,6 +702,32 @@ class ModulesManager:
|
|||
).format(expected_keys, " | ".join(msg_items)))
|
||||
return output
|
||||
|
||||
def collect_creator_plugin_paths(self, host_name):
|
||||
"""Helper to collect creator plugin paths from modules.
|
||||
|
||||
Args:
|
||||
host_name (str): For which host are creators meants.
|
||||
|
||||
Returns:
|
||||
list: List of creator plugin paths.
|
||||
"""
|
||||
# Output structure
|
||||
from openpype_interfaces import IPluginPaths
|
||||
|
||||
output = []
|
||||
for module in self.get_enabled_modules():
|
||||
# Skip module that do not inherit from `IPluginPaths`
|
||||
if not isinstance(module, IPluginPaths):
|
||||
continue
|
||||
|
||||
paths = module.get_creator_plugin_paths(host_name)
|
||||
if paths:
|
||||
# Convert to list if value is not list
|
||||
if not isinstance(paths, (list, tuple, set)):
|
||||
paths = [paths]
|
||||
output.extend(paths)
|
||||
return output
|
||||
|
||||
def collect_launch_hook_paths(self):
|
||||
"""Helper to collect hooks from modules inherited ILaunchHookPaths.
|
||||
|
||||
|
|
|
|||
|
|
@ -883,8 +883,10 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
new_i = copy(i)
|
||||
new_i["version"] = at.get("version")
|
||||
new_i["subset"] = at.get("subset")
|
||||
new_i["family"] = at.get("family")
|
||||
new_i["append"] = True
|
||||
new_i["families"].append(at.get("family"))
|
||||
# don't set subsetGroup if we are attaching
|
||||
new_i.pop("subsetGroup")
|
||||
new_instances.append(new_i)
|
||||
self.log.info(" - {} / v{}".format(
|
||||
at.get("subset"), at.get("version")))
|
||||
|
|
|
|||
|
|
@ -176,7 +176,10 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
|
|||
# Add item to component list
|
||||
component_list.append(thumbnail_item)
|
||||
|
||||
if first_thumbnail_component is not None:
|
||||
if (
|
||||
not review_representations
|
||||
and first_thumbnail_component is not None
|
||||
):
|
||||
width = first_thumbnail_component_repre.get("width")
|
||||
height = first_thumbnail_component_repre.get("height")
|
||||
if not width or not height:
|
||||
|
|
|
|||
|
|
@ -14,11 +14,38 @@ class IPluginPaths(OpenPypeInterface):
|
|||
"publish": ["path/to/publish_plugins"]
|
||||
}
|
||||
"""
|
||||
# TODO validation of an output
|
||||
|
||||
@abstractmethod
|
||||
def get_plugin_paths(self):
|
||||
pass
|
||||
|
||||
def get_creator_plugin_paths(self, host_name):
|
||||
"""Retreive creator plugin paths.
|
||||
|
||||
Give addons ability to add creator plugin paths based on host name.
|
||||
|
||||
NOTES:
|
||||
- Default implementation uses 'get_plugin_paths' and always return
|
||||
all creator plugins.
|
||||
- Host name may help to organize plugins by host, but each creator
|
||||
alsomay have host filtering.
|
||||
|
||||
Args:
|
||||
host_name (str): For which host are the plugins meant.
|
||||
"""
|
||||
|
||||
paths = self.get_plugin_paths()
|
||||
if not paths or "create" not in paths:
|
||||
return []
|
||||
|
||||
create_paths = paths["create"]
|
||||
if not create_paths:
|
||||
return []
|
||||
|
||||
if not isinstance(create_paths, (list, tuple, set)):
|
||||
create_paths = [create_paths]
|
||||
return create_paths
|
||||
|
||||
|
||||
class ILaunchHookPaths(OpenPypeInterface):
|
||||
"""Module has launch hook paths to return.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import pyblish.api
|
|||
from pyblish.lib import MessageHandler
|
||||
|
||||
import openpype
|
||||
from openpype.modules import load_modules
|
||||
from openpype.modules import load_modules, ModulesManager
|
||||
from openpype.settings import get_project_settings
|
||||
from openpype.lib import (
|
||||
Anatomy,
|
||||
|
|
@ -107,7 +107,7 @@ def install_host(host):
|
|||
install_openpype_plugins()
|
||||
|
||||
|
||||
def install_openpype_plugins(project_name=None):
|
||||
def install_openpype_plugins(project_name=None, host_name=None):
|
||||
# Make sure modules are loaded
|
||||
load_modules()
|
||||
|
||||
|
|
@ -116,6 +116,14 @@ def install_openpype_plugins(project_name=None):
|
|||
pyblish.api.register_discovery_filter(filter_pyblish_plugins)
|
||||
register_loader_plugin_path(LOAD_PATH)
|
||||
|
||||
if host_name is None:
|
||||
host_name = os.environ.get("AVALON_APP")
|
||||
|
||||
modules_manager = ModulesManager()
|
||||
creator_paths = modules_manager.collect_creator_plugin_paths(host_name)
|
||||
for creator_path in creator_paths:
|
||||
register_creator_plugin_path(creator_path)
|
||||
|
||||
if project_name is None:
|
||||
project_name = os.environ.get("AVALON_PROJECT")
|
||||
|
||||
|
|
|
|||
|
|
@ -749,6 +749,10 @@ class CreateContext:
|
|||
"""Is host valid for creation."""
|
||||
return self._host_is_valid
|
||||
|
||||
@property
|
||||
def host_name(self):
|
||||
return os.environ["AVALON_APP"]
|
||||
|
||||
@property
|
||||
def log(self):
|
||||
"""Dynamic access to logger."""
|
||||
|
|
@ -861,6 +865,17 @@ class CreateContext:
|
|||
"Using first and skipping following"
|
||||
))
|
||||
continue
|
||||
|
||||
# Filter by host name
|
||||
if (
|
||||
creator_class.host_name
|
||||
and creator_class.host_name != self.host_name
|
||||
):
|
||||
self.log.info((
|
||||
"Creator's host name is not supported for current host {}"
|
||||
).format(creator_class.host_name, self.host_name))
|
||||
continue
|
||||
|
||||
creator = creator_class(
|
||||
self,
|
||||
system_settings,
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ class BaseCreator:
|
|||
# `openpype.pipeline.attribute_definitions`
|
||||
instance_attr_defs = []
|
||||
|
||||
# Filtering by host name - can be used to be filtered by host name
|
||||
# - used on all hosts when set to 'None' for Backwards compatibility
|
||||
# - was added afterwards
|
||||
# QUESTION make this required?
|
||||
host_name = None
|
||||
|
||||
def __init__(
|
||||
self, create_context, system_settings, project_settings, headless=False
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue