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-3315_Host-implementation-defin…
Browse files Browse the repository at this point in the history
…ed-with-class
  • Loading branch information
iLLiCiTiT committed Jun 28, 2022
2 parents f846ef4 + ea97281 commit fb36060
Show file tree
Hide file tree
Showing 53 changed files with 888 additions and 775 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ website/.docusaurus

.poetry/
.python-version

tools/run_eventserver.*
41 changes: 16 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
# Changelog

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

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

### 📖 Documentation

- Linux: update OIIO package [\#3401](https://github.com/pypeclub/OpenPype/pull/3401)
- 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)
- Multiverse: expose some settings to GUI [\#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**

- Nuke: Fix keyword argument in query function [\#3414](https://github.com/pypeclub/OpenPype/pull/3414)
- Nuke: Collect representation files based on Write [\#3407](https://github.com/pypeclub/OpenPype/pull/3407)
- General: Filter representations before integration start [\#3398](https://github.com/pypeclub/OpenPype/pull/3398)
- Maya: look collector typo [\#3392](https://github.com/pypeclub/OpenPype/pull/3392)
- 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)
- Standalone: settings improvements [\#3355](https://github.com/pypeclub/OpenPype/pull/3355)
- Nuke: Load full model hierarchy by default [\#3328](https://github.com/pypeclub/OpenPype/pull/3328)

**🔀 Refactored code**

- Kitsu: renaming to plural func sync\_all\_projects [\#3397](https://github.com/pypeclub/OpenPype/pull/3397)
- Hiero: Use client query functions [\#3393](https://github.com/pypeclub/OpenPype/pull/3393)
- Nuke: Use client query functions [\#3391](https://github.com/pypeclub/OpenPype/pull/3391)
- Maya: Use client query functions [\#3385](https://github.com/pypeclub/OpenPype/pull/3385)
- Harmony: Use client query functions [\#3378](https://github.com/pypeclub/OpenPype/pull/3378)
- Celaction: Use client query functions [\#3376](https://github.com/pypeclub/OpenPype/pull/3376)
- 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)
Expand All @@ -49,7 +60,6 @@
- Ftrack: Removed requirement of pypeclub role from default settings [\#3354](https://github.com/pypeclub/OpenPype/pull/3354)
- Kitsu: Prevent crash on missing frames information [\#3352](https://github.com/pypeclub/OpenPype/pull/3352)
- Ftrack: Open browser from tray [\#3320](https://github.com/pypeclub/OpenPype/pull/3320)
- Enhancement: More control over thumbnail processing. [\#3259](https://github.com/pypeclub/OpenPype/pull/3259)

**🐛 Bug fixes**

Expand All @@ -63,6 +73,7 @@
- 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 @@ -90,15 +101,13 @@
- General: Updated windows oiio tool [\#3268](https://github.com/pypeclub/OpenPype/pull/3268)
- Unreal: add support for skeletalMesh and staticMesh to loaders [\#3267](https://github.com/pypeclub/OpenPype/pull/3267)
- Maya: reference loaders could store placeholder in referenced url [\#3264](https://github.com/pypeclub/OpenPype/pull/3264)
- TVPaint: Init file for TVPaint worker also handle guideline images [\#3250](https://github.com/pypeclub/OpenPype/pull/3250)
- Nuke: Change default icon path in settings [\#3247](https://github.com/pypeclub/OpenPype/pull/3247)

**🐛 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 @@ -109,9 +118,6 @@
- Hiero: add support for task tags 3.10.x [\#3279](https://github.com/pypeclub/OpenPype/pull/3279)
- General: Fix Oiio tool path resolving [\#3278](https://github.com/pypeclub/OpenPype/pull/3278)
- Maya: Fix udim support for e.g. uppercase \<UDIM\> tag [\#3266](https://github.com/pypeclub/OpenPype/pull/3266)
- 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)

**🔀 Refactored code**

Expand All @@ -127,21 +133,6 @@

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

**🚀 Enhancements**

- Maya: FBX camera export [\#3253](https://github.com/pypeclub/OpenPype/pull/3253)
- General: updating common vendor `scriptmenu` to 1.5.2 [\#3246](https://github.com/pypeclub/OpenPype/pull/3246)

**🐛 Bug fixes**

- 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)

**Merged pull requests:**

- Harmony: message length in 21.1 [\#3257](https://github.com/pypeclub/OpenPype/pull/3257)
- Harmony: 21.1 fix [\#3249](https://github.com/pypeclub/OpenPype/pull/3249)

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

[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.9.7...3.9.8)
Expand Down
19 changes: 16 additions & 3 deletions openpype/client/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,14 +789,19 @@ def get_last_version_by_subset_id(project_name, subset_id, fields=None):


def get_last_version_by_subset_name(
project_name, subset_name, asset_id, fields=None
project_name, subset_name, asset_id=None, asset_name=None, fields=None
):
"""Last version for passed subset name under asset id.
"""Last version for passed subset name under asset id/name.
It is required to pass 'asset_id' or 'asset_name'. Asset id is recommended
if is available.
Args:
project_name (str): Name of project where to look for queried entities.
subset_name (str): Name of subset.
asset_id (str|ObjectId): Asset id which is parnt of passed subset name.
asset_id (str|ObjectId): Asset id which is parent of passed
subset name.
asset_name (str): Asset name which is parent of passed subset name.
fields (list[str]): Fields that should be returned. All fields are
returned if 'None' is passed.
Expand All @@ -805,6 +810,14 @@ def get_last_version_by_subset_name(
Dict: Version document which can be reduced to specified 'fields'.
"""

if not asset_id and not asset_name:
return None

if not asset_id:
asset_doc = get_asset_by_name(project_name, asset_name, fields=["_id"])
if not asset_doc:
return None
asset_id = asset_doc["_id"]
subset_doc = get_subset_by_name(
project_name, subset_name, asset_id, fields=["_id"]
)
Expand Down
47 changes: 17 additions & 30 deletions openpype/hosts/celaction/plugins/publish/collect_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

import pyblish.api

from openpype.client import (
get_subsets,
get_last_versions,
get_representations
)
from openpype.pipeline import legacy_io


Expand Down Expand Up @@ -60,10 +65,10 @@ def get_subsets(self, asset_doc, representations):
"""

# Query all subsets for asset
subset_docs = legacy_io.find({
"type": "subset",
"parent": asset_doc["_id"]
})
project_name = legacy_io.active_project()
subset_docs = get_subsets(
project_name, asset_ids=[asset_doc["_id"]], fields=["_id"]
)
# Collect all subset ids
subset_ids = [
subset_doc["_id"]
Expand All @@ -76,37 +81,19 @@ def get_subsets(self, asset_doc, representations):
"Try this for start `r'.*'`: asset: `{}`"
).format(asset_doc["name"])

# Last version aggregation
pipeline = [
# Find all versions of those subsets
{"$match": {
"type": "version",
"parent": {"$in": subset_ids}
}},
# Sorting versions all together
{"$sort": {"name": 1}},
# Group them by "parent", but only take the last
{"$group": {
"_id": "$parent",
"_version_id": {"$last": "$_id"},
"name": {"$last": "$name"}
}}
]
last_versions_by_subset_id = dict()
for doc in legacy_io.aggregate(pipeline):
doc["parent"] = doc["_id"]
doc["_id"] = doc.pop("_version_id")
last_versions_by_subset_id[doc["parent"]] = doc
last_versions_by_subset_id = get_last_versions(
project_name, subset_ids, fields=["_id", "parent"]
)

version_docs_by_id = {}
for version_doc in last_versions_by_subset_id.values():
version_docs_by_id[version_doc["_id"]] = version_doc

repre_docs = legacy_io.find({
"type": "representation",
"parent": {"$in": list(version_docs_by_id.keys())},
"name": {"$in": representations}
})
repre_docs = get_representations(
project_name,
version_ids=version_docs_by_id.keys(),
representation_names=representations
)
repre_docs_by_version_id = collections.defaultdict(list)
for repre_doc in repre_docs:
version_id = repre_doc["parent"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from types import NoneType
import pyblish
import openpype.hosts.flame.api as opfapi
from openpype.hosts.flame.otio import flame_export
Expand Down Expand Up @@ -75,6 +76,12 @@ def process(self, context):
marker_data["handleEnd"]
)

# make sure there is not NoneType rather 0
if isinstance(head, NoneType):
head = 0
if isinstance(tail, NoneType):
tail = 0

# make sure value is absolute
if head != 0:
head = abs(head)
Expand Down Expand Up @@ -125,7 +132,8 @@ def process(self, context):
"flameAddTasks": self.add_tasks,
"tasks": {
task["name"]: {"type": task["type"]}
for task in self.add_tasks}
for task in self.add_tasks},
"representations": []
})
self.log.debug("__ inst_data: {}".format(pformat(inst_data)))

Expand Down
21 changes: 17 additions & 4 deletions openpype/hosts/flame/plugins/publish/extract_subset_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ExtractSubsetResources(openpype.api.Extractor):
hosts = ["flame"]

# plugin defaults
keep_original_representation = False

default_presets = {
"thumbnail": {
"active": True,
Expand All @@ -45,7 +47,9 @@ class ExtractSubsetResources(openpype.api.Extractor):
export_presets_mapping = {}

def process(self, instance):
if "representations" not in instance.data:

if not self.keep_original_representation:
# remove previeous representation if not needed
instance.data["representations"] = []

# flame objects
Expand Down Expand Up @@ -82,7 +86,11 @@ def process(self, instance):
# add default preset type for thumbnail and reviewable video
# update them with settings and override in case the same
# are found in there
export_presets = deepcopy(self.default_presets)
_preset_keys = [k.split('_')[0] for k in self.export_presets_mapping]
export_presets = {
k: v for k, v in deepcopy(self.default_presets).items()
if k not in _preset_keys
}
export_presets.update(self.export_presets_mapping)

# loop all preset names and
Expand Down Expand Up @@ -218,9 +226,14 @@ def process(self, instance):
opfapi.export_clip(
export_dir_path, exporting_clip, preset_path, **export_kwargs)

repr_name = unique_name
# make sure only first segment is used if underscore in name
# HACK: `ftrackreview_withLUT` will result only in `ftrackreview`
repr_name = unique_name.split("_")[0]
if (
"thumbnail" in unique_name
or "ftrackreview" in unique_name
):
repr_name = unique_name.split("_")[0]

# create representation data
representation_data = {
Expand Down Expand Up @@ -259,7 +272,7 @@ def process(self, instance):
if os.path.splitext(f)[-1] == ".mov"
]
# then try if thumbnail is not in unique name
or unique_name == "thumbnail"
or repr_name == "thumbnail"
):
representation_data["files"] = files.pop()
else:
Expand Down
35 changes: 18 additions & 17 deletions openpype/hosts/houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import six

from openpype.client import get_asset_by_name
from openpype.api import get_asset
from openpype.pipeline import legacy_io

Expand Down Expand Up @@ -74,16 +75,13 @@ def generate_ids(nodes, asset_id=None):
"""

if asset_id is None:
project_name = legacy_io.active_project()
asset_name = legacy_io.Session["AVALON_ASSET"]
# Get the asset ID from the database for the asset of current context
asset_data = legacy_io.find_one(
{
"type": "asset",
"name": legacy_io.Session["AVALON_ASSET"]
},
projection={"_id": True}
)
assert asset_data, "No current asset found in Session"
asset_id = asset_data['_id']
asset_doc = get_asset_by_name(project_name, asset_name, fields=["_id"])

assert asset_doc, "No current asset found in Session"
asset_id = asset_doc['_id']

node_ids = []
for node in nodes:
Expand Down Expand Up @@ -430,26 +428,29 @@ def maintained_selection():
def reset_framerange():
"""Set frame range to current asset"""

project_name = legacy_io.active_project()
asset_name = legacy_io.Session["AVALON_ASSET"]
asset = legacy_io.find_one({"name": asset_name, "type": "asset"})
# Get the asset ID from the database for the asset of current context
asset_doc = get_asset_by_name(project_name, asset_name)
asset_data = asset_doc["data"]

frame_start = asset["data"].get("frameStart")
frame_end = asset["data"].get("frameEnd")
frame_start = asset_data.get("frameStart")
frame_end = asset_data.get("frameEnd")
# Backwards compatibility
if frame_start is None or frame_end is None:
frame_start = asset["data"].get("edit_in")
frame_end = asset["data"].get("edit_out")
frame_start = asset_data.get("edit_in")
frame_end = asset_data.get("edit_out")

if frame_start is None or frame_end is None:
log.warning("No edit information found for %s" % asset_name)
return

handles = asset["data"].get("handles") or 0
handle_start = asset["data"].get("handleStart")
handles = asset_data.get("handles") or 0
handle_start = asset_data.get("handleStart")
if handle_start is None:
handle_start = handles

handle_end = asset["data"].get("handleEnd")
handle_end = asset_data.get("handleEnd")
if handle_end is None:
handle_end = handles

Expand Down
Loading

0 comments on commit fb36060

Please sign in to comment.