Merge branch 'develop' into feature/OP-4158_Creation-UI-is-part-of-main-window

This commit is contained in:
Jakub Trllo 2022-10-12 14:41:17 +02:00
commit 89d4989f36
77 changed files with 1352 additions and 198 deletions

View file

@ -1,29 +1,38 @@
# Changelog
## [3.14.4-nightly.2](https://github.com/pypeclub/OpenPype/tree/HEAD)
## [3.14.4-nightly.3](https://github.com/pypeclub/OpenPype/tree/HEAD)
[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.14.3...HEAD)
**🚀 Enhancements**
- General: Set root environments before DCC launch [\#3947](https://github.com/pypeclub/OpenPype/pull/3947)
- Refactor: changed legacy way to update database for Hero version integrate [\#3941](https://github.com/pypeclub/OpenPype/pull/3941)
- Maya: Moved plugin from global to maya [\#3939](https://github.com/pypeclub/OpenPype/pull/3939)
- Fusion: Implement Alembic and FBX mesh loader [\#3927](https://github.com/pypeclub/OpenPype/pull/3927)
- Publisher: Instances can be marked as stored [\#3846](https://github.com/pypeclub/OpenPype/pull/3846)
**🐛 Bug fixes**
- Maya: Deadline OutputFilePath hack regression for Renderman [\#3950](https://github.com/pypeclub/OpenPype/pull/3950)
- Houdini: Fix validate workfile paths for non-parm file references [\#3948](https://github.com/pypeclub/OpenPype/pull/3948)
- Photoshop: missed sync published version of workfile with workfile [\#3946](https://github.com/pypeclub/OpenPype/pull/3946)
- Maya: fix regression of Renderman Deadline hack [\#3943](https://github.com/pypeclub/OpenPype/pull/3943)
- Tray: Change order of attribute changes [\#3938](https://github.com/pypeclub/OpenPype/pull/3938)
- AttributeDefs: Fix crashing multivalue of files widget [\#3937](https://github.com/pypeclub/OpenPype/pull/3937)
- General: Fix links query on hero version [\#3900](https://github.com/pypeclub/OpenPype/pull/3900)
- Publisher: Files Drag n Drop cleanup [\#3888](https://github.com/pypeclub/OpenPype/pull/3888)
- Maya: Render settings validation attribute check tweak logging [\#3821](https://github.com/pypeclub/OpenPype/pull/3821)
**🔀 Refactored code**
- General: Direct settings imports [\#3934](https://github.com/pypeclub/OpenPype/pull/3934)
- General: import 'Logger' from 'openpype.lib' [\#3926](https://github.com/pypeclub/OpenPype/pull/3926)
**Merged pull requests:**
- Maya + Yeti: Load Yeti Cache fix frame number recognition [\#3942](https://github.com/pypeclub/OpenPype/pull/3942)
- Fusion: Implement callbacks to Fusion's event system thread [\#3928](https://github.com/pypeclub/OpenPype/pull/3928)
- Photoshop: create single frame image in Ftrack as review [\#3908](https://github.com/pypeclub/OpenPype/pull/3908)
- Maya: Warn correctly about nodes in render instance with unexpected names [\#3816](https://github.com/pypeclub/OpenPype/pull/3816)
@ -68,6 +77,7 @@
- Unreal: Use new Extractor location [\#3917](https://github.com/pypeclub/OpenPype/pull/3917)
- Flame: Use new Extractor location [\#3916](https://github.com/pypeclub/OpenPype/pull/3916)
- Houdini: Use new Extractor location [\#3894](https://github.com/pypeclub/OpenPype/pull/3894)
- Harmony: Use new Extractor location [\#3893](https://github.com/pypeclub/OpenPype/pull/3893)
- Hiero: Use new Extractor location [\#3851](https://github.com/pypeclub/OpenPype/pull/3851)
- Maya: Remove old legacy \(ftrack\) plug-ins that are of no use anymore [\#3819](https://github.com/pypeclub/OpenPype/pull/3819)
- Nuke: Use new Extractor location [\#3799](https://github.com/pypeclub/OpenPype/pull/3799)
@ -97,18 +107,6 @@
- Igniter: Fix status handling when version is already installed [\#3804](https://github.com/pypeclub/OpenPype/pull/3804)
- Resolve: Addon import is Python 2 compatible [\#3798](https://github.com/pypeclub/OpenPype/pull/3798)
- Hiero: retimed clip publishing is working [\#3792](https://github.com/pypeclub/OpenPype/pull/3792)
- nuke: validate write node is not failing due wrong type [\#3780](https://github.com/pypeclub/OpenPype/pull/3780)
- Fix - changed format of version string in pyproject.toml [\#3777](https://github.com/pypeclub/OpenPype/pull/3777)
**🔀 Refactored code**
- Photoshop: Use new Extractor location [\#3789](https://github.com/pypeclub/OpenPype/pull/3789)
- Blender: Use new Extractor location [\#3787](https://github.com/pypeclub/OpenPype/pull/3787)
- AfterEffects: Use new Extractor location [\#3784](https://github.com/pypeclub/OpenPype/pull/3784)
**Merged pull requests:**
- Standalone Publisher: Ignore empty labels, then still use name like other asset models [\#3779](https://github.com/pypeclub/OpenPype/pull/3779)
## [3.14.1](https://github.com/pypeclub/OpenPype/tree/3.14.1) (2022-08-30)

View file

@ -23,6 +23,7 @@ CURRENT_PROJECT_CONFIG_SCHEMA = "openpype:config-2.0"
CURRENT_ASSET_DOC_SCHEMA = "openpype:asset-3.0"
CURRENT_SUBSET_SCHEMA = "openpype:subset-3.0"
CURRENT_VERSION_SCHEMA = "openpype:version-3.0"
CURRENT_HERO_VERSION_SCHEMA = "openpype:hero_version-1.0"
CURRENT_REPRESENTATION_SCHEMA = "openpype:representation-2.0"
CURRENT_WORKFILE_INFO_SCHEMA = "openpype:workfile-1.0"
CURRENT_THUMBNAIL_SCHEMA = "openpype:thumbnail-1.0"
@ -162,6 +163,34 @@ def new_version_doc(version, subset_id, data=None, entity_id=None):
}
def new_hero_version_doc(version_id, subset_id, data=None, entity_id=None):
"""Create skeleton data of hero version document.
Args:
version_id (ObjectId): Is considered as unique identifier of version
under subset.
subset_id (Union[str, ObjectId]): Id of parent subset.
data (Dict[str, Any]): Version document data.
entity_id (Union[str, ObjectId]): Predefined id of document. New id is
created if not passed.
Returns:
Dict[str, Any]: Skeleton of version document.
"""
if data is None:
data = {}
return {
"_id": _create_or_convert_to_mongo_id(entity_id),
"schema": CURRENT_HERO_VERSION_SCHEMA,
"type": "hero_version",
"version_id": version_id,
"parent": subset_id,
"data": data
}
def new_representation_doc(
name, version_id, context, data=None, entity_id=None
):
@ -293,6 +322,20 @@ def prepare_version_update_data(old_doc, new_doc, replace=True):
return _prepare_update_data(old_doc, new_doc, replace)
def prepare_hero_version_update_data(old_doc, new_doc, replace=True):
"""Compare two hero version documents and prepare update data.
Based on compared values will create update data for 'UpdateOperation'.
Empty output means that documents are identical.
Returns:
Dict[str, Any]: Changes between old and new document.
"""
return _prepare_update_data(old_doc, new_doc, replace)
def prepare_representation_update_data(old_doc, new_doc, replace=True):
"""Compare two representation documents and prepare update data.

View file

@ -6,9 +6,9 @@ from xml.etree import ElementTree as ET
from Qt import QtCore, QtWidgets
import openpype.api as openpype
import qargparse
from openpype import style
from openpype.settings import get_current_project_settings
from openpype.lib import Logger
from openpype.pipeline import LegacyCreator, LoaderPlugin
@ -306,7 +306,7 @@ class Creator(LegacyCreator):
def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
self.presets = openpype.get_current_project_settings()[
self.presets = get_current_project_settings()[
"flame"]["create"].get(self.__class__.__name__, {})
# adding basic current context flame objects

View file

@ -42,17 +42,9 @@ class FlamePrelaunch(PreLaunchHook):
volume_name = _env.get("FLAME_WIRETAP_VOLUME")
# get image io
project_anatomy = self.data["anatomy"]
project_settings = self.data["project_settings"]
# make sure anatomy settings are having flame key
if not project_anatomy["imageio"].get("flame"):
raise ApplicationLaunchFailed((
"Anatomy project settings are missing `flame` key. "
"Please make sure you remove project overides on "
"Anatomy Image io")
)
imageio_flame = project_anatomy["imageio"]["flame"]
imageio_flame = project_settings["flame"]["imageio"]
# get user name and host name
user_name = get_openpype_username()

View file

@ -3,8 +3,6 @@ import sys
import re
import contextlib
from Qt import QtGui
from openpype.lib import Logger
from openpype.client import (
get_asset_by_name,
@ -92,7 +90,7 @@ def set_asset_resolution():
})
def validate_comp_prefs(comp=None):
def validate_comp_prefs(comp=None, force_repair=False):
"""Validate current comp defaults with asset settings.
Validates fps, resolutionWidth, resolutionHeight, aspectRatio.
@ -135,21 +133,22 @@ def validate_comp_prefs(comp=None):
asset_value = asset_data[key]
comp_value = comp_frame_format_prefs.get(comp_key)
if asset_value != comp_value:
# todo: Actually show dialog to user instead of just logging
log.warning(
"Comp {pref} {value} does not match asset "
"'{asset_name}' {pref} {asset_value}".format(
pref=label,
value=comp_value,
asset_name=asset_doc["name"],
asset_value=asset_value)
)
invalid_msg = "{} {} should be {}".format(label,
comp_value,
asset_value)
invalid.append(invalid_msg)
if not force_repair:
# Do not log warning if we force repair anyway
log.warning(
"Comp {pref} {value} does not match asset "
"'{asset_name}' {pref} {asset_value}".format(
pref=label,
value=comp_value,
asset_name=asset_doc["name"],
asset_value=asset_value)
)
if invalid:
def _on_repair():
@ -160,6 +159,11 @@ def validate_comp_prefs(comp=None):
attributes[comp_key_full] = value
comp.SetPrefs(attributes)
if force_repair:
log.info("Applying default Comp preferences..")
_on_repair()
return
from . import menu
from openpype.widgets import popup
from openpype.style import load_stylesheet

View file

@ -16,6 +16,7 @@ from openpype.hosts.fusion.api.lib import (
from openpype.pipeline import legacy_io
from openpype.resources import get_openpype_icon_filepath
from .pipeline import FusionEventHandler
from .pulse import FusionPulse
self = sys.modules[__name__]
@ -119,6 +120,10 @@ class OpenPypeMenu(QtWidgets.QWidget):
self._pulse = FusionPulse(parent=self)
self._pulse.start()
# Detect Fusion events as OpenPype events
self._event_handler = FusionEventHandler(parent=self)
self._event_handler.start()
def on_task_changed(self):
# Update current context label
label = legacy_io.Session["AVALON_ASSET"]

View file

@ -2,13 +2,16 @@
Basic avalon integration
"""
import os
import sys
import logging
import pyblish.api
from Qt import QtCore
from openpype.lib import (
Logger,
register_event_callback
register_event_callback,
emit_event
)
from openpype.pipeline import (
register_loader_plugin_path,
@ -39,12 +42,13 @@ CREATE_PATH = os.path.join(PLUGINS_DIR, "create")
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "inventory")
class CompLogHandler(logging.Handler):
class FusionLogHandler(logging.Handler):
# Keep a reference to fusion's Print function (Remote Object)
_print = getattr(sys.modules["__main__"], "fusion").Print
def emit(self, record):
entry = self.format(record)
comp = get_current_comp()
if comp:
comp.Print(entry)
self._print(entry)
def install():
@ -67,7 +71,7 @@ def install():
# Attach default logging handler that prints to active comp
logger = logging.getLogger()
formatter = logging.Formatter(fmt="%(message)s\n")
handler = CompLogHandler()
handler = FusionLogHandler()
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
@ -84,10 +88,10 @@ def install():
"instanceToggled", on_pyblish_instance_toggled
)
# Fusion integration currently does not attach to direct callbacks of
# the application. So we use workfile callbacks to allow similar behavior
# on save and open
register_event_callback("workfile.open.after", on_after_open)
# Register events
register_event_callback("open", on_after_open)
register_event_callback("save", on_save)
register_event_callback("new", on_new)
def uninstall():
@ -137,8 +141,18 @@ def on_pyblish_instance_toggled(instance, old_value, new_value):
tool.SetAttrs({"TOOLB_PassThrough": passthrough})
def on_after_open(_event):
comp = get_current_comp()
def on_new(event):
comp = event["Rets"]["comp"]
validate_comp_prefs(comp, force_repair=True)
def on_save(event):
comp = event["sender"]
validate_comp_prefs(comp)
def on_after_open(event):
comp = event["sender"]
validate_comp_prefs(comp)
if any_outdated_containers():
@ -182,7 +196,7 @@ def ls():
"""
comp = get_current_comp()
tools = comp.GetToolList(False, "Loader").values()
tools = comp.GetToolList(False).values()
for tool in tools:
container = parse_container(tool)
@ -254,3 +268,114 @@ def parse_container(tool):
return container
class FusionEventThread(QtCore.QThread):
"""QThread which will periodically ping Fusion app for any events.
The fusion.UIManager must be set up to be notified of events before they'll
be reported by this thread, for example:
fusion.UIManager.AddNotify("Comp_Save", None)
"""
on_event = QtCore.Signal(dict)
def run(self):
app = getattr(sys.modules["__main__"], "app", None)
if app is None:
# No Fusion app found
return
# As optimization store the GetEvent method directly because every
# getattr of UIManager.GetEvent tries to resolve the Remote Function
# through the PyRemoteObject
get_event = app.UIManager.GetEvent
delay = int(os.environ.get("OPENPYPE_FUSION_CALLBACK_INTERVAL", 1000))
while True:
if self.isInterruptionRequested():
return
# Process all events that have been queued up until now
while True:
event = get_event(False)
if not event:
break
self.on_event.emit(event)
# Wait some time before processing events again
# to not keep blocking the UI
self.msleep(delay)
class FusionEventHandler(QtCore.QObject):
"""Emits OpenPype events based on Fusion events captured in a QThread.
This will emit the following OpenPype events based on Fusion actions:
save: Comp_Save, Comp_SaveAs
open: Comp_Opened
new: Comp_New
To use this you can attach it to you Qt UI so it runs in the background.
E.g.
>>> handler = FusionEventHandler(parent=window)
>>> handler.start()
"""
ACTION_IDS = [
"Comp_Save",
"Comp_SaveAs",
"Comp_New",
"Comp_Opened"
]
def __init__(self, parent=None):
super(FusionEventHandler, self).__init__(parent=parent)
# Set up Fusion event callbacks
fusion = getattr(sys.modules["__main__"], "fusion", None)
ui = fusion.UIManager
# Add notifications for the ones we want to listen to
notifiers = []
for action_id in self.ACTION_IDS:
notifier = ui.AddNotify(action_id, None)
notifiers.append(notifier)
# TODO: Not entirely sure whether these must be kept to avoid
# garbage collection
self._notifiers = notifiers
self._event_thread = FusionEventThread(parent=self)
self._event_thread.on_event.connect(self._on_event)
def start(self):
self._event_thread.start()
def stop(self):
self._event_thread.stop()
def _on_event(self, event):
"""Handle Fusion events to emit OpenPype events"""
if not event:
return
what = event["what"]
# Comp Save
if what in {"Comp_Save", "Comp_SaveAs"}:
if not event["Rets"].get("success"):
# If the Save action is cancelled it will still emit an
# event but with "success": False so we ignore those cases
return
# Comp was saved
emit_event("save", data=event)
return
# Comp New
elif what in {"Comp_New"}:
emit_event("new", data=event)
# Comp Opened
elif what in {"Comp_Opened"}:
emit_event("open", data=event)

View file

@ -19,9 +19,12 @@ class PulseThread(QtCore.QThread):
while True:
if self.isInterruptionRequested():
return
try:
app.Test()
except Exception:
# We don't need to call Test because PyRemoteObject of the app
# will actually fail to even resolve the Test function if it has
# gone down. So we can actually already just check by confirming
# the method is still getting resolved. (Optimization)
if app.Test is None:
self.no_response.emit()
self.msleep(interval)

View file

@ -15,13 +15,7 @@ class FusionPreLaunchOCIO(PreLaunchHook):
project_settings = self.data["project_settings"]
# make sure anatomy settings are having flame key
imageio_fusion = project_settings.get("fusion", {}).get("imageio")
if not imageio_fusion:
raise ApplicationLaunchFailed((
"Anatomy project settings are missing `fusion` key. "
"Please make sure you remove project overrides on "
"Anatomy ImageIO")
)
imageio_fusion = project_settings["fusion"]["imageio"]
ocio = imageio_fusion.get("ocio")
enabled = ocio.get("enabled", False)

View file

@ -0,0 +1,70 @@
from openpype.pipeline import (
load,
get_representation_path,
)
from openpype.hosts.fusion.api import (
imprint_container,
get_current_comp,
comp_lock_and_undo_chunk
)
class FusionLoadAlembicMesh(load.LoaderPlugin):
"""Load Alembic mesh into Fusion"""
families = ["pointcache", "model"]
representations = ["abc"]
label = "Load alembic mesh"
order = -10
icon = "code-fork"
color = "orange"
tool_type = "SurfaceAlembicMesh"
def load(self, context, name, namespace, data):
# Fallback to asset name when namespace is None
if namespace is None:
namespace = context['asset']['name']
# Create the Loader with the filename path set
comp = get_current_comp()
with comp_lock_and_undo_chunk(comp, "Create tool"):
path = self.fname
args = (-32768, -32768)
tool = comp.AddTool(self.tool_type, *args)
tool["Filename"] = path
imprint_container(tool,
name=name,
namespace=namespace,
context=context,
loader=self.__class__.__name__)
def switch(self, container, representation):
self.update(container, representation)
def update(self, container, representation):
"""Update Alembic path"""
tool = container["_tool"]
assert tool.ID == self.tool_type, f"Must be {self.tool_type}"
comp = tool.Comp()
path = get_representation_path(representation)
with comp_lock_and_undo_chunk(comp, "Update tool"):
tool["Filename"] = path
# Update the imprinted representation
tool.SetData("avalon.representation", str(representation["_id"]))
def remove(self, container):
tool = container["_tool"]
assert tool.ID == self.tool_type, f"Must be {self.tool_type}"
comp = tool.Comp()
with comp_lock_and_undo_chunk(comp, "Remove tool"):
tool.Delete()

View file

@ -0,0 +1,71 @@
from openpype.pipeline import (
load,
get_representation_path,
)
from openpype.hosts.fusion.api import (
imprint_container,
get_current_comp,
comp_lock_and_undo_chunk
)
class FusionLoadFBXMesh(load.LoaderPlugin):
"""Load FBX mesh into Fusion"""
families = ["*"]
representations = ["fbx"]
label = "Load FBX mesh"
order = -10
icon = "code-fork"
color = "orange"
tool_type = "SurfaceFBXMesh"
def load(self, context, name, namespace, data):
# Fallback to asset name when namespace is None
if namespace is None:
namespace = context['asset']['name']
# Create the Loader with the filename path set
comp = get_current_comp()
with comp_lock_and_undo_chunk(comp, "Create tool"):
path = self.fname
args = (-32768, -32768)
tool = comp.AddTool(self.tool_type, *args)
tool["ImportFile"] = path
imprint_container(tool,
name=name,
namespace=namespace,
context=context,
loader=self.__class__.__name__)
def switch(self, container, representation):
self.update(container, representation)
def update(self, container, representation):
"""Update path"""
tool = container["_tool"]
assert tool.ID == self.tool_type, f"Must be {self.tool_type}"
comp = tool.Comp()
path = get_representation_path(representation)
with comp_lock_and_undo_chunk(comp, "Update tool"):
tool["ImportFile"] = path
# Update the imprinted representation
tool.SetData("avalon.representation", str(representation["_id"]))
def remove(self, container):
tool = container["_tool"]
assert tool.ID == self.tool_type, f"Must be {self.tool_type}"
comp = tool.Comp()
with comp_lock_and_undo_chunk(comp, "Remove tool"):
tool.Delete()

View file

@ -14,7 +14,7 @@ import hiero
from Qt import QtWidgets
from openpype.client import get_project
from openpype.settings import get_anatomy_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io, Anatomy
from openpype.pipeline.load import filter_containers
from openpype.lib import Logger
@ -878,8 +878,7 @@ def apply_colorspace_project():
project.close()
# get presets for hiero
imageio = get_anatomy_settings(
project_name)["imageio"].get("hiero", None)
imageio = get_project_settings(project_name)["hiero"]["imageio"]
presets = imageio.get("workfile")
# save the workfile as subversion "comment:_colorspaceChange"
@ -932,8 +931,7 @@ def apply_colorspace_clips():
clips = project.clips()
# get presets for hiero
imageio = get_anatomy_settings(
project_name)["imageio"].get("hiero", None)
imageio = get_project_settings(project_name)["hiero"]["imageio"]
from pprint import pprint
presets = imageio.get("regexInputs", {}).get("inputs", {})

View file

@ -8,7 +8,7 @@ import hiero
from Qt import QtWidgets, QtCore
import qargparse
import openpype.api as openpype
from openpype.settings import get_current_project_settings
from openpype.lib import Logger
from openpype.pipeline import LoaderPlugin, LegacyCreator
from openpype.pipeline.context_tools import get_current_project_asset
@ -606,7 +606,7 @@ class Creator(LegacyCreator):
def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
import openpype.hosts.hiero.api as phiero
self.presets = openpype.get_current_project_settings()[
self.presets = get_current_project_settings()[
"hiero"]["create"].get(self.__class__.__name__, {})
# adding basic current context resolve objects

View file

@ -8,7 +8,7 @@ from functools import partial
import maya.cmds as cmds
import maya.mel as mel
from openpype.api import resources
from openpype import resources
from openpype.tools.utils import host_tools
from .lib import get_main_window

View file

@ -23,7 +23,7 @@ from openpype.client import (
get_last_versions,
get_representation_by_name
)
from openpype.api import get_anatomy_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
legacy_io,
discover_loader_plugins,
@ -3159,7 +3159,7 @@ def set_colorspace():
"""Set Colorspace from project configuration
"""
project_name = os.getenv("AVALON_PROJECT")
imageio = get_anatomy_settings(project_name)["imageio"]["maya"]
imageio = get_project_settings(project_name)["maya"]["imageio"]
# Maya 2022+ introduces new OCIO v2 color management settings that
# can override the old color managenement preferences. OpenPype has

View file

@ -6,7 +6,7 @@ import six
import sys
from openpype.lib import Logger
from openpype.api import (
from openpype.settings import (
get_project_settings,
get_current_project_settings
)

View file

@ -9,7 +9,7 @@ import requests
from maya import cmds
from maya.app.renderSetup.model import renderSetup
from openpype.api import (
from openpype.settings import (
get_system_settings,
get_project_settings,
)

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Creator for Unreal Static Meshes."""
from openpype.hosts.maya.api import plugin, lib
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io
from maya import cmds # noqa

View file

@ -12,7 +12,7 @@ from openpype.hosts.maya.api import (
lib,
plugin
)
from openpype.api import (
from openpype.settings import (
get_system_settings,
get_project_settings
)

View file

@ -1,7 +1,7 @@
import os
import clique
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -4,7 +4,7 @@ from openpype.pipeline import (
load,
get_representation_path
)
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
class GpuCacheLoader(load.LoaderPlugin):

View file

@ -5,7 +5,7 @@ import clique
import maya.cmds as cmds
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -1,7 +1,7 @@
import os
from maya import cmds
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io
from openpype.pipeline.create import (
legacy_create,

View file

@ -1,6 +1,6 @@
import os
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -1,6 +1,6 @@
import os
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -1,6 +1,6 @@
import os
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -10,7 +10,7 @@ import os
import maya.cmds as cmds
from openpype.client import get_representation_by_name
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
legacy_io,
load,

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
import maya.cmds as cmds # noqa
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path

View file

@ -6,7 +6,7 @@ from collections import defaultdict
import clique
from maya import cmds
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
@ -250,7 +250,7 @@ class YetiCacheLoader(load.LoaderPlugin):
"""
name = node_name.replace(":", "_")
pattern = r"^({name})(\.[0-4]+)?(\.fur)$".format(name=re.escape(name))
pattern = r"^({name})(\.[0-9]+)?(\.fur)$".format(name=re.escape(name))
files = [fname for fname in os.listdir(root) if re.match(pattern,
fname)]

View file

@ -1,7 +1,7 @@
import os
from collections import defaultdict
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
import openpype.hosts.maya.api.plugin
from openpype.hosts.maya.api import lib

View file

@ -136,8 +136,10 @@ class ExtractPlayblast(publish.Extractor):
self.log.debug("playblast path {}".format(path))
collected_files = os.listdir(stagingdir)
patterns = [clique.PATTERNS["frames"]]
collections, remainder = clique.assemble(collected_files,
minimum_items=1)
minimum_items=1,
patterns=patterns)
self.log.debug("filename {}".format(filename))
frame_collection = None

View file

@ -11,7 +11,7 @@ import pyblish.api
from openpype.lib import requests_post
from openpype.hosts.maya.api import lib
from openpype.pipeline import legacy_io
from openpype.api import get_system_settings
from openpype.settings import get_system_settings
# mapping between Maya renderer names and Muster template ids

View file

@ -1,5 +1,5 @@
import os
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import install_host
from openpype.hosts.maya.api import MayaHost
from maya import cmds

View file

@ -563,7 +563,15 @@ def get_node_path(path, padding=4):
def get_nuke_imageio_settings():
return get_anatomy_settings(Context.project_name)["imageio"]["nuke"]
project_imageio = get_project_settings(
Context.project_name)["nuke"]["imageio"]
# backward compatibility for project started before 3.10
# those are still having `__legacy__` knob types
if not project_imageio["enabled"]:
return get_anatomy_settings(Context.project_name)["imageio"]["nuke"]
return get_project_settings(Context.project_name)["nuke"]["imageio"]
def get_created_node_imageio_setting_legacy(nodeclass, creator, subset):

View file

@ -7,9 +7,7 @@ import nuke
import pyblish.api
import openpype
from openpype.api import (
get_current_project_settings
)
from openpype.settings import get_current_project_settings
from openpype.lib import register_event_callback, Logger
from openpype.pipeline import (
register_loader_plugin_path,

View file

@ -6,7 +6,7 @@ from abc import abstractmethod
import nuke
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.pipeline import (
LegacyCreator,
LoaderPlugin,

View file

@ -1,7 +1,7 @@
import os
import nuke
from openpype.api import resources
from openpype import resources
from .lib import maintained_selection

View file

@ -425,7 +425,7 @@ class LoadClip(plugin.NukeLoader):
colorspace = repre_data.get("colorspace")
colorspace = colorspace or version_data.get("colorspace")
# colorspace from `project_anatomy/imageio/nuke/regexInputs`
# colorspace from `project_settings/nuke/imageio/regexInputs`
iio_colorspace = get_imageio_input_colorspace(path)
# Set colorspace defined in version data

View file

@ -77,11 +77,14 @@ class ValidateNukeWriteNode(pyblish.api.InstancePlugin):
# fix type differences
if type(node_value) in (int, float):
if isinstance(value, list):
value = color_gui_to_int(value)
else:
value = float(value)
node_value = float(node_value)
try:
if isinstance(value, list):
value = color_gui_to_int(value)
else:
value = float(value)
node_value = float(node_value)
except ValueError:
value = str(value)
else:
value = str(value)
node_value = str(node_value)

View file

@ -504,7 +504,7 @@ class Creator(LegacyCreator):
def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
resolve_p_settings = get_current_project_settings().get("resolve")
self.presets = {}
if resolve_p_settings:

View file

@ -1,6 +1,6 @@
import os
from openpype.lib import Logger
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
log = Logger.get_logger(__name__)

View file

@ -10,7 +10,7 @@ import pyblish.api
from openpype.client import get_project, get_asset_by_name
from openpype.hosts import tvpaint
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.lib import register_event_callback
from openpype.pipeline import (
legacy_io,

View file

@ -24,7 +24,7 @@ from openpype.pipeline import (
legacy_io,
)
from openpype.pipeline.context_tools import get_current_project_asset
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api import pipeline as unreal_pipeline

View file

@ -36,6 +36,17 @@ from openpype_modules.deadline import abstract_submit_deadline
from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo
def _validate_deadline_bool_value(instance, attribute, value):
if not isinstance(value, (str, bool)):
raise TypeError(
"Attribute {} must be str or bool.".format(attribute))
if value not in {"1", "0", True, False}:
raise ValueError(
("Value of {} must be one of "
"'0', '1', True, False").format(attribute)
)
@attr.s
class MayaPluginInfo:
SceneFile = attr.ib(default=None) # Input
@ -46,7 +57,9 @@ class MayaPluginInfo:
RenderLayer = attr.ib(default=None) # Render only this layer
Renderer = attr.ib(default=None)
ProjectPath = attr.ib(default=None) # Resolve relative references
RenderSetupIncludeLights = attr.ib(default=None) # Include all lights flag
# Include all lights flag
RenderSetupIncludeLights = attr.ib(
default="1", validator=_validate_deadline_bool_value)
@attr.s
@ -185,12 +198,26 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline):
instance = self._instance
context = instance.context
# Set it to default Maya behaviour if it cannot be determined
# from instance (but it should be, by the Collector).
default_rs_include_lights = (
instance.context.data['project_settings']
['maya']
['RenderSettings']
['enable_all_lights']
)
rs_include_lights = instance.data.get(
"renderSetupIncludeLights", default_rs_include_lights)
if rs_include_lights not in {"1", "0", True, False}:
rs_include_lights = default_rs_include_lights
plugin_info = MayaPluginInfo(
SceneFile=self.scene_path,
Version=cmds.about(version=True),
RenderLayer=instance.data['setMembers'],
Renderer=instance.data["renderer"],
RenderSetupIncludeLights=instance.data.get("renderSetupIncludeLights"), # noqa
RenderSetupIncludeLights=rs_include_lights, # noqa
ProjectPath=context.data["workspaceDir"],
UsingRenderLayers=True,
)
@ -500,6 +527,10 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline):
plugin_info["Renderer"] = renderer
# this is needed because renderman plugin in Deadline
# handles directory and file prefixes separately
plugin_info["OutputFilePath"] = job_info.OutputDirectory[0]
return job_info, plugin_info
def _get_vray_export_payload(self, data):

View file

@ -18,7 +18,7 @@ from openpype_modules.ftrack.lib import (
tool_definitions_from_app_manager
)
from openpype.api import get_system_settings
from openpype.settings import get_system_settings
from openpype.lib import ApplicationManager
"""

View file

@ -1,7 +1,7 @@
import os
import ftrack_api
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.lib import PostLaunchHook

View file

@ -43,7 +43,7 @@ import platform
import click
from openpype.modules import OpenPypeModule
from openpype.api import get_system_settings
from openpype.settings import get_system_settings
class JobQueueModule(OpenPypeModule):

View file

@ -12,7 +12,7 @@ from openpype.client import (
get_assets,
)
from openpype.pipeline import AvalonMongoDB
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.modules.kitsu.utils.credentials import validate_credentials

View file

@ -1,4 +1,4 @@
from openpype.api import get_system_settings, get_project_settings
from openpype.settings import get_system_settings, get_project_settings
from openpype.modules.shotgrid.lib.const import MODULE_NAME

View file

@ -246,7 +246,7 @@ class BaseCreator:
return self.icon
def get_dynamic_data(
self, variant, task_name, asset_doc, project_name, host_name
self, variant, task_name, asset_doc, project_name, host_name, instance
):
"""Dynamic data for subset name filling.
@ -257,7 +257,13 @@ class BaseCreator:
return {}
def get_subset_name(
self, variant, task_name, asset_doc, project_name, host_name=None
self,
variant,
task_name,
asset_doc,
project_name,
host_name=None,
instance=None
):
"""Return subset name for passed context.
@ -271,16 +277,21 @@ class BaseCreator:
Asset document is not used yet but is required if would like to use
task type in subset templates.
Method is also called on subset name update. In that case origin
instance is passed in.
Args:
variant(str): Subset name variant. In most of cases user input.
task_name(str): For which task subset is created.
asset_doc(dict): Asset document for which subset is created.
project_name(str): Project name.
host_name(str): Which host creates subset.
instance(str|None): Object of 'CreatedInstance' for which is
subset name updated. Passed only on subset name update.
"""
dynamic_data = self.get_dynamic_data(
variant, task_name, asset_doc, project_name, host_name
variant, task_name, asset_doc, project_name, host_name, instance
)
return get_subset_name(

View file

@ -1,5 +1,8 @@
from pyblish import api
from openpype.api import get_current_project_settings, get_system_settings
from openpype.settings import (
get_current_project_settings,
get_system_settings,
)
class CollectSettings(api.ContextPlugin):

View file

@ -4,8 +4,6 @@ import clique
import errno
import shutil
from bson.objectid import ObjectId
from pymongo import InsertOne, ReplaceOne
import pyblish.api
from openpype.client import (
@ -14,10 +12,15 @@ from openpype.client import (
get_archived_representations,
get_representations,
)
from openpype.client.operations import (
OperationsSession,
new_hero_version_doc,
prepare_hero_version_update_data,
prepare_representation_update_data,
)
from openpype.lib import create_hard_link
from openpype.pipeline import (
schema,
legacy_io,
schema
)
from openpype.pipeline.publish import get_publish_template_name
@ -187,35 +190,32 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
repre["name"].lower(): repre for repre in old_repres
}
op_session = OperationsSession()
entity_id = None
if old_version:
new_version_id = old_version["_id"]
else:
new_version_id = ObjectId()
new_hero_version = {
"_id": new_version_id,
"version_id": src_version_entity["_id"],
"parent": src_version_entity["parent"],
"type": "hero_version",
"schema": "openpype:hero_version-1.0"
}
schema.validate(new_hero_version)
# Don't make changes in database until everything is O.K.
bulk_writes = []
entity_id = old_version["_id"]
new_hero_version = new_hero_version_doc(
src_version_entity["_id"],
src_version_entity["parent"],
entity_id=entity_id
)
if old_version:
self.log.debug("Replacing old hero version.")
bulk_writes.append(
ReplaceOne(
{"_id": new_hero_version["_id"]},
new_hero_version
)
update_data = prepare_hero_version_update_data(
old_version, new_hero_version
)
op_session.update_entity(
project_name,
new_hero_version["type"],
old_version["_id"],
update_data
)
else:
self.log.debug("Creating first hero version.")
bulk_writes.append(
InsertOne(new_hero_version)
op_session.create_entity(
project_name, new_hero_version["type"], new_hero_version
)
# Separate old representations into `to replace` and `to delete`
@ -235,7 +235,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
archived_repres = list(get_archived_representations(
project_name,
# Check what is type of archived representation
version_ids=[new_version_id]
version_ids=[new_hero_version["_id"]]
))
archived_repres_by_name = {}
for repre in archived_repres:
@ -382,12 +382,15 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
# Replace current representation
if repre_name_low in old_repres_to_replace:
old_repre = old_repres_to_replace.pop(repre_name_low)
repre["_id"] = old_repre["_id"]
bulk_writes.append(
ReplaceOne(
{"_id": old_repre["_id"]},
repre
)
update_data = prepare_representation_update_data(
old_repre, repre)
op_session.update_entity(
project_name,
old_repre["type"],
old_repre["_id"],
update_data
)
# Unarchive representation
@ -395,21 +398,21 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
archived_repre = archived_repres_by_name.pop(
repre_name_low
)
old_id = archived_repre["old_id"]
repre["_id"] = old_id
bulk_writes.append(
ReplaceOne(
{"old_id": old_id},
repre
)
repre["_id"] = archived_repre["old_id"]
update_data = prepare_representation_update_data(
archived_repre, repre)
op_session.update_entity(
project_name,
old_repre["type"],
archived_repre["_id"],
update_data
)
# Create representation
else:
repre["_id"] = ObjectId()
bulk_writes.append(
InsertOne(repre)
)
repre.pop("_id", None)
op_session.create_entity(project_name, "representation",
repre)
self.path_checks = []
@ -430,28 +433,22 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
archived_repre = archived_repres_by_name.pop(
repre_name_low
)
repre["old_id"] = repre["_id"]
repre["_id"] = archived_repre["_id"]
repre["type"] = archived_repre["type"]
bulk_writes.append(
ReplaceOne(
{"_id": archived_repre["_id"]},
repre
)
)
changes = {"old_id": repre["_id"],
"_id": archived_repre["_id"],
"type": archived_repre["type"]}
op_session.update_entity(project_name,
archived_repre["type"],
archived_repre["_id"],
changes)
else:
repre["old_id"] = repre["_id"]
repre["_id"] = ObjectId()
repre["old_id"] = repre.pop("_id")
repre["type"] = "archived_representation"
bulk_writes.append(
InsertOne(repre)
)
op_session.create_entity(project_name,
"archived_representation",
repre)
if bulk_writes:
legacy_io.database[project_name].bulk_write(
bulk_writes
)
op_session.commit()
# Remove backuped previous hero
if (

View file

@ -10,7 +10,8 @@ class ValidateVersion(pyblish.api.InstancePlugin):
order = pyblish.api.ValidatorOrder
label = "Validate Version"
hosts = ["nuke", "maya", "houdini", "blender", "standalonepublisher"]
hosts = ["nuke", "maya", "houdini", "blender", "standalonepublisher",
"photoshop", "aftereffects"]
optional = False
active = True

View file

@ -1,4 +1,23 @@
{
"imageio": {
"project": {
"colourPolicy": "ACES 1.1",
"frameDepth": "16-bit fp",
"fieldDominance": "PROGRESSIVE"
},
"profilesMapping": {
"inputs": [
{
"flameName": "ACEScg",
"ocioName": "ACES - ACEScg"
},
{
"flameName": "Rec.709 video",
"ocioName": "Output - Rec.709"
}
]
}
},
"create": {
"CreateShotClip": {
"hierarchy": "{folder}/{sequence}",

View file

@ -1,4 +1,29 @@
{
"imageio": {
"workfile": {
"ocioConfigName": "nuke-default",
"ocioconfigpath": {
"windows": [],
"darwin": [],
"linux": []
},
"workingSpace": "linear",
"sixteenBitLut": "sRGB",
"eightBitLut": "sRGB",
"floatLut": "linear",
"logLut": "Cineon",
"viewerLut": "sRGB",
"thumbnailLut": "sRGB"
},
"regexInputs": {
"inputs": [
{
"regex": "[^-a-zA-Z0-9](plateRef).*(?=mp4)",
"colorspace": "sRGB"
}
]
}
},
"create": {
"CreateShotClip": {
"hierarchy": "{folder}/{sequence}",

View file

@ -1,4 +1,26 @@
{
"imageio": {
"colorManagementPreference_v2": {
"enabled": true,
"configFilePath": {
"windows": [],
"darwin": [],
"linux": []
},
"renderSpace": "ACEScg",
"displayName": "sRGB",
"viewName": "ACES 1.0 SDR-video"
},
"colorManagementPreference": {
"configFilePath": {
"windows": [],
"darwin": [],
"linux": []
},
"renderSpace": "scene-linear Rec 709/sRGB",
"viewTransform": "sRGB gamma"
}
},
"mel_workspace": "workspace -fr \"shaders\" \"renderData/shaders\";\nworkspace -fr \"images\" \"renders\";\nworkspace -fr \"particles\" \"particles\";\nworkspace -fr \"mayaAscii\" \"\";\nworkspace -fr \"mayaBinary\" \"\";\nworkspace -fr \"scene\" \"\";\nworkspace -fr \"alembicCache\" \"cache/alembic\";\nworkspace -fr \"renderData\" \"renderData\";\nworkspace -fr \"sourceImages\" \"sourceimages\";\nworkspace -fr \"fileCache\" \"cache/nCache\";\n",
"ext_mapping": {
"model": "ma",
@ -35,7 +57,7 @@
"RenderSettings": {
"apply_render_settings": true,
"default_render_image_folder": "renders",
"enable_all_lights": false,
"enable_all_lights": true,
"aov_separator": "underscore",
"reset_current_frame": false,
"arnold_renderer": {

View file

@ -8,6 +8,197 @@
"build_workfile": "ctrl+alt+b"
}
},
"imageio": {
"enabled": false,
"viewer": {
"viewerProcess": "sRGB"
},
"baking": {
"viewerProcess": "rec709"
},
"workfile": {
"colorManagement": "Nuke",
"OCIO_config": "nuke-default",
"customOCIOConfigPath": {
"windows": [],
"darwin": [],
"linux": []
},
"workingSpaceLUT": "linear",
"monitorLut": "sRGB",
"int8Lut": "sRGB",
"int16Lut": "sRGB",
"logLut": "Cineon",
"floatLut": "linear"
},
"nodes": {
"requiredNodes": [
{
"plugins": [
"CreateWriteRender"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "exr"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit half"
},
{
"type": "text",
"name": "compression",
"value": "Zip (1 scanline)"
},
{
"type": "bool",
"name": "autocrop",
"value": true
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
186,
35,
35,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "linear"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
},
{
"plugins": [
"CreateWritePrerender"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "exr"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit half"
},
{
"type": "text",
"name": "compression",
"value": "Zip (1 scanline)"
},
{
"type": "bool",
"name": "autocrop",
"value": true
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
171,
171,
10,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "linear"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
},
{
"plugins": [
"CreateWriteStill"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "tiff"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit"
},
{
"type": "text",
"name": "compression",
"value": "Deflate"
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
56,
162,
7,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "sRGB"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
}
],
"overrideNodes": []
},
"regexInputs": {
"inputs": [
{
"regex": "(beauty).*(?=.exr)",
"colorspace": "linear"
}
]
}
},
"nuke-dirmap": {
"enabled": false,
"paths": {

View file

@ -5,6 +5,69 @@
"label": "Flame",
"is_file": true,
"children": [
{
"key": "imageio",
"type": "dict",
"label": "Color Management (ImageIO)",
"is_group": true,
"children": [
{
"key": "project",
"type": "dict",
"label": "Project",
"collapsible": false,
"children": [
{
"type": "form",
"children": [
{
"type": "text",
"key": "colourPolicy",
"label": "Colour Policy (name or path)"
},
{
"type": "text",
"key": "frameDepth",
"label": "Image Depth"
},
{
"type": "text",
"key": "fieldDominance",
"label": "Field Dominance"
}
]
}
]
},
{
"key": "profilesMapping",
"type": "dict",
"label": "Profile names mapping",
"collapsible": true,
"children": [
{
"type": "list",
"key": "inputs",
"object_type": {
"type": "dict",
"children": [
{
"type": "text",
"key": "flameName",
"label": "Flame name"
},
{
"type": "text",
"key": "ocioName",
"label": "OCIO name"
}
]
}
}
]
}
]
},
{
"type": "dict",
"collapsible": true,

View file

@ -5,6 +5,116 @@
"label": "Hiero",
"is_file": true,
"children": [
{
"key": "imageio",
"type": "dict",
"label": "Color Management (ImageIO)",
"is_group": true,
"collapsible": true,
"children": [
{
"key": "workfile",
"type": "dict",
"label": "Workfile",
"collapsible": false,
"children": [
{
"type": "form",
"children": [
{
"type": "enum",
"key": "ocioConfigName",
"label": "OpenColorIO Config",
"enum_items": [
{
"nuke-default": "nuke-default"
},
{
"aces_1.0.3": "aces_1.0.3"
},
{
"aces_1.1": "aces_1.1"
},
{
"custom": "custom"
}
]
},
{
"type": "path",
"key": "ocioconfigpath",
"label": "Custom OCIO path",
"multiplatform": true,
"multipath": true
},
{
"type": "text",
"key": "workingSpace",
"label": "Working Space"
},
{
"type": "text",
"key": "sixteenBitLut",
"label": "16 Bit Files"
},
{
"type": "text",
"key": "eightBitLut",
"label": "8 Bit Files"
},
{
"type": "text",
"key": "floatLut",
"label": "Floating Point Files"
},
{
"type": "text",
"key": "logLut",
"label": "Log Files"
},
{
"type": "text",
"key": "viewerLut",
"label": "Viewer"
},
{
"type": "text",
"key": "thumbnailLut",
"label": "Thumbnails"
}
]
}
]
},
{
"key": "regexInputs",
"type": "dict",
"label": "Colorspace on Inputs by regex detection",
"collapsible": true,
"children": [
{
"type": "list",
"key": "inputs",
"object_type": {
"type": "dict",
"children": [
{
"type": "text",
"key": "regex",
"label": "Regex"
},
{
"type": "text",
"key": "colorspace",
"label": "Colorspace"
}
]
}
}
]
}
]
},
{
"type": "dict",
"collapsible": true,

View file

@ -5,6 +5,76 @@
"label": "Maya",
"is_file": true,
"children": [
{
"key": "imageio",
"type": "dict",
"label": "Color Management (ImageIO)",
"collapsible": true,
"is_group": true,
"children": [
{
"key": "colorManagementPreference_v2",
"type": "dict",
"label": "Color Management Preference v2 (Maya 2022+)",
"collapsible": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Use Color Management Preference v2"
},
{
"type": "path",
"key": "configFilePath",
"label": "OCIO Config File Path",
"multiplatform": true,
"multipath": true
},
{
"type": "text",
"key": "renderSpace",
"label": "Rendering Space"
},
{
"type": "text",
"key": "displayName",
"label": "Display"
},
{
"type": "text",
"key": "viewName",
"label": "View"
}
]
},
{
"key": "colorManagementPreference",
"type": "dict",
"label": "Color Management Preference (legacy)",
"collapsible": true,
"children": [
{
"type": "path",
"key": "configFilePath",
"label": "OCIO Config File Path",
"multiplatform": true,
"multipath": true
},
{
"type": "text",
"key": "renderSpace",
"label": "Rendering Space"
},
{
"type": "text",
"key": "viewTransform",
"label": "Viewer Transform"
}
]
}
]
},
{
"type": "text",
"multiline" : true,

View file

@ -46,6 +46,10 @@
}
]
},
{
"type": "schema",
"name": "schema_nuke_imageio"
},
{
"type": "dict",
"collapsible": true,

View file

@ -1,10 +1,14 @@
{
"type": "dict",
"key": "imageio",
"label": "Color Management and Output Formats",
"label": "Color Management and Output Formats (Deprecated)",
"is_file": true,
"is_group": true,
"children": [
{
"type": "label",
"label": "These settings are deprecated and have moved to: <i>project_settings/{app}/imageio</i>.<br>You can right click to copy each host's values and paste them to apply to each host as needed.<br>Changing these values here will not do anything."
},
{
"key": "hiero",
"type": "dict",

View file

@ -0,0 +1,254 @@
{
"key": "imageio",
"type": "dict",
"label": "Color Management (ImageIO)",
"checkbox_key": "enabled",
"collapsible": true,
"is_group": true,
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"key": "viewer",
"type": "dict",
"label": "Viewer",
"collapsible": false,
"children": [
{
"type": "text",
"key": "viewerProcess",
"label": "Viewer Process"
}
]
},
{
"key": "baking",
"type": "dict",
"label": "Extract-review baking profile",
"collapsible": false,
"children": [
{
"type": "text",
"key": "viewerProcess",
"label": "Viewer Process"
}
]
},
{
"key": "workfile",
"type": "dict",
"label": "Workfile",
"collapsible": false,
"children": [
{
"type": "form",
"children": [
{
"type": "enum",
"key": "colorManagement",
"label": "color management",
"enum_items": [
{
"Nuke": "Nuke"
},
{
"OCIO": "OCIO"
}
]
},
{
"type": "enum",
"key": "OCIO_config",
"label": "OpenColorIO Config",
"enum_items": [
{
"nuke-default": "nuke-default"
},
{
"spi-vfx": "spi-vfx"
},
{
"spi-anim": "spi-anim"
},
{
"aces_0.1.1": "aces_0.1.1"
},
{
"aces_0.7.1": "aces_0.7.1"
},
{
"aces_1.0.1": "aces_1.0.1"
},
{
"aces_1.0.3": "aces_1.0.3"
},
{
"aces_1.1": "aces_1.1"
},
{
"aces_1.2": "aces_1.2"
},
{
"custom": "custom"
}
]
},
{
"type": "path",
"key": "customOCIOConfigPath",
"label": "Custom OCIO config path",
"multiplatform": true,
"multipath": true
},
{
"type": "text",
"key": "workingSpaceLUT",
"label": "Working Space"
},
{
"type": "text",
"key": "monitorLut",
"label": "monitor"
},
{
"type": "text",
"key": "int8Lut",
"label": "8-bit files"
},
{
"type": "text",
"key": "int16Lut",
"label": "16-bit files"
},
{
"type": "text",
"key": "logLut",
"label": "log files"
},
{
"type": "text",
"key": "floatLut",
"label": "float files"
}
]
}
]
},
{
"key": "nodes",
"type": "dict",
"label": "Nodes",
"collapsible": true,
"children": [
{
"key": "requiredNodes",
"type": "list",
"label": "Plugin required",
"object_type": {
"type": "dict",
"children": [
{
"type": "list",
"key": "plugins",
"label": "Used in plugins",
"object_type": {
"type": "text",
"key": "pluginClass"
}
},
{
"type": "text",
"key": "nukeNodeClass",
"label": "Nuke Node Class"
},
{
"type": "schema_template",
"name": "template_nuke_knob_inputs",
"template_data": [
{
"label": "Knobs",
"key": "knobs"
}
]
}
]
}
},
{
"type": "splitter"
},
{
"type": "list",
"key": "overrideNodes",
"label": "Plugin's node overrides",
"object_type": {
"type": "dict",
"children": [
{
"type": "list",
"key": "plugins",
"label": "Used in plugins",
"object_type": {
"type": "text",
"key": "pluginClass"
}
},
{
"type": "text",
"key": "nukeNodeClass",
"label": "Nuke Node Class"
},
{
"key": "subsets",
"label": "Subsets",
"type": "list",
"object_type": "text"
},
{
"type": "schema_template",
"name": "template_nuke_knob_inputs",
"template_data": [
{
"label": "Knobs overrides",
"key": "knobs"
}
]
}
]
}
}
]
},
{
"key": "regexInputs",
"type": "dict",
"label": "Colorspace on Inputs by regex detection",
"collapsible": true,
"children": [
{
"type": "list",
"key": "inputs",
"object_type": {
"type": "dict",
"children": [
{
"type": "text",
"key": "regex",
"label": "Regex"
},
{
"type": "text",
"key": "colorspace",
"label": "Colorspace"
}
]
}
}
]
}
]
}

View file

@ -6,7 +6,7 @@ from Qt import QtWidgets, QtCore
from openpype.client import get_asset_by_name, get_subsets
from openpype import style
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.tools.utils.lib import qt_app_context
from openpype.pipeline import legacy_io
from openpype.pipeline.create import (

View file

@ -4,7 +4,7 @@ from Qt import QtWidgets, QtGui
from openpype import PLUGINS_DIR
from openpype import style
from openpype.api import resources
from openpype import resources
from openpype.lib import (
Logger,
ApplictionExecutableNotFound,

View file

@ -1,7 +1,7 @@
import os
from Qt import QtGui
import qtawesome
from openpype.api import resources
from openpype import resources
ICON_CACHE = {}
NOT_FOUND = type("NotFound", (object, ), {})

View file

@ -4,7 +4,7 @@ import logging
from Qt import QtWidgets, QtCore, QtGui
from openpype import style
from openpype.api import resources
from openpype import resources
from openpype.pipeline import AvalonMongoDB
import qtawesome

View file

@ -1097,7 +1097,11 @@ class GlobalAttrsWidget(QtWidgets.QWidget):
try:
new_subset_name = instance.creator.get_subset_name(
new_variant_value, new_task_name, asset_doc, project_name
new_variant_value,
new_task_name,
asset_doc,
project_name,
instance=instance
)
except TaskNotSetError:
invalid_tasks = True

View file

@ -22,7 +22,7 @@ import pyblish.version
from . import util
from .constants import InstanceStates
from openpype.api import get_project_settings
from openpype.settings import get_current_project_settings
class IterationBreak(Exception):
@ -204,7 +204,7 @@ class Controller(QtCore.QObject):
def presets_by_hosts(self):
# Get global filters as base
presets = get_project_settings(os.environ['AVALON_PROJECT']) or {}
presets = get_current_project_settings()
if not presets:
return {}

View file

@ -34,7 +34,7 @@ import qtawesome
from six import text_type
from .constants import PluginStates, InstanceStates, GroupStates, Roles
from openpype.api import get_system_settings
from openpype.settings import get_system_settings
# ItemTypes

View file

@ -2,6 +2,10 @@ from Qt import QtWidgets, QtGui
from openpype import style
from openpype.settings import (
SystemSettings,
ProjectSettings
)
from openpype.settings.lib import (
get_local_settings,
save_local_settings
@ -9,10 +13,6 @@ from openpype.settings.lib import (
from openpype.lib import Logger
from openpype.tools.settings import CHILD_OFFSET
from openpype.tools.utils import MessageOverlayObject
from openpype.api import (
SystemSettings,
ProjectSettings
)
from openpype.modules import ModulesManager
from .widgets import (

View file

@ -13,7 +13,7 @@ from .widgets import (
)
from .widgets.constants import HOST_NAME
from openpype import style
from openpype.api import resources
from openpype import resources
from openpype.pipeline import AvalonMongoDB
from openpype.modules import ModulesManager

View file

@ -5,7 +5,7 @@ import collections
from Qt import QtCore, QtGui, QtWidgets
from openpype import style
from openpype.api import resources
from openpype import resources
from openpype.settings.lib import get_local_settings
from openpype.lib.pype_info import (
get_all_current_info,

View file

@ -17,7 +17,7 @@ from openpype.style import (
)
from openpype.resources import get_image_path
from openpype.lib import filter_profiles, Logger
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import registered_host
log = Logger.get_logger(__name__)

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.14.4-nightly.2"
__version__ = "3.14.4-nightly.3"

View file

@ -3,7 +3,7 @@ from Qt import QtWidgets, QtCore, QtGui
from openpype import style
from openpype.resources import get_resource
from openpype.api import get_system_settings
from openpype.settings import get_system_settings
from openpype.settings.lib import (
get_local_settings,
save_local_settings

View file

@ -198,6 +198,37 @@ class RenderLayerCreator(Creator):
- **`get_dynamic_data`** (method) - Can be used to extend data for subset templates which may be required in some cases.
Methods are used before instance creation and on instance subset name update. Update may require to have access to existing instance because dynamic data should be filled from there. Because of that is instance passed to `get_subset_name` and `get_dynamic_data` so the creator can handle that cases.
This is one example where subset name template may contain `"{layer}"` which is filled during creation because the value is taken from selection. In that case `get_dynamic_data` returns value for `"layer"` -> `"{layer}"` so it can be filled in creation. But when subset name of already existing instance is updated it should return already existing value. Note: Creator must make sure the value is available on instance.
```python
from openpype.lib import prepare_template_data
from my_host import get_selected_layer
class SomeCreator(Creator):
def get_dynamic_data(
self, variant, task_name, asset_doc, project_name, host_name, instance
):
# Before instance is created return unfilled key
# - the key will be filled during creation
if instance is None:
return {"layer": "{layer}"}
# Take value from existing instance
# - creator must know where to look for the value
return {"layer": instance.data["layer"]}
def create(self, subset_name, instance_data, pre_create_data):
# Fill the layer name in
layer = get_selected_layer()
layer_name = layer["name"]
layer_fill_data = prepare_template_data({"layer": layer_name})
subset_name = subset_name.format(**layer_fill_data)
instance_data["layer"] = layer_name
...
```
#### *HiddenCreator*
Creator which is not showed in UI so artist can't trigger it directly but is available for other creators. This creator is primarily meant for cases when creation should create different types of instances. For example during editorial publishing where input is single edl file but should create 2 or more kind of instances each with different family, attributes and abilities. Arguments for creation were limited to `instance_data` and `source_data`. Data of `instance_data` should follow what is sent to other creators and `source_data` can be used to send custom data defined by main creator. It is expected that `HiddenCreator` has specific main or "parent" creator.