Merge pull request #17 from pypeclub/bugfix/PYPE-729-nks-allow-independent-versionin

nks allow independent versioning
This commit is contained in:
Milan Kolar 2020-03-14 22:06:26 +01:00 committed by GitHub
commit fd56b6a3a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 4 deletions

View file

@ -18,7 +18,6 @@ class CollectClips(api.ContextPlugin):
context.data["assetsShared"] = dict()
projectdata = context.data["projectEntity"]["data"]
version = context.data.get("version", "001")
sequence = context.data.get("activeSequence")
selection = context.data.get("selection")
@ -108,8 +107,7 @@ class CollectClips(api.ContextPlugin):
"family": "clip",
"families": [],
"handleStart": projectdata.get("handleStart", 0),
"handleEnd": projectdata.get("handleEnd", 0),
"version": int(version)})
"handleEnd": projectdata.get("handleEnd", 0)})
instance = context.create_instance(**data)

View file

@ -0,0 +1,18 @@
from pyblish import api
class CollectInstanceVersion(api.InstancePlugin):
""" Collecting versions of Hiero project into instances
If activated then any subset version is created in
version of the actual project.
"""
order = api.CollectorOrder + 0.011
label = "Collect Instance Version"
def process(self, instance):
version = instance.context.data.get("version", "001")
instance.data.update({
"version": int(version)
})

View file

@ -126,7 +126,7 @@ class CollectPlatesData(api.InstancePlugin):
transfer_data = [
"handleStart", "handleEnd", "sourceIn", "sourceOut", "frameStart",
"frameEnd", "sourceInH", "sourceOutH", "clipIn", "clipOut",
"clipInH", "clipOutH", "asset", "track", "version", "resolutionWidth", "resolutionHeight", "pixelAspect", "fps"
"clipInH", "clipOutH", "asset", "track", "resolutionWidth", "resolutionHeight", "pixelAspect", "fps"
]
# pass data to version
@ -141,6 +141,13 @@ class CollectPlatesData(api.InstancePlugin):
"fps": instance.context.data["fps"]
})
version = instance.data.get("version")
if version:
version_data.update({
"version": version
})
try:
basename, ext = os.path.splitext(source_file)
head, padding = os.path.splitext(basename)