Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature/OP-3819_Move-subset-name-function…
Browse files Browse the repository at this point in the history
…ality
  • Loading branch information
iLLiCiTiT committed Aug 26, 2022
2 parents 7a4cd9c + 9ad7178 commit 9e7abf5
Show file tree
Hide file tree
Showing 256 changed files with 36,616 additions and 1,436 deletions.
50 changes: 25 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
# Changelog

## [3.14.1-nightly.1](https://github.com/pypeclub/OpenPype/tree/HEAD)
## [3.14.1-nightly.2](https://github.com/pypeclub/OpenPype/tree/HEAD)

[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.14.0...HEAD)

### 📖 Documentation

- Documentation: Few updates [\#3698](https://github.com/pypeclub/OpenPype/pull/3698)
- Documentation: Settings development [\#3660](https://github.com/pypeclub/OpenPype/pull/3660)

**🚀 Enhancements**

- Unreal: Define unreal as module and use host class [\#3701](https://github.com/pypeclub/OpenPype/pull/3701)
- Settings: Lock settings UI session [\#3700](https://github.com/pypeclub/OpenPype/pull/3700)
- Ftrack: More logs related to auto sync value change [\#3671](https://github.com/pypeclub/OpenPype/pull/3671)

**🐛 Bug fixes**

- Settings: Fix project overrides save [\#3708](https://github.com/pypeclub/OpenPype/pull/3708)
- Workfiles tool: Fix published workfile filtering [\#3704](https://github.com/pypeclub/OpenPype/pull/3704)
- PS, AE: Provide default variant value for workfile subset [\#3703](https://github.com/pypeclub/OpenPype/pull/3703)
- RoyalRender: handle host name that is not set [\#3695](https://github.com/pypeclub/OpenPype/pull/3695)
- Flame: retime is working on clip publishing [\#3684](https://github.com/pypeclub/OpenPype/pull/3684)

**🔀 Refactored code**

- Loader: Subset groups using client operations [\#3710](https://github.com/pypeclub/OpenPype/pull/3710)
- TVPaint: Defined as module [\#3707](https://github.com/pypeclub/OpenPype/pull/3707)
- StandalonePublisher: Define StandalonePublisher as module [\#3706](https://github.com/pypeclub/OpenPype/pull/3706)
- TrayPublisher: Define TrayPublisher as module [\#3705](https://github.com/pypeclub/OpenPype/pull/3705)
- General: Move context specific functions to context tools [\#3702](https://github.com/pypeclub/OpenPype/pull/3702)

**Merged pull requests:**

- Deadline: better logging for DL webservice failures [\#3694](https://github.com/pypeclub/OpenPype/pull/3694)
- Photoshop: resize saved images in ExtractReview for ffmpeg [\#3676](https://github.com/pypeclub/OpenPype/pull/3676)

## [3.14.0](https://github.com/pypeclub/OpenPype/tree/3.14.0) (2022-08-18)

Expand Down Expand Up @@ -91,7 +115,6 @@
- General: Update imports in start script [\#3579](https://github.com/pypeclub/OpenPype/pull/3579)
- Nuke: render family integration consistency [\#3576](https://github.com/pypeclub/OpenPype/pull/3576)
- Ftrack: Handle missing published path in integrator [\#3570](https://github.com/pypeclub/OpenPype/pull/3570)
- Nuke: publish existing frames with slate with correct range [\#3555](https://github.com/pypeclub/OpenPype/pull/3555)

**🔀 Refactored code**

Expand All @@ -111,32 +134,9 @@

[Full Changelog](https://github.com/pypeclub/OpenPype/compare/CI/3.12.2-nightly.4...3.12.2)

### 📖 Documentation

- Update website with more studios [\#3554](https://github.com/pypeclub/OpenPype/pull/3554)
- Documentation: Update publishing dev docs [\#3549](https://github.com/pypeclub/OpenPype/pull/3549)

**🚀 Enhancements**

- General: Global thumbnail extractor is ready for more cases [\#3561](https://github.com/pypeclub/OpenPype/pull/3561)

**🐛 Bug fixes**

- Maya: fix Review image plane attribute [\#3569](https://github.com/pypeclub/OpenPype/pull/3569)
- Maya: Fix animated attributes \(ie. overscan\) on loaded cameras breaking review publishing. [\#3562](https://github.com/pypeclub/OpenPype/pull/3562)
- NewPublisher: Python 2 compatible html escape [\#3559](https://github.com/pypeclub/OpenPype/pull/3559)
- Remove invalid submodules from `/vendor` [\#3557](https://github.com/pypeclub/OpenPype/pull/3557)
- General: Remove hosts filter on integrator plugins [\#3556](https://github.com/pypeclub/OpenPype/pull/3556)
- Settings: Clean default values of environments [\#3550](https://github.com/pypeclub/OpenPype/pull/3550)
- Module interfaces: Fix import error [\#3547](https://github.com/pypeclub/OpenPype/pull/3547)

**🔀 Refactored code**

- General: Use query functions in integrator [\#3563](https://github.com/pypeclub/OpenPype/pull/3563)

**Merged pull requests:**

- Maya: fix active pane loss [\#3566](https://github.com/pypeclub/OpenPype/pull/3566)

## [3.12.1](https://github.com/pypeclub/OpenPype/tree/3.12.1) (2022-07-13)

Expand Down
2 changes: 1 addition & 1 deletion openpype/client/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ def get_workfile_info(
"""
## Custom data storage:
- Settings - OP settings overrides and local settings
- Logging - logs from PypeLogger
- Logging - logs from Logger
- Webpublisher - jobs
- Ftrack - events
- Maya - Shaders
Expand Down
6 changes: 6 additions & 0 deletions openpype/client/operations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import uuid
import copy
import collections
Expand All @@ -11,6 +12,11 @@

REMOVED_VALUE = object()

PROJECT_NAME_ALLOWED_SYMBOLS = "a-zA-Z0-9_"
PROJECT_NAME_REGEX = re.compile(
"^[{}]+$".format(PROJECT_NAME_ALLOWED_SYMBOLS)
)

CURRENT_PROJECT_SCHEMA = "openpype:project-3.0"
CURRENT_PROJECT_CONFIG_SCHEMA = "openpype:config-2.0"
CURRENT_ASSET_DOC_SCHEMA = "openpype:asset-3.0"
Expand Down
15 changes: 6 additions & 9 deletions openpype/hosts/aftereffects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
def add_implementation_envs(env, _app):
"""Modify environments to contain all required for implementation."""
defaults = {
"OPENPYPE_LOG_NO_COLORS": "True",
"WEBSOCKET_URL": "ws://localhost:8097/ws/"
}
for key, value in defaults.items():
if not env.get(key):
env[key] = value
from .module import AfterEffectsModule


__all__ = (
"AfterEffectsModule",
)
75 changes: 70 additions & 5 deletions openpype/hosts/aftereffects/api/lib.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import os
import sys
import re
import json
import contextlib
import traceback
import logging
from functools import partial

from Qt import QtWidgets

from openpype.pipeline import install_host
from openpype.lib.remote_publish import headless_publish
from openpype.modules import ModulesManager

from openpype.tools.utils import host_tools
from .launch_logic import ProcessLauncher, get_stub
Expand Down Expand Up @@ -35,10 +38,18 @@ def main(*subprocess_args):
launcher.start()

if os.environ.get("HEADLESS_PUBLISH"):
launcher.execute_in_main_thread(lambda: headless_publish(
log,
"CloseAE",
os.environ.get("IS_TEST")))
manager = ModulesManager()
webpublisher_addon = manager["webpublisher"]

launcher.execute_in_main_thread(
partial(
webpublisher_addon.headless_publish,
log,
"CloseAE",
os.environ.get("IS_TEST")
)
)

elif os.environ.get("AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH", True):
save = False
if os.getenv("WORKFILES_SAVE_AS"):
Expand Down Expand Up @@ -68,3 +79,57 @@ def get_extension_manifest_path():
"CSXS",
"manifest.xml"
)


def get_unique_layer_name(layers, name):
"""
Gets all layer names and if 'name' is present in them, increases
suffix by 1 (eg. creates unique layer name - for Loader)
Args:
layers (list): of strings, names only
name (string): checked value
Returns:
(string): name_00X (without version)
"""
names = {}
for layer in layers:
layer_name = re.sub(r'_\d{3}$', '', layer)
if layer_name in names.keys():
names[layer_name] = names[layer_name] + 1
else:
names[layer_name] = 1
occurrences = names.get(name, 0)

return "{}_{:0>3d}".format(name, occurrences + 1)


def get_background_layers(file_url):
"""
Pulls file name from background json file, enrich with folder url for
AE to be able import files.
Order is important, follows order in json.
Args:
file_url (str): abs url of background json
Returns:
(list): of abs paths to images
"""
with open(file_url) as json_file:
data = json.load(json_file)

layers = list()
bg_folder = os.path.dirname(file_url)
for child in data['children']:
if child.get("filename"):
layers.append(os.path.join(bg_folder, child.get("filename")).
replace("\\", "/"))
else:
for layer in child['children']:
if layer.get("filename"):
layers.append(os.path.join(bg_folder,
layer.get("filename")).
replace("\\", "/"))
return layers
3 changes: 1 addition & 2 deletions openpype/hosts/aftereffects/api/workio.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""Host API required Work Files tool"""
import os

from openpype.pipeline import HOST_WORKFILE_EXTENSIONS
from .launch_logic import get_stub


def file_extensions():
return HOST_WORKFILE_EXTENSIONS["aftereffects"]
return [".aep"]


def has_unsaved_changes():
Expand Down
23 changes: 23 additions & 0 deletions openpype/hosts/aftereffects/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from openpype.modules import OpenPypeModule
from openpype.modules.interfaces import IHostModule


class AfterEffectsModule(OpenPypeModule, IHostModule):
name = "aftereffects"
host_name = "aftereffects"

def initialize(self, module_settings):
self.enabled = True

def add_implementation_envs(self, env, _app):
"""Modify environments to contain all required for implementation."""
defaults = {
"OPENPYPE_LOG_NO_COLORS": "True",
"WEBSOCKET_URL": "ws://localhost:8097/ws/"
}
for key, value in defaults.items():
if not env.get(key):
env[key] = value

def get_workfile_extensions(self):
return [".aep"]
8 changes: 4 additions & 4 deletions openpype/hosts/aftereffects/plugins/load/load_background.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import re

from openpype.lib import (
get_background_layers,
get_unique_layer_name
)
from openpype.pipeline import get_representation_path
from openpype.hosts.aftereffects.api import (
AfterEffectsLoader,
containerise
)
from openpype.hosts.aftereffects.api.lib import (
get_background_layers,
get_unique_layer_name,
)


class BackgroundLoader(AfterEffectsLoader):
Expand Down
7 changes: 3 additions & 4 deletions openpype/hosts/aftereffects/plugins/load/load_file.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import re

from openpype import lib

from openpype.pipeline import get_representation_path
from openpype.hosts.aftereffects.api import (
AfterEffectsLoader,
containerise
)
from openpype.hosts.aftereffects.api.lib import get_unique_layer_name


class FileLoader(AfterEffectsLoader):
Expand All @@ -28,7 +27,7 @@ def load(self, context, name=None, namespace=None, data=None):
stub = self.get_stub()
layers = stub.get_items(comps=True, folders=True, footages=True)
existing_layers = [layer.name for layer in layers]
comp_name = lib.get_unique_layer_name(
comp_name = get_unique_layer_name(
existing_layers, "{}_{}".format(context["asset"]["name"], name))

import_options = {}
Expand Down Expand Up @@ -87,7 +86,7 @@ def update(self, container, representation):
if namespace_from_container != layer_name:
layers = stub.get_items(comps=True)
existing_layers = [layer.name for layer in layers]
layer_name = lib.get_unique_layer_name(
layer_name = get_unique_layer_name(
existing_layers,
"{}_{}".format(context["asset"], context["subset"]))
else: # switching version - keep same name
Expand Down
54 changes: 4 additions & 50 deletions openpype/hosts/blender/__init__.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
import os
from .module import BlenderModule


def add_implementation_envs(env, _app):
"""Modify environments to contain all required for implementation."""
# Prepare path to implementation script
implementation_user_script_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"blender_addon"
)

# Add blender implementation script path to PYTHONPATH
python_path = env.get("PYTHONPATH") or ""
python_path_parts = [
path
for path in python_path.split(os.pathsep)
if path
]
python_path_parts.insert(0, implementation_user_script_path)
env["PYTHONPATH"] = os.pathsep.join(python_path_parts)

# Modify Blender user scripts path
previous_user_scripts = set()
# Implementation path is added to set for easier paths check inside loops
# - will be removed at the end
previous_user_scripts.add(implementation_user_script_path)

openpype_blender_user_scripts = (
env.get("OPENPYPE_BLENDER_USER_SCRIPTS") or ""
)
for path in openpype_blender_user_scripts.split(os.pathsep):
if path:
previous_user_scripts.add(os.path.normpath(path))

blender_user_scripts = env.get("BLENDER_USER_SCRIPTS") or ""
for path in blender_user_scripts.split(os.pathsep):
if path:
previous_user_scripts.add(os.path.normpath(path))

# Remove implementation path from user script paths as is set to
# `BLENDER_USER_SCRIPTS`
previous_user_scripts.remove(implementation_user_script_path)
env["BLENDER_USER_SCRIPTS"] = implementation_user_script_path

# Set custom user scripts env
env["OPENPYPE_BLENDER_USER_SCRIPTS"] = os.pathsep.join(
previous_user_scripts
)

# Define Qt binding if not defined
if not env.get("QT_PREFERRED_BINDING"):
env["QT_PREFERRED_BINDING"] = "PySide2"
__all__ = (
"BlenderModule",
)
2 changes: 1 addition & 1 deletion openpype/hosts/blender/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def lsattrs(attrs: Dict) -> List:
def read(node: bpy.types.bpy_struct_meta_idprop):
"""Return user-defined attributes from `node`"""

data = dict(node.get(pipeline.AVALON_PROPERTY))
data = dict(node.get(pipeline.AVALON_PROPERTY, {}))

# Ignore hidden/internal data
data = {
Expand Down
Loading

0 comments on commit 9e7abf5

Please sign in to comment.