Merge remote-tracking branch 'origin/feature/PYPE-666_anatomy_context_data' into feature/PYPE-666_anatomy_context_data

This commit is contained in:
Jakub Jezek 2020-02-16 20:08:34 +01:00
commit 93413af6c2
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
3 changed files with 3 additions and 11 deletions

View file

@ -19,7 +19,7 @@ class CollectResourcesPath(pyblish.api.InstancePlugin):
"""Generate directory path where the files and resources will be stored"""
label = "Collect Resources Path"
order = pyblish.api.CollectorOrder + 0.995
order = pyblish.api.CollectorOrder + 0.495
def process(self, instance):
anatomy = instance.context.data["anatomy"]

View file

@ -168,14 +168,11 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
if version_data_instance:
version_data.update(version_data_instance)
# TODO remove avalon_location (shall we?)
avalon_location = api.Session["AVALON_LOCATION"]
# TODO rename method from `create_version` to
# `prepare_version` or similar...
version = self.create_version(
subset=subset,
version_number=version_number,
locations=[avalon_location],
data=version_data
)
@ -528,26 +525,21 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
return subset
def create_version(self, subset, version_number, locations, data=None):
def create_version(self, subset, version_number, data=None):
""" Copy given source to destination
Args:
subset (dict): the registered subset of the asset
version_number (int): the version number
locations (list): the currently registered locations
Returns:
dict: collection of data to create a version
"""
# Imprint currently registered location
version_locations = [location for location in locations if
location is not None]
return {"schema": "pype:version-3.0",
"type": "version",
"parent": subset["_id"],
"name": version_number,
"locations": version_locations,
"data": data}
def create_version_data(self, context, instance):