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 bugfix/stpublisher-editorial-hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Jun 23, 2022
2 parents 227553e + 2074e65 commit 26dd198
Show file tree
Hide file tree
Showing 84 changed files with 1,584 additions and 968 deletions.
46 changes: 37 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# Changelog

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

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

### 📖 Documentation

- General: Add ability to change user value for templates [\#3366](https://github.com/pypeclub/OpenPype/pull/3366)
- Feature/multiverse [\#3350](https://github.com/pypeclub/OpenPype/pull/3350)

**🚀 Enhancements**

- Hosts: More options for in-host callbacks [\#3357](https://github.com/pypeclub/OpenPype/pull/3357)
- TVPaint: Extractor use mark in/out range to render [\#3308](https://github.com/pypeclub/OpenPype/pull/3308)
- Maya: Allow more data to be published along camera 🎥 [\#3304](https://github.com/pypeclub/OpenPype/pull/3304)

**🐛 Bug fixes**

- TVPaint: Make sure exit code is set to not None [\#3382](https://github.com/pypeclub/OpenPype/pull/3382)
- Maya: vray device aspect ratio fix [\#3381](https://github.com/pypeclub/OpenPype/pull/3381)
- Harmony: added unc path to zifile command in Harmony [\#3372](https://github.com/pypeclub/OpenPype/pull/3372)

**🔀 Refactored code**

- Harmony: Use client query functions [\#3378](https://github.com/pypeclub/OpenPype/pull/3378)
- Photoshop: Use client query functions [\#3375](https://github.com/pypeclub/OpenPype/pull/3375)
- AfterEffects: Use client query functions [\#3374](https://github.com/pypeclub/OpenPype/pull/3374)
- TVPaint: Use client query functions [\#3340](https://github.com/pypeclub/OpenPype/pull/3340)
- Ftrack: Use client query functions [\#3339](https://github.com/pypeclub/OpenPype/pull/3339)
- Standalone Publisher: Use client query functions [\#3330](https://github.com/pypeclub/OpenPype/pull/3330)

**Merged pull requests:**

- Maya - added support for single frame playblast review [\#3369](https://github.com/pypeclub/OpenPype/pull/3369)

## [3.11.1](https://github.com/pypeclub/OpenPype/tree/3.11.1) (2022-06-20)

[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.11.0...3.11.1)
[Full Changelog](https://github.com/pypeclub/OpenPype/compare/CI/3.11.1-nightly.1...3.11.1)

**🆕 New features**

Expand All @@ -26,9 +60,9 @@
- AE- fix validate\_scene\_settings and renderLocal [\#3358](https://github.com/pypeclub/OpenPype/pull/3358)
- deadline: fixing misidentification of revieables [\#3356](https://github.com/pypeclub/OpenPype/pull/3356)
- General: Create only one thumbnail per instance [\#3351](https://github.com/pypeclub/OpenPype/pull/3351)
- nuke: adding extract thumbnail settings 3.10 [\#3347](https://github.com/pypeclub/OpenPype/pull/3347)
- General: Fix last version function [\#3345](https://github.com/pypeclub/OpenPype/pull/3345)
- Deadline: added OPENPYPE\_MONGO to filter [\#3336](https://github.com/pypeclub/OpenPype/pull/3336)
- Nuke: fixing farm publishing if review is disabled [\#3306](https://github.com/pypeclub/OpenPype/pull/3306)

**🔀 Refactored code**

Expand Down Expand Up @@ -61,10 +95,10 @@

**🐛 Bug fixes**

- General: Handle empty source key on instance [\#3342](https://github.com/pypeclub/OpenPype/pull/3342)
- Houdini: Fix Houdini VDB manage update wrong file attribute name [\#3322](https://github.com/pypeclub/OpenPype/pull/3322)
- Nuke: anatomy compatibility issue hacks [\#3321](https://github.com/pypeclub/OpenPype/pull/3321)
- hiero: otio p3 compatibility issue - metadata on effect use update 3.11 [\#3314](https://github.com/pypeclub/OpenPype/pull/3314)
- Nuke: fixing farm publishing if review is disabled [\#3306](https://github.com/pypeclub/OpenPype/pull/3306)
- General: Vendorized modules for Python 2 and update poetry lock [\#3305](https://github.com/pypeclub/OpenPype/pull/3305)
- Fix - added local targets to install host [\#3303](https://github.com/pypeclub/OpenPype/pull/3303)
- Settings: Add missing default settings for nuke gizmo [\#3301](https://github.com/pypeclub/OpenPype/pull/3301)
Expand All @@ -78,8 +112,6 @@
- Nuke: bake reformat was failing on string type [\#3261](https://github.com/pypeclub/OpenPype/pull/3261)
- Maya: hotfix Pxr multitexture in looks [\#3260](https://github.com/pypeclub/OpenPype/pull/3260)
- Unreal: Fix Camera Loading if Layout is missing [\#3255](https://github.com/pypeclub/OpenPype/pull/3255)
- Unreal: Fixed Animation loading in UE5 [\#3240](https://github.com/pypeclub/OpenPype/pull/3240)
- Unreal: Fixed Render creation in UE5 [\#3239](https://github.com/pypeclub/OpenPype/pull/3239)

**🔀 Refactored code**

Expand All @@ -90,7 +122,6 @@

- Maya: add pointcache family to gpu cache loader [\#3318](https://github.com/pypeclub/OpenPype/pull/3318)
- Maya look: skip empty file attributes [\#3274](https://github.com/pypeclub/OpenPype/pull/3274)
- Harmony: 21.1 fix [\#3248](https://github.com/pypeclub/OpenPype/pull/3248)

## [3.10.0](https://github.com/pypeclub/OpenPype/tree/3.10.0) (2022-05-26)

Expand All @@ -105,9 +136,6 @@

- nuke: use framerange issue [\#3254](https://github.com/pypeclub/OpenPype/pull/3254)
- Ftrack: Chunk sizes for queries has minimal condition [\#3244](https://github.com/pypeclub/OpenPype/pull/3244)
- Maya: renderman displays needs to be filtered [\#3242](https://github.com/pypeclub/OpenPype/pull/3242)
- Ftrack: Validate that the user exists on ftrack [\#3237](https://github.com/pypeclub/OpenPype/pull/3237)
- Maya: Fix support for multiple resolutions [\#3236](https://github.com/pypeclub/OpenPype/pull/3236)

**Merged pull requests:**

Expand Down
2 changes: 2 additions & 0 deletions openpype/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
get_asset_by_id,
get_asset_by_name,
get_assets,
get_archived_assets,
get_asset_ids_with_subsets,

get_subset_by_id,
Expand Down Expand Up @@ -41,6 +42,7 @@
"get_asset_by_id",
"get_asset_by_name",
"get_assets",
"get_archived_assets",
"get_asset_ids_with_subsets",

"get_subset_by_id",
Expand Down
98 changes: 95 additions & 3 deletions openpype/client/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,16 @@ def get_asset_by_name(project_name, asset_name, fields=None):
return conn.find_one(query_filter, _prepare_fields(fields))


def get_assets(
project_name, asset_ids=None, asset_names=None, archived=False, fields=None
# NOTE this could be just public function?
# - any better variable name instead of 'standard'?
# - same approach can be used for rest of types
def _get_assets(
project_name,
asset_ids=None,
asset_names=None,
standard=True,
archived=False,
fields=None
):
"""Assets for specified project by passed filters.
Expand All @@ -153,6 +161,8 @@ def get_assets(
project_name (str): Name of project where to look for queried entities.
asset_ids (list[str|ObjectId]): Asset ids that should be found.
asset_names (list[str]): Name assets that should be found.
standard (bool): Query standart assets (type 'asset').
archived (bool): Query archived assets (type 'archived_asset').
fields (list[str]): Fields that should be returned. All fields are
returned if 'None' is passed.
Expand All @@ -161,10 +171,15 @@ def get_assets(
passed filters.
"""

asset_types = ["asset"]
asset_types = []
if standard:
asset_types.append("asset")
if archived:
asset_types.append("archived_asset")

if not asset_types:
return []

if len(asset_types) == 1:
query_filter = {"type": asset_types[0]}
else:
Expand All @@ -186,6 +201,68 @@ def get_assets(
return conn.find(query_filter, _prepare_fields(fields))


def get_assets(
project_name,
asset_ids=None,
asset_names=None,
archived=False,
fields=None
):
"""Assets for specified project by passed filters.
Passed filters (ids and names) are always combined so all conditions must
match.
To receive all assets from project just keep filters empty.
Args:
project_name (str): Name of project where to look for queried entities.
asset_ids (list[str|ObjectId]): Asset ids that should be found.
asset_names (list[str]): Name assets that should be found.
archived (bool): Add also archived assets.
fields (list[str]): Fields that should be returned. All fields are
returned if 'None' is passed.
Returns:
Cursor: Query cursor as iterable which returns asset documents matching
passed filters.
"""

return _get_assets(
project_name, asset_ids, asset_names, True, archived, fields
)


def get_archived_assets(
project_name,
asset_ids=None,
asset_names=None,
fields=None
):
"""Archived assets for specified project by passed filters.
Passed filters (ids and names) are always combined so all conditions must
match.
To receive all archived assets from project just keep filters empty.
Args:
project_name (str): Name of project where to look for queried entities.
asset_ids (list[str|ObjectId]): Asset ids that should be found.
asset_names (list[str]): Name assets that should be found.
fields (list[str]): Fields that should be returned. All fields are
returned if 'None' is passed.
Returns:
Cursor: Query cursor as iterable which returns asset documents matching
passed filters.
"""

return _get_assets(
project_name, asset_ids, asset_names, False, True, fields
)


def get_asset_ids_with_subsets(project_name, asset_ids=None):
"""Find out which assets have existing subsets.
Expand Down Expand Up @@ -432,6 +509,7 @@ def _get_versions(
project_name,
subset_ids=None,
version_ids=None,
versions=None,
standard=True,
hero=False,
fields=None
Expand Down Expand Up @@ -462,6 +540,16 @@ def _get_versions(
return []
query_filter["_id"] = {"$in": version_ids}

if versions is not None:
versions = list(versions)
if not versions:
return []

if len(versions) == 1:
query_filter["name"] = versions[0]
else:
query_filter["name"] = {"$in": versions}

conn = _get_project_connection(project_name)

return conn.find(query_filter, _prepare_fields(fields))
Expand All @@ -471,6 +559,7 @@ def get_versions(
project_name,
version_ids=None,
subset_ids=None,
versions=None,
hero=False,
fields=None
):
Expand All @@ -484,6 +573,8 @@ def get_versions(
Filter ignored if 'None' is passed.
subset_ids (list[str]): Subset ids that will be queried.
Filter ignored if 'None' is passed.
versions (list[int]): Version names (as integers).
Filter ignored if 'None' is passed.
hero (bool): Look also for hero versions.
fields (list[str]): Fields that should be returned. All fields are
returned if 'None' is passed.
Expand All @@ -496,6 +587,7 @@ def get_versions(
project_name,
subset_ids,
version_ids,
versions,
standard=True,
hero=hero,
fields=fields
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/aftereffects/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def on_pyblish_instance_toggled(instance, old_value, new_value):
instance[0].Visible = new_value


def get_asset_settings():
def get_asset_settings(asset_doc):
"""Get settings on current asset from database.
Returns:
dict: Scene data.
"""
asset_data = lib.get_asset()["data"]
asset_data = asset_doc["data"]
fps = asset_data.get("fps")
frame_start = asset_data.get("frameStart")
frame_end = asset_data.get("frameEnd")
Expand Down
11 changes: 3 additions & 8 deletions openpype/hosts/aftereffects/plugins/create/workfile_creator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import openpype.hosts.aftereffects.api as api
from openpype.client import get_asset_by_name
from openpype.pipeline import (
AutoCreator,
CreatedInstance,
Expand Down Expand Up @@ -41,10 +42,7 @@ def create(self, options=None):
host_name = legacy_io.Session["AVALON_APP"]

if existing_instance is None:
asset_doc = legacy_io.find_one({
"type": "asset",
"name": asset_name
})
asset_doc = get_asset_by_name(project_name, asset_name)
subset_name = self.get_subset_name(
variant, task_name, asset_doc, project_name, host_name
)
Expand All @@ -69,10 +67,7 @@ def create(self, options=None):
existing_instance["asset"] != asset_name
or existing_instance["task"] != task_name
):
asset_doc = legacy_io.find_one({
"type": "asset",
"name": asset_name
})
asset_doc = get_asset_by_name(project_name, asset_name)
subset_name = self.get_subset_name(
variant, task_name, asset_doc, project_name, host_name
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
"""Validate scene settings."""
"""Validate scene settings.
Requires:
instance -> assetEntity
instance -> anatomyData
"""
import os
import re

Expand Down Expand Up @@ -67,7 +71,8 @@ def process(self, instance):
if not self.is_active(instance.data):
return

expected_settings = get_asset_settings()
asset_doc = instance.data["assetEntity"]
expected_settings = get_asset_settings(asset_doc)
self.log.info("config from DB::{}".format(expected_settings))

task_name = instance.data["anatomyData"]["task"]["name"]
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/harmony/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ class ImageSequenceLoader(load.LoaderPlugin):
def update(self, container, representation):
node = container.pop("node")

version = legacy_io.find_one({"_id": representation["parent"]})
project_name = legacy_io.active_project()
version = get_version_by_id(project_name, representation["parent"])
files = []
for f in version["data"]["files"]:
files.append(
Expand Down
18 changes: 8 additions & 10 deletions openpype/hosts/harmony/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from pathlib import Path
import logging

from bson.objectid import ObjectId
import pyblish.api

from openpype import lib
from openpype.client import get_representation_by_id
from openpype.lib import register_event_callback
from openpype.pipeline import (
legacy_io,
Expand Down Expand Up @@ -104,22 +104,20 @@ def check_inventory():
If it does it will colorize outdated nodes and display warning message
in Harmony.
"""
if not lib.any_outdated():
return

project_name = legacy_io.active_project()
outdated_containers = []
for container in ls():
representation = container['representation']
representation_doc = legacy_io.find_one(
{
"_id": ObjectId(representation),
"type": "representation"
},
projection={"parent": True}
representation_id = container['representation']
representation_doc = get_representation_by_id(
project_name, representation_id, fields=["parent"]
)
if representation_doc and not lib.is_latest(representation_doc):
outdated_containers.append(container)

if not outdated_containers:
return

# Colour nodes.
outdated_nodes = []
for container in outdated_containers:
Expand Down
Loading

0 comments on commit 26dd198

Please sign in to comment.